Additionally, the kernel can instruct the microprocessor to prevent one program from interfering with resources being used by another, thus preventing tasks from harming one another. Whenever user space programs need to access system resources they don't own, they have to ask the kernel for help. File and network access, creating and destroying other processes, and allocating additional memory are all areas where the kernel becomes involved. By being involved in these types of operations, the kernel retains complete control over the system. One task can be refused access to a file when another is accessing it, memory allocation requests can be denied if the system is running low on resources, and users can be prevented from killing each other's processes.
System calls allow user space programs to request services from the kernel.
In C, system calls look just like normal function calls, but they have a very different implementation. Rather then simply transferring control of the program, system calls switch the system to kernel mode. Once the kernel has control, it performs the requested service, returns the system to user mode, and then transfers control back to the originating process. Compute something 2. Make a system call 3.