Previous Section
 < Day Day Up > 
Next Section


Kernel Features

We have noticed that the kernel forms the core of the Linux operating system and is supported by a number of shared modules as well as individual executable programs. The main functions of the kernel are summarized here.

After the computer is booted, the control is ultimately transferred to the kernel, which is responsible for managing the system resources (with the help of supporting programs) for the life of the booted session. This also means a faulty kernel could make the system potentially unstable, or even unbootable.

Every time you enter a command or something happens in the system, the kernel communicates with the other subsystems of Linux, which are responsible for the execution or are required to know about the command or action. For this purpose, the kernel and its subsystems make use of a number of data structures. In fact, the kernel data structures form the basis of data communicated between the kernel and its subsystems.

Every command being executed is spawned into a new child process, which automatically ends when the execution of the command is complete. It is the kernel (scheduler) that monitors the lifetime of the running processes (and sets/resets their priorities). The processes are discussed in more detail later in this chapter.

Depending on the memory (RAM) available on the system, the kernel may swap contents of memory to the swap area for better memory use. There is also more discussion on the swap area later in this chapter. In addition to effectively utilizing the swap space, the kernel also implements concepts such as virtual memory and shared memory and other memory management techniques to make best use of the system resources as well as ensuring best possible performance.

The computer consists of a number of hardware devices, such as the video card, sound card, and network card, to name a few. Every hardware device needs the corresponding driver module in order to communicate with the kernel. There are so many vendors manufacturing a variety of hardware devices (and types) that when it comes to the device drivers, the number runs into hundreds or even more. Earlier versions of the kernel compiled the device drivers into the kernel. Such types of kernels are called monolithic kernels. This process made it a very static configuration because a particular version of Linux may not contain all the device drivers required by the entire industry. Also, the industry itself is not static. The vendors keep on designing new devices, hence, the programmers keep on writing new drivers. Enabling a kernel to recognize the new devices formerly involved the process of recompiling the kernel linking the new device drivers. Although this is not a very difficult process, it can be troublesome for a common user. It is a pretty involved process, and if the user commits any mistakes while reconfiguring the kernel, the kernel may not even be bootable. For these reasons, the Linux architects have modified the kernel design to be modular. The device drivers are built into individual modules not directly linked to the kernel. With the new design, you do not have to compile these modules into the kernel; rather, you configure the kernel externally, which means you tell the kernel which modules contain device drivers required by the different hardware devices. Such types of kernels are called modularized kernels. During the booting process, the kernel locates a device and the corresponding module is automatically loaded. If a device driver is faulty, the problem is isolated to that particular device instead of making the kernel unstable.



Previous Section
 < Day Day Up > 
Next Section