Kernel (computer science)
Akernelis the central part of an operating system. It manages the operations of the computer and thehardware,most notably memory andCPUtime.[1]Kernels also provide services which programs can use through system calls.
There are five types of kernels:
- A micro kernel - A kernel which only contains the basic functionality;
- A monolithic kernel - A kernel which contains manydevice drivers.The Linux kernel is an example of a monolithic kernel.
- Hybrid Kernel - TheMicrosoft WindowsNT kernel is an example of a hybrid kernel.
- Exokernel
- Nanokernel
A typical computer user never interacts directly with the kernel. It runs behind the scenes and cannot be seen, except for the text logs that it prints.
Operations of kernel
[change|change source]The kernel is the most fundamental part of an operating system. It can be thought of as the program which controls all other programs on the computer. When the computer starts, it goes through some initialization (booting) functions, such as checking memory. It is responsible for assigning and unassigning memory space which allowssoftwareto run.
The kernel provides services so programs can request the use of thenetwork card,the disk or other pieces of hardware. The kernel forwards the request to special programs calleddevice driverswhich control the hardware. It also manages thefile systemand sets interrupts for theCPUto enablemultitasking.Many kernels are also responsible for ensuring that faulty programs do not interfere with the operation of others by denying access to memory that has not been allocated to them and restricting the amount of CPU time they can consume. It is the heart of the operating system.
Micro kernels and monolithic kernels
[change|change source]Operating systemscommonly use monolithic kernels. InLinux,for example,device driversare often part of a kernel (specifically Loadable Kernel Modules). When a device is needed, its extension is loaded and 'joined' onto the kernel making the kernel larger. Monolithic kernels can cause trouble when one of these drivers is faulty, such as if abetadriver is downloaded. Because it is part of the kernel the faulty driver can override the mechanisms that deal with faulty programs (see above). This can mean that the kernel, and thus the entire computer, can cease to function. If there are too many devices, the kernel can also run out of memory causing a system crash or making the computer very slow.
Microkernels are a way of solving this problem. In a microkernel operating system, the kernel deals only with critical activities, such as controlling the memory and CPU, and nothing else. Drivers and other functions that monolithic kernels would normally include within the kernel are moved outside the kernel, where they are under control. Instead of being an uncontrollable part of the kernel the beta driver is, therefore, no more likely to cause a crash than a betaweb browser.That is, if a driver goes wrong it can simply be restarted by the kernel. Unfortunately, creating microkernel based operating systems is very difficult and there are no common microkernel operating systems.MinixandQNXare both microkernel operating systems.