In the operating system, a system call is a routine that crosses a protection domain. Adding system calls is one of several ways to extend the functions provided by the kernel. System calls provide user-mode access to special kernel functions.
The distinction between a system call and an ordinary function call is only important in the kernel programming environment. User-mode application programs are not usually aware of this distinction between system calls and ordinary function calls in the operating system.
Operating system functions are made available to the application program in the form of programming libraries. A set of library functions found in a library such as libc can have functions that perform some user-mode processing and then internally start a system call. In other cases, the system call can be directly exported by the library without a user-mode layer.
In this way, operating system functions available to application programs can be split or moved between user-mode functions and kernel-mode functions as required for different releases or machine platforms. Such movement does not affect the application program.
"Programming in the Kernel Environment Overview" provides more information on how to use system calls in the kernel environment.
A system call differs from a user function in several key ways:
The following information is provided to further assist you in extending the kernel with system calls:
Using Kernel Processes.
Handling Signals While in a System Call.
Understanding System Call Execution.