Different Structures of Operating Systems
Different Structures of Operating Systems
When DOS was originally written its developers had no idea how big and important it would
eventually become. It was written by a few programmers in a relatively short amount of time,
without the benefit of modern software engineering techniques, and then gradually grew over
time to exceed its original expectations. It does not break the system into subsystems, and
has no distinction between user and kernel modes, allowing all programs direct access to
the underlying hardware. ( Note that user versus kernel mode was not supported by the
8088 chip set anyway, so that really wasn't an option back then. )
Layered Approach
Another approach is to break the OS into a number of smaller layers, each of which
rests on the layer below it, and relies solely on the services provided by the next
lower layer.
This approach allows each layer to be developed and debugged independently, with
the assumption that all lower layers have already been debugged and are trusted to
deliver proper services.
The problem is deciding what order in which to place the layers, as no layer can call
upon the services of any higher layer, and so many chicken-and-egg situations may
arise.
Layered approaches can also be less efficient, as a request for service from a higher
layer has to filter through all lower layers before it reaches the HW, possibly with
significant processing at each step.
Microkernels
The basic idea behind micro kernels is to remove all non-essential services from the
kernel, and implement them as system applications instead, thereby making the
kernel as small and efficient as possible.
Most microkernels provide basic process and memory management, and message
passing between other services, and not much more.
Security and protection can be enhanced, as most services are performed in user
mode, not kernel mode.
System expansion can also be easier, because it only involves adding more system
applications, not rebuilding a new kernel.
Mach was the first and most widely known microkernel, and now forms a major
component of Mac OSX.
Windows NT was originally microkernel, but suffered from performance problems
relative to Windows 95. NT 4.0 improved performance by moving more services into
the kernel, and now XP is back to being more monolithic.
Another microkernel example is QNX, a real-time OS for embedded systems.
Modules
Modern OS development is object-oriented, with a relatively small core kernel and a
set of modules which can be linked in dynamically. See for example the Solaris
structure, as shown in Figure 2.13 below.
Modules are similar to layers in that each subsystem has clearly defined tasks and
interfaces, but any module is free to contact any other module, eliminating the
problems of going through multiple intermediary layers, as well as the chicken-and-
egg problems.
The kernel is relatively small in this architecture, similar to microkernels, but the
kernel does not have to implement message passing since modules are free to
contact each other directly.