.. _struct:
Operating-System Structure
========================================================
Simple Structure
^^^^^^^^^^^^^^^^^^
.. figure:: dos_struct.png
:align: center
In MS-DOS, applications may bypass the operating system.
* Operating systems such as MS-DOS and the original UNIX did not have
well-defined structures.
* There was no :ref:`mode` (user and kernel), and so errors in applications
could cause the whole system to crash.
.. index:: monolithic kernel
.. _monolithic:
Monolithic Approach
^^^^^^^^^^^^^^^^^^^^
* Functionality of the OS is invoked with simple function calls within the
kernel, which is one large program.
* Device drivers are loaded into the running kernel and become part of the
kernel.
.. figure:: unix-mono-kernel.jpg
:align: center
A monolithic kernel, such as Linux and other Unix systems.
Layered Approach
^^^^^^^^^^^^^^^^^^
This approach breaks up the operating system into different layers.
* This allows implementers to change the inner workings, and
increases modularity.
* As long as the external interface of the routines don't change,
developers have more freedom to change the inner workings of the
routines.
* With the layered approach, the bottom layer is the hardware, while the
highest layer is the user interface.
* The main *advantage* is simplicity of construction and debugging.
* The main *difficulty* is defining the various layers.
* The main *disadvantage* is that the OS tends to be less efficient than
other implementations.
.. figure:: NTkernel.jpg
:align: center
The Microsoft Windows NT Operating System. The lowest level is a monolithic
kernel, but many OS components are at a higher level, but still part of the
OS.
.. index:: microkernel
.. _microkernel:
Microkernels
^^^^^^^^^^^^^^^^^^
This structures the operating system by removing all nonessential portions of
the kernel and implementing them as system and user level programs.
* Generally they provide minimal process and memory management, and a
communications facility.
* Communication between components of the OS is provided by message
passing.
The *benefits* of the microkernel are as follows:
* Extending the operating system becomes much easier.
* Any changes to the kernel tend to be fewer, since the kernel is smaller.
* The microkernel also provides more security and reliability.
Main *disadvantage* is poor performance due to increased system overhead
from message passing.
.. figure:: microkernel.jpg
:align: center
A Microkernel architecture.
.. note::
* `Andrew Tanenbaum's `_ `Minix
`_ is an example of a microkernel system. Minix
was developed primarily to facilitate teaching graduate level operating
system classes. Tanenbaum has authored several text books and is with `VA
University `_ in Amsterdam.
* Another well known microkernel system is **Mach**, which was
developed at Carnegie Mellon University in the mid-1980's. Mach was used
as the low-level part of Apple OS X.