We have already seen that as UNIX expanded, the kernel became large
and difficult to manage. In the mid-1980s, researchers at Carnegie Mellon
University developed an operating system called Mach that modularized
the kernel using the microkernel approach. This method structures the
operating system by removing all nonessential components from the kernel and implementing them as system and user-level programs. The result is a smaller
kernel. There is little consensus regarding which services should remain in the
kernel and which should be implemented in user space. Typically, however,
microkernels provide minimal process and memory management, in addition
to a communication facility.
The main function of the microkernel is to provide a communication facility
between the client program and the various services that are also running
in user space. Communication is provided by message passing, which was
described in Section 2.4.5. For example, if the client program wishes to access
a file, it must interact with the file server. The client program and service never
interact directly. Rather, they communicate indirectly by exchanging messages
with the microkernel.
One benefit of the microkernel approach is ease of extending the operating
system. All new services are added to user space and consequently do not
require modification of the kernel. When the kernel does have to be modified,
the changes tend to be fewer, because the microkernel is a smaller kernel.
The resulting operating system is easier to port from one hardware design
to another. The microkernel also provides more security and reliability, since
most services are running as user—rather than kernel—processes. If a service
fails, the rest of the operating system remains untouched.
Several contemporary operating systems have used the microkernel
approach. Tru64 UNIX (formerly Digital UNIX) provides a UNIX interface to
the user, but it is implemented with a Mach kernel. The Mach kernel maps
UNIX system calls into messages to the appropriate user-level services.
Another example is QNX. QNX is a real-time operating system that is also
based on the microkernel design. The QNX microkernel provides services
for message passing and process scheduling. It also handles low-level network
communication and hardware interrupts. All other services in QNX are
provided by standard processes that run outside the kernel in user mode.
Unfortunately, microkernels can suffer from performance decreases due
to increased system function overhead. Consider the history of Windows NT.
The first release had a layered microkernel organization. However, this version
delivered low performance compared with that of Windows 95. Windows NT
4.0 partially redressed the performance problem by moving layers from user
space to kernel space and integrating them more closely. By the time Windows
XP was designed, its architecture was more monolithic than microkernel.
No comments:
Post a Comment