Introduction To Operating System
Introduction To Operating System
System
Introduction, Components, Services, Types of OS
&
Architecture of OS
Introduction to Operating System
• Operating system − a program that acts as an intermediary between a
user of a computer and the computer hardware.
• An operating system is software that manages a computer’s
hardware.
• Soft real-time
Limited utility in industrial control of robotics
Useful in applications (multimedia, virtual reality) requiring
advanced operating-system features.
Operating System Structure
• For efficient performance and implementation an OS should be
partitioned into separate subsystems, each with carefully defined tasks,
inputs, outputs, and performance characteristics.
• You may use a similar approach when you structure your programs:
rather than placing all of your code in the main() function, you instead
separate logic into a number of functions, clearly articulate parameters
and return values, and then call those functions from main().
• These subsystems can then be arranged in various architectural
configurations:
Monolithic Systems
Layered Systems
Microkernels
Client-server Systems
Virtual Machines
Operating System Structure: Monolithic Systems
• An OS is a complex software that has a large number of functionalities
and may contain millions of instructions.
• It is designed to consist of a set of software modules, where each
module has a well-defined interface that must be used to access any
of its functions or data.
• The simplest structure for organizing an operating system is no
structure at all.
• That is, place all of the functionality of the kernel into a single, static
binary file that runs in a single address space.
Operating System Structure: Monolithic Systems
• Early operating systems had a monolithic structure, whereby the OS
formed a single software layer between the user and the bare
machine.
• The user interface was provided by a command interpreter. The
command interpreter organized creation of user processes.
Operating System Structure: Monolithic Systems
• Both the command interpreter and user processes invoked OS
functionalities and services through system calls.
• Two kinds of problems with the monolithic structure were realized
over a period of time. The sole OS layer had an interface with the bare
machine. Hence architecture-dependent code was spread throughout
the OS, and so there was poor portability.
• It also made testing and debugging difficult, leading to high costs of
maintenance and enhancement.
Operating System Structure: Monolithic Systems
• These problems led to the search for alternative ways to structure an
OS.
• Solutions to these problems: Layered structure, Kernel-based
structure and Microkernel-based OS structure.
Operating System Structure: Layered Systems
• The monolithic approach is often known as a tightly coupled system
because changes to one part of the system can have wide-ranging
effects on other parts.
• Alternatively, we could design a loosely coupled system. Such a
system is divided into separate, smaller components that have specific
and limited functionality.
• All these components together comprise the kernel.
• The advantage of this modular approach is that changes in one
component affect only that component, and no others, allowing
system implementers more freedom in creating and changing the
inner workings of the system.
Operating System Structure: Layered Systems
• The monolithic OS structure suffered from the problem that all OS
components had to be able to work with the bare machine.
• This feature increased the cost and effort in developing an OS because
of the large semantic gap between the operating system and the bare
machine.
• Semantic Gap: The mismatch between the nature of operations
needed in the application and the nature of operations provided in
the machine.
Operating System Structure: Layered Systems
• The extended machine provides operations like context save,
dispatching, swapping, and I/O initiation.
• The operating system layer is located on top of the extended machine
layer. This arrangement considerably simplifies the coding and testing
of OS modules by separating the algorithm of a function from the
implementation of its primitive operations.
Operating System Structure: Layered Systems
• It is now easier to test, debug, and modify an OS module than in a
monolithic OS.
• We say that the lower layer provides an abstraction that is the
extended machine. We call the operating system layer the top layer of
the OS.
Operating System Structure: Layered Systems
• The layered approach to OS design suffers from two main problems:
1) The operation of a system may be slowed down by the layered
structure. Recall that each layer can interact only with adjoining
layers. It implies that a request for OS service made by a user
process must move down from the highest numbered layer to the
lowest numbered layer before the required action is performed by
the bare machine. This feature leads to high overhead.
2) The second problem concerns difficulties in developing a layered
design. Since a layer can access only the immediately lower layer, all
features and facilities needed by it must be available in lower layers.
This requirement poses a problem in the ordering of layers that
require each other’s services.
Operating System Structure: Kernel-based
• The kernel is the core of the OS.
• It provides a set of functions and services to support various OS
functionalities. The rest of the OS is organized as a set of non-kernel
routines, which implement operations on processes and resources
that are of interest to users, and a user interface.
• We all know the operation of the kernel is interrupt-
driven.
• The kernel gets control when an interrupt such as a
timer interrupt or an I/O completion interrupt notifies
occurrence of an event to it, or when the software-
interrupt instruction is executed to make a system call.
• When the interrupt occurs, an interrupt servicing
routine performs the context save function and invokes
an appropriate event handler, which is a nonkernel
routine of the OS.
Operating System Structure: Kernel-based
Functions and Services Offered by the Kernel