Note:to facilitate faster loading of EdCert documents, this page was borrowed from another source.
At the center of the UNIX onion is a program called the kernel. Although you are unlikely to deal with the kernel directly, it is absolutely crucial to the operation of the UNIX system. The kernel provides the essential services that make up the heart of UNIX systems; it allocates memory, keeps track of the physical location of files on the computer's hard disks, loads and executes binary programs such as shells, and schedules the task swapping without which UNIX systems would be incapable of doing more than one thing at a time. The kernel accomplishes all these tasks by providing an interface between the other programs running under its control and the physical hardware of the computer; this interface, the system call interface, effectively insulates the other programs on the UNIX system from the complexities of the computer. For example, when a running program needs access to a file, it cannot simply open the file; instead it issues a system call which asks the kernel to open the file. The kernel takes over and handles the request, then notifies the program whether the request succeeded or failed. To read data in from the file takes another system call; the kernel determines whether or not the request is valid, and if it is, the kernel reads the required block of data and passes it back to the program. Unlike DOS (and some other operating systems), UNIX system programs do not have access to the physical hardware of the computer. All they see are the kernel services, provided by the system call interface.
The system call interface is an example of an API, or application programming interface. An API is a set of system calls with strictly defined parameters, which allow an application (or other program) to request access to a service; it literally acts as an interface. (For example, a large database system might provide an API that allows programmers to write external programs that request services from the database.)
Note that the kernel is not indivisible. There are a small number
of kernel sub-processes which are executed by the kernel;
they are visible in the process listing when you type the
command ps -ef. Nor is the kernel the first program
that runs when you boot (start up) the UNIX system; see
``The UNIX system life cycle''.
In addition, the kernel
contains device drivers.
A device driver is a sub-program which is designed to enable the kernel.