Pages

Thursday, 19 September 2013

Modules

Perhaps the best current methodology for operating-system design involves
using object-oriented programming techniques to create a modular kernel.
Here, the kernel has a set of core components and dynamically links in
additional services either during boot time or during run time. Such a
strategy uses dynamically loadable modules and is common in modern
implementations of UNIX, such as Solaris, Linux, and Mac OS X. For example, the
Solaris operating system structure, shown in Figure 2.13, is organized around
a core kernel with seven types of loadable kernel modules:
1. Scheduling classes
2. File systems
3. Loadable system calls
4. Executable formats
5. STREAMS modules
6. Miscellaneous
7. Device and bus drivers
Such a design allows the kernel to provide core services yet also allows
certain features to be implemented dynamically. For example, device and
bus drivers for specific hardware can be added to the kernel, and support
for different file systems can be added as loadable modules. The overall
result resembles a layered system in that each kernel section has defined,
protected interfaces; but it is more flexible than a layered system in that any
module can call any other module. Furthermore, the approach is like the
microkernel approach in that the primary module has only core functions
and knowledge of how to load and communicate with other modules; but it
is more efficient, because modules do not need to invoke message passing in
order to communicate.
The Apple Macintosh Mac OS X operating system uses a hybrid structure.
Mac OS X (also known as Danvin) structures the operating system using a
layered technique where one layer consists of the Mach microkernel. The
structure of Mac OS X appears in Figure 2.14.
The top layers include application environments and a set of services
providing a graphical interface to applications. Below these layers is the kernel
environment, which consists primarily of the Mach microkernel and the BSD
kernel. Mach provides memory management; support for remote procedure
calls (RPCs) and interprocess communication (IPC) facilities, including message
passing; and thread scheduling. The BSD component provides a BSD command
line interface, support for networking and file systems, and an implementation
of POSIX APIs, including Pthreads. In addition to Mach and BSD, the kernel
environment provides an I/O kit for development of device drivers and
dynamically loadable modules (which Mac OS X refers to as kernel extensions).
As shown in the figure, applications and common services can make use of
either the Mach or BSD facilities directly.


No comments:

Post a Comment