m1_c2
m1_c2
Chapter 2
Design Goals
• The first problem in designing a system is to define goals and specifications.
• At the highest level, the design of the system will be affected by the choice
of hardware and the type of system: batch, time shared, single user, multi
user, distributed, real time, or general purpose.
• Beyond this highest design level, the requirements may be much harder to
specify.
• The requirements can, however, be divided into two basic groups
1. User goals (User requirements)
2. System goals (system requirements)
• User requirements are the features that user care about and understand
like system should be convenient to use, easy to learn, reliable, safe and
fast.
• System requirements are written for the developers, ie. People who design
the OS. Their requirements are like easy to design, implement and
maintain, flexible, reliable, error free and efficient.
Mechanisms and Policies
Simple Structure
• Many operating systems do not have well-defined structures.
• They started as small, simple, and limited systems and then grew beyond
their original scope. Eg: MS-DOS.
• In MS-DOS, the interfaces and levels of functionality are not well
separated. Application programs can access basic I/O routines to write
directly to the display and disk drives. Such freedom leaves MS-DOS in bad
state and the entire system can crash down when user programs fail.
• UNIX OS consists of two separable parts: the kernel and the system
programs. The kernel is further separated into a series of interfaces and
device drivers. The kernel provides the file system, CPU scheduling,
memory management, and other operating-system functions through
system calls.
Figure: MS-DOS layer structure.
Figure: traditional unix system structure
Layered Approach
• The OS is broken into number of layers (levels). Each layer rests on the
layer below it, and relies on the services provided by the next lower layer.
• Bottom layer (layer 0) is the hardware and the topmost layer is the user
interface.
• A typical layer, consists of data structure and routines that can be invoked by
higher-level layer.
• Advantage of layered approach is simplicity of construction and debugging.
∙ The layers are selected so that each uses functions and services of only
lower-level layers. So simplifies debugging and system verification. The
layers are debugged one by one from the lowest and if any layer doesn’t
work, then error is due to that layer only, as the lower layers are already
debugged. Thus, the design and implementation are simplified.
• A layer need not know how its lower-level layers are implemented. Thus
hides the operations from higher layers.
Figure: A layered Operating System
:
Disadvantages of layered approach:
• The various layers must be appropriately defined, as a layer can use
only lower-level layers.
• Less efficient than other types, because any interaction with layer 0
required from top layer.The system call should pass through all the
layers and finally to layer 0. This is an overhead.
Microkernels
• This method structures the operating system by removing all nonessential components
from the kernel and implementing them as system and user-level programs thus
making the kernel as small and efficient as possible.
• The removed services are implemented as system applications.
• Most microkernels provide basic process and memory management, and message
passing between other services.
• The main function of the microkernel is to provide a communication facility between
the client program and the various services that are also running in user space.
• 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 OS.
Disadvantage of Microkernel -
∙ Performance overhead of user space to kernel space communication
Modules
∙ The Max OSX architecture relies on the Mach microkernel for basic system management services, and the BSD kernel
for additional services. Application services and dynamically loadable modules (kernel extensions ) provide the rest of the
OS functionality. ∙ Resembles layered system, but a module can call any other module.
∙ Resembles microkernel, the primary module has only core functions and the knowledge of how to load and communicate
with other modules.
• Q) List and explain the different categories of
system program?
• Q) What are system calls? Briefly point out its
types.