The Structure of the Operating System

As shown in Figure 5.5, modern OSs use several internal layers. Most of system supervision (memory management and allocation of CPU time) is handled in the part of the OS that is called the kernel. Sitting on top of the kernel is another layer, usually called something like user section. This is the part that deals with programs and with the user. We'll discuss each of these layers in turn.

The Kernel

There are three principal reasons for separating the OS into a kernel and a user section. First, creating discrete layers makes it possible to isolate the part that deals with users (meaning in this case the application programs that users control) from that which deals with critical hardware management such as the control of memory and the allocation of tasks. This separation of functions improves security. There are now two layers of software, each with its own set of checks and controls, between the user's program and commands that can make critical changes to hardware systems (CPU and memory). A second benefit of having a kernel, which as the name implies is quite small, is that it takes the OS's most important and frequently used functions and keeps them in memory at all times. Because it is so concise, just a kernel, it leaves as much room as possible in memory for other programs. This, in turn, allows those programs to run faster because they have to make fewer slow trips to disk. The third benefit of the kernel concept is in portability. Because the kernel is the only part of the OS that has to understand the hardware—e.g., the CPU's instruction set and the way in which memory is organized—it is the only part that has to be rewritten when the OS is ported to another hardware platform.

Figure 5.5. A modern OS. Application (and other) programs talk only to the user section, and in turn communicate with the kernel. This isolates the kernel, which is the only layer allowed to communicate with the hardware, in a way that enhances security and stability. This separation of functions also increases flexibility.


Tech Talk

Kernel: The kernel is the component, or layer, of the operating system that works directly with the hardware (especially the CPU and memory).


Microkernel/Hardware Abstraction Layer (HAL)

The concept of a microkernel is a logical extension of the third reason for having a kernel, portability. The idea is that if you really examine the kernel carefully, you can find a lot of functions that don't depend on knowing how the CPU and memory are organized. If you leave these functions in the kernel proper, and put the rest, only those that must talk directly to the hardware, in a microkernel, you will make it much easier to port the OS to a different hardware platform. Microsoft's most advanced OS, Windows NT/Windows 2000, includes a microkernel but calls it by a more descriptive term, hardware abstraction layer. Some architects argue that microkernel-based systems are not only more portable, but also more efficient and more stable. Whatever reason is most important, it's certainly true that microkernel architectures are the modern standard.

User Section

While the other part of the OS is called various things, we'll stick with user section, not least because it is a good description. Separating this layer from the kernel (which is not done in all OSs) allows programs to get services from the OS without calling the kernel. Again, this improves security by building a cleaner wall between those parts of the OS that can talk to the hardware and those that talk to the application programs.

These parts of the OS, kernel and user section, are often described by their different operating modes. The kernel is said to operate in privileged mode (also known as supervisor mode) since it has the authority to do such dangerous things as make direct changes to memory. The user section is most often described simply as operating in user mode.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.189.193.172