1.1 MS-DOS System Structure
ü MS-DOS – written
to provide the most functionality in the least space.
divided into modules.
MS-DOS has some structure, its interfaces and levels of functionality are not
Ø UNIX – limited
by hardware functionality, the original UNIX operating system had limited
structuring. The UNIX OS consists of two separable parts.
programs – use kernel supported system calls
to provide useful functions such as compilation and file manipulation.
kernel - Consists of everything below the system-call interface and
above the physical hardware
the file system, CPU scheduling, memory management, and other operating-system
functions; a large number of functions for one level.
1.3 Layered Approach
operating system is divided into a number of layers (levels), each built on top
of lower layers. The bottom layer (layer 0), is the hardware; the highest
(layer N) is the user interface.
ü An OS
layer is an implementation of an abstract object that is the encapsulation of
data and operations that can manipulate those data. These operations (routines)
can be invoked by higher-level layers. The layer itself can invoke operations
on lower-level layers.
approach provides modularity. With modularity, layers are selected such that
each layer uses functions (operations) and services of only lower-level layers.
layer is implemented by using only those operations that are provided lower
ü The major
difficulty is appropriate definition of various layers.
1.4 Microkernel System Structure
ü Moves as
much from the kernel into “user” space.
takes place between user modules using message passing.
Ø Easier to
extend a microkernel
Ø Easier to
port the operating system to new architectures
reliable (less code is running in kernel mode)
ü If there
are no processes to execute, no I/O devices to service, and no users to whom to
respond, an operating system will sit quietly, waiting for something to happen.
Events are almost always signaled by the occurrence of an interrupt or a trap.
ü A trap
(or an exception) is a software-generated interrupt caused either by an error
(for example, division by zero or invalid memory access) or by a specific
request from a user program that an operating-system service be performed. The
interrupt-driven nature of an operating system defines that system’s general
ü Without protection against these sorts of errors, either the computer
must execute only one process at a time or all output must be suspect. A
properly designed operating system must ensure that an incorrect (or malicious)
program cannot cause other programs to execute incorrectly.
Dual-Mode and Multimode Operation
ü In order
to ensure the proper execution of the operating system, we must be able to distinguish between the execution of operating-system code and
user defined code. The approach taken by most computer systems is to provide
hardware support that allows us to differentiate among various modes of
ü At the
very least, we need two separate modes of operation: user mode and kernel
mode (also called supervisor mode, system mode, or privileged mode).
ü A bit,
called the mode bit, is added to the hardware of the computer to indicate the
current mode: kernel (0) or user (1). With the mode bit, we can distinguish
between a task that is executed on behalf of the operating system and one that
is executed on behalf of the user.
ü We cannot
allow a user program to get stuck in an infinite loop or to fail to call system
services and never return control to the operating system.
accomplish this goal, we can use a timer. A timer can be set to interrupt the
computer after a specified period. The period may be fixed (for example, 1/60
second) or variable (for example, from 1 millisecond to 1 second).
variable timer is generally implemented by a fixed-rate clock and a counter.
ü The operating system sets the counter. Every time the clock ticks, the counter is decremented. When the counter reaches 0, an interrupt occurs. For instance, a 10-bit counter with a 1-millisecond clock allows interrupts at intervals from 1 millisecond to 1,024 milliseconds, in steps of 1 millisecond.