Structure of
Operating Systems
UNIT 2
#Sushanth KJ|Faculty.ECE|BIT,
M'lore
Introduction
Operation of an OS
Structure of an Operating System
Operating Systems with Monolithic
Structure
#Sushanth KJ|Faculty.ECE|BIT,
M'lore
Operation of an OS
When a computer is switched on, boot procedure
analyzes its configurationCPU type, memory size, I/O
devices, and details of other hardware
Loads part of OS in memory, initializes data structures,
and hands it control of computer system
During operation of the computer, interrupts
caused by:
An event: I/O completion; end of a time slice
System call made by a process (software interrupt)
Interrupt servicing routine:
Performs context save
Activates event handler
Scheduler selects a process for servicing
#Sushanth KJ|Faculty.ECE|BIT,
M'lore
Operation of an OS
(continued)
#Sushanth KJ|Faculty.ECE|BIT,
M'lore
Operation of an OS
(continued)
#Sushanth KJ|Faculty.ECE|BIT,
M'lore
Structure of an Operating
System
1)
2)
Policies and Mechanisms
Portability and Extensibility of Operating
Systems
#Sushanth KJ|Faculty.ECE|BIT,
M'lore
1)Policies and Mechanisms
In determining how OS will perform a
function, designer needs to think at two
distinct levels:
Policy: Principle under which OS performs function
Decides what should be done
Mechanism: Action needed to implement a policy
Determines how to do it and actually does it
Example:
Round-robin scheduling is a policy
Mechanisms: maintain queue of ready processes
and dispatch a process
#Sushanth KJ|Faculty.ECE|BIT,
M'lore
2)Portability and Extensibility of
Operating Systems
Portability: ease with which a software
program can be ported
Porting an OS: changing parts of its code
that are architecture-dependent to work
with new HW
Examples: architecture-dependent data and
instructions in an OS
#Sushanth KJ|Faculty.ECE|BIT,
M'lore
Portability and Extensibility of
Operating Systems (continued)
Extensibility: ease with which new
functionalities can be added to a software
system
Extensibility of an OS is needed for two purposes:
Incorporating new HW in a computer system
Typically new I/O devices or network adapters
Providing new features for new user expectations
Early OSs did not provide either kind of
extensibility
Modern OSs facilitate addition of a device driver
They also provide a plug-and-play capability
#Sushanth KJ|Faculty.ECE|BIT,
M'lore
Operating Systems with
Monolithic Structure
Early OSs had a monolithic structure
OS formed a single software layer between the
user and the bare machine (hardware)
#Sushanth KJ|Faculty.ECE|BIT,
M'lore
10
Operating Systems with
Monolithic Structure (continued)
Problems with the monolithic structure:
Sole OS layer had an interface with bare machine
Architecture-dependent code spread throughout OS
Poor portability
Made testing and debugging difficult
High costs of maintenance and enhancement
Alternative ways to structure an OS:
1. Layered structure
2. Kernel-based structure
3. Microkernel-based OS structure
#Sushanth KJ|Faculty.ECE|BIT,
M'lore
11
1)Layered Design of Operating
Systems
Semantic gap is reduced by:
Using a more capable machine
Simulating an extended machine in a lower layer
#Sushanth KJ|Faculty.ECE|BIT,
M'lore
12
1)Layered Design of Operating
Systems (continued)
Routines of one layer must use only the
facilities of the layer directly below it
Through its interfaces only
#Sushanth KJ|Faculty.ECE|BIT,
M'lore
13
Example: Structure of the THE
Multiprogramming System
#Sushanth KJ|Faculty.ECE|BIT,
M'lore
14
1)Layered Design of Operating
Systems (continued)
Problems:
System operation slowed down by layered
structure
Difficulties in developing a layered design
Problem: ordering of layers that require each others
services
Often solved by splitting a layer into two and putting
other layers between the two halves
Stratification of OS functionalities
Complex design
Loss of execution efficiency
Poor extensibility
#Sushanth KJ|Faculty.ECE|BIT,
M'lore
15
Virtual Machine Operating
Systems
Different classes of users need different kinds
of user service
Virtual machine operating system (VM OS)
creates several virtual machines
A virtual machine (VM) is a virtual resource
Each VM is allocated to one user, who can use any OS
Guest OSs run on each VM
VM OS runs in the real machine
schedules between guest OSs
Distinction between privileged and user modes
of CPU causes some difficulties in use of a VM
OS
#Sushanth KJ|Faculty.ECE|BIT,
M'lore
16
Example: Structure of
VM/370
#Sushanth KJ|Faculty.ECE|BIT,
M'lore
17
Virtual Machine Operating
Systems (continued)
VMs are also used without a VM OS:
Virtual Machine Monitor (VMM)
Also called a hypervisor
E.g., VMware and XEN
#Sushanth KJ|Faculty.ECE|BIT,
M'lore
18
2)Kernel-Based Operating
Systems
Historical motivations for kernel-based OS
structure were OS portability and convenience
in design and coding of nonkernel routines
Mechanisms implemented in kernel, policies outside
Kernel-based OSs have poor extensibility
#Sushanth KJ|Faculty.ECE|BIT,
M'lore
19
2)Kernel-Based Operating
Systems (continued)
#Sushanth KJ|Faculty.ECE|BIT,
M'lore
20
Evolution of Kernel-Based
Structure of Operating Systems
Dynamically loadable kernel modules
Kernel designed as set of modules
Modules interact through interfaces
Base kernel loaded when system is booted
Other modules loaded when needed
Conserves memory
Used to implement device drivers and new system
calls
User-level device drivers
Ease of development, debugging, deployment and
robustness
Performance is ensured through HW and SW means
#Sushanth KJ|Faculty.ECE|BIT,
M'lore
21
3)Microkernel-Based Operating
Systems
The microkernel was developed in the early
1990s to overcome the problems
concerning portability, extensibility, and
reliability of kernels
A microkernel is an essential core of OS
code
Contains only a subset of the mechanisms
typically included in a kernel
Supports only a small number of system calls,
which are heavily tested and used
Less essential code exists outside the kernel
#Sushanth KJ|Faculty.ECE|BIT,
M'lore
22
3)Microkernel-Based Operating
Systems (continued)
Microkernel does not include scheduler and memory
handler
They execute as servers
#Sushanth KJ|Faculty.ECE|BIT,
M'lore
23
3)Microkernel-Based Operating
Systems (continued)
OSs using first-generation microkernels
suffered up to 50% degradation in
throughput
L4 microkernel is second-generation
Made IPC more efficient by eliminating validity/rights
checking by default, and by tuning microkernel to
HW
Only 5% degradation
Exokernel merely provides efficient multiplexing
of hardware resources
Distributed resource management
Extremely fast
#Sushanth KJ|Faculty.ECE|BIT,
M'lore
24