As
modern operating systems are large and complex careful engineering is required.
There are four different structures that have shown in this document in order
to get some idea of the spectrum of possibilities. These are by no mean s
exhaustive, but they give an idea of some designs that have been tried in
practice.
Ref:
Modern Operating Systems by Andrew s. Tanenbaum published in 1992.,
pp..18
Monolithic Systems :
This
approach well known as “The Big Mess”. The structure is that there is no
structure. The operating system is written as a collection of procedures, each
of which can call any of the other ones whenever it needs to. When this
technique is used, each procedure in the system has a well-defined interface in
terms of parameters and results, and each one is free to call any other one, if
the latter provides some useful computation that the former needs.
For constructing the actual object program of
the operating system when this approach is used, one compiles all the
individual procedures, or files containing the procedures, and then binds them
all together into a single object file with the linker. In terms of information
hiding, there is essentially none- every procedure is visible to every other
one i.e. opposed to a structure containing modules or packages, in which much
of the information is local to module, and only officially designated entry
points can be called from outside the module.
However,
even in Monolithic systems, it is possible to have at least a little structure.
The sevices like system calls provide by the operating system are requested by
putting the parameters in well-defined places, such as in registers or on the
stack, and then executing a special trap instruction known as a kernel call or
supervisor call.
Ref: Modern Operating Systems by Andrew s.
Tanenbaum published in 1992., pp..19
Layered System :
A generalization of the approach as
shown below in the figure for organizing the operating system as a hierarchy of
layers, each one constructed upon the one below it.
The
system had 6 layers. Layer 0 dealt with allocation of the processor, switching
between processes when interrupts occurred or timers expired. Above layer 0,
the system consisted of sequential processes, each of which could be programmed
without having to worry about the fact that multiple processes were running on
a single processor. In other words, layer 0 provided the basic multiprogramming
of the CPU.
Layer
1 did the memory management. It allocated space for processes in main memory
and on a 512k word drum used for holding parts of processes (pages)for which
there was no room in main memory. Above layer 1, processes did not have to
worry about whether they were in memory or on the drum; the layer 1 software
took care of making sure pages were brought into memory whenever they were
needed.
Layer
2 handled communication between each process and the operator console. Above this
layer each process effectively had its own operator console. Layer 3 took care
of managing the I/O devices and buffering the information streams to and from
them. Above layer 3 each process could deal with abstract I/O devices with nice
properties, instead of real devices with many peculiarities. Layer 4 was where
the user programs were found. They did not have to worry about process, memory,
console, or I/O management. The system operator process was located I layer 5.
Ref: Modern Operating Systems by Andrew s.
Tanenbaum published in 1992., pp..20 & 21
Virtual Machines:
The heart of the system, known as the virtual machine
monitor, runs on the bare hardware and does the multiprogramming, providing not
one, but several virtual machines to the next layer up. However, unlike all
other operating systems, these virtual machines are not extended machines, with
files and other nice features. Instead, they are exact copies of the bare
hardware, including kernel/user mod, I/O, interrupts, and everything else the
real machine has.
For
reason of Each virtual machine is identical to the true hardware, each one can
run any operating system that will run directly on the hard ware. Different
virtual machines can, and usually do, run different operating systems. Some run
one of the descendants of OF/360 for batch processing, while other ones run a
single-user, interactive system called CMS (conversational Monitor System) fro
timesharing users.
Client-server Model:
A trend in modern operating systems
is to take this idea of moving code up into higher layers even further, and
remove as much as possible from the operating system, leaving a minimal kernel.
The usual approach is to implement most of the operating system functions in
user processes. To request a service, such as reading a block of a file, a user
process ( presently known as the client process) sends the request to a server
process, which then does the work and sends back the answer.
In
client-Server Model, all the kernel does is handle the communication between
clients and servers. By splitting the operating system up into parts, each of
which only handles one fact of the system, such as file service, process
service,
Terminal
service, or memory service, each part becomes small and manageable;
furthermore, because all the servers run as user-mode processes, and not in
kernel mode, they do not have direct access to the hardware. As a consequence,
if a bug in the file server is triggered, the file service may crash, but this
will not usually bring the whole machine down.
Another
advantage of the client-server model is its adaptability to use in distributed
system. If a client communicates with a server by sending it messages, the
client need not know whether the message
is handled locally in its own machine, or whether it was sent across a network
to a server on a remote machine. As far as the client is concerned, the same
thing happens in both cases: a request was sent and a reply came back.
Ref: Modern Operating Systems by Andrew s.
Tanenbaum published in 1992., pp..23