The random access memory (RAM) can be divided into two distinct regions namely - the kernel space and the user space.
The kernel runs in the part of memory entitled to it. This part of memory cannot be accessed directly by the processes of the normal users while as the kernel can access all parts of the memory. To access some part of the kernel, the user processes have to use the predefined system calls i.e. open, read, write etc. Also, the C library functions like `printf` call the system call `write` in turn.
The system calls act as an interface between the user processes and the kernel processes. The access rights are placed on the kernel space for stopping the users to mess up with the kernel, unknowingly.
So, when a system call occurs a software interrupt is sent to the kernel. The CPU may hand over the control temporarily to the associated interrupt handler routine, and the kernel process which was halted by the interrupt resumes after the interrupt handler routine finishes its job.