Consider how different CPU modes are used when interacting with the
kernel and applications. After loading the kernel switches, the processor in
privileged mode and gets complete control of a computer. Each application
is started and executed in user mode, where it does not have access to
kernel resources and other applications. When you need to perform an
action implemented in the kernel, the application makes
a system call . The
kernel intercepts it, switches the processor to privileged mode, performs an
action, switches the processor back to user mode and returns the result of
the application.
A system call is slower than a call to a user-implemented function because
the processor switches between modes twice. For some OSes, some of the
functionality is implemented in user mode, so you don't need to use system
calls to access it.