Nov 28
2007The Kernel
Filed Under (Windows Xp) by Admin on 28-11-2007
Tagged Under : hal, ipc, kernal, memory, Microkernel, Monolithic Kernel, NT Executive, operating system, Operating System's Kernel, os, system, Windows Xp
Between applications and the hardware stands the kernel. It is the part of the operating system that performs the most basic and most critical functions that an OS is supposed to support. Its functions are:
- To make sure that all running applications (and the OS itself) get adequate CPU time to perform their operations.
- To manage the system memory and ensure that applications are getting what they need.
- To provide a Hardware Abstraction Layer (HAL), which hides the details of the hardware from applications, providing them instead with a set of instructions they can use to access the devices. This way, the application does not depend on which manufacturer the devices come from.
- To help applications talk to each other—this is called Inter-Process Communication (IPC).
- To manage files stored on the system’s hard disk.
The operating system’s kernel sits in the system memory in a protected space all to itself, called the Kernel Mode. It is this memory space that is used for the many functions it performs. The remaining space is called the user mode, and this is used by the various applications that you run on your OS. None of these applications are allowed in the kernel’s private space; this prevents them from corrupting the kernel’s data and crashing the system.
When your system starts up, the kernel is loaded into the memory, and remains there till the system shuts down.
Designing a good, robust kernel has always been a challenge, and OS developers use different approaches to get what they want.
The Monolithic Kernel
The monolithic kernel is the one-stop solution for all the features of the OS. All these features run in the kernel mode. The features are written in modules, which are logical divisions of the different functions of the OS. So your OS would have a Memory Management Module, a Disk Management Module, and so on. Software talks directly to the kernel, which talks directly to the hardware. The monolithic approach is quick and efficient because of the tight integration between all its different modules; it makes optimum use of the resources at its disposal.
However, there are dangers to this approach. It is very difficult to write kernel modules that gel well with each other, and even then, the tiniest mistake in even the most insignificant module is capable of taking the whole system down. Another problem with the monolithic kernel is that it can be quite a waste, because it loads all the kernel modules even if many of them are not need— for example, loading LAN and network management modules on a home computer that isn’t connected to a network.
The UNIX and Linux kernels are classic examples of monolithic kernels. The Linux and BSD (Berkley Software Distribution)—a variant of UNIX—kernels can even load new modules while it is running in the system’s memory to extend their capabilities when needed.
The Microkernel
The microkernel is a bare-bones kernel that only takes care of very critical functions such as basic hardware abstraction, managing processes, and handling communication between processes. All other functions are carried out by separate applications called servers, which are run in the user mode. The advantage of this design was supposed to be efficiency— servers would be loaded into the system’s memory only when needed, as opposed to the monolithic approach which loaded even unnecessary modules into memory. Moreover, a badly-written server would only cause itself to crash without crashing the entire system. However, the kernel has to manage servers like regular processes — switching between them to give each of them access to resource—and the time consumed in this activity caused it to slow down. By the mid-90s, researchers had all but given up on trying to make a faster microkernel. Newer microkernels, though, have tackled the performance issue to a respectable degree. Popular microkernel based operating systems are Apple’s Mac OS X and the Symbian OS. Because crashing servers do not crash the OS itself, microkernels are very stable, and are thus used in applications where the OS cannot be allowed to fail. A notable example is the robotic arms of the Hubble Space Telescope.
The Hybrid Kernel
The hybrid kernel is designed to compromise between the monolithic and the microkernel. It still uses servers in the user mode, but it also integrates some of these servers in the kernel mode itself to improve performance. This way, researchers aimed at striking a balance between the speed of the monolithic kernel and the stability of the microkernel.
The hybrid kernel appeared on the scene before it was realised that even pure microkernels could be high performers. Windows 2000 and Windows XP use a hybrid kernel. The microkernel itself is called the kernel, and the servers together are called the NT Executive.
ABOUT