Operating System Functions &
Components
Operating System Concepts
OS Components and Services
Basic components of the computer system
are,
CPU
Memory (RAM)
Secondary Memory (ROM)
Input/Output Module
System Interconnection
Some structure that provides communication among
CPU, RAM and other I/O Module
2
Some common registers
The main functionality of the CPU is that
to exchange data with memory.
For this purpose it typically make use of
some internal REGISTERS.
MAR (Memory Address Register)
MBR (Memory Buffer Register)
I/O AR (Input/output Address Register)
I/O BR (Input/output Buffer Register)
PC (Program Counter)
IR (Instruction Register)
3
Some common registers
MAR (Memory Address Register)
It specifies the address in memory for the next
read and write.
MBR (Memory Buffer Register)
It contains the data to be written into memory
or which receive the data read from memory.
I/O AR (Input/output Address Register)
It specifies a particular I/O Device
I/O BR (Input/Output Buffer Register)
It is used for the exchange of data between CPU
and other I/O Devices.
4
Processor registers
PC (Program Counter)
It contains the address of the instruction to
be fetched.
IR (Instruction Register)
It contains the instruction most recently
fetched.
Control and Status Registers
Used to control the operation of the CPU and
by privileged OS routines to control the
execution program.
5
Registers
Address Registers
These contains main memory addresses of data
and instruction.
Index register
This adding an index to a base value to get the effective
address
Segment pointer
Memory is divided into variable size block of words.
In this addressing, a register holds the address of the
base
of the segment.
6
Hardware Registers
Stack pointer
If there is user visible stack addressing then typically
stack is in main memory.
A dedicated register that points to the top of the
stack.
7
CPU Registers
General purpose registers
Ax (Accumulator)
Arithmetic operation
Data movement
Bx (Base Register)
Used for basic location of any data item
Also used for data movement
Cx (Control Register)
Control a loop structure
Dx (Data Register)
Data movement
Outputting the data
Manipulation purposes
8
Segment Pointers
Memory is divided into fixed segments,
Code segment
Used to store the code of a program
Data segment
Used to store all types of data which is related to a program
Stack segment
Stack manipulation
Extra segment
Used for data generated by the program while executing the
program.
9
Initial files execution process
In case of MS Windows and DOS, there
are three necessary files,
IO.sys
MSDOS.sys
COMMAND.com
When OS started, then First of all the file
IO.sys is loaded into the system area of the
RAM.
Upon execution all the I/O devices are
initialized (i.e. lights indication of I/O devices).
IO.sys remains in RAM until power is ON.
10
Initial files execution process
MSDOS.sys will then loaded into RAM system
area.
The function of this file is to initialize the functions of
storage devices.
COMMAND.com is then loaded in to the user
area of the RAM.
In case of MS DOS, Command prompt C:\> and in
case of window desktop environment will be
appeared.
11
IBM Compatible (RAM Structure)
First 1Mb of RAM is called conventional
memory or base memory.
In DOS memory management, conventional memory,
also called base memory, is the first 640 kilobytes (640
× 1024 bytes) of the memory on IBM PC or compatible
systems.
Out of 1Mb base memory, 640Kb for user and
384Kb for system area.
COMMAND.com is called the supervisor in case of
MS DOS or windows.
IO.sys and MSDOS.sys are loaded into system
area of the RAM.
12
IBM Compatible PC (RAM Structure)
Extended Memory
CONVENTIONAL Memory
IO.sys
384Kb
MSDOS.sys System Area
1 Mb
640Kb
COMMAND.com User Area
Extended Memory
DOS programs, running in real mode or virtual x86 mode, cannot directly access this memory, but are able to do
so through an API called the extended Memory Specification (XMS). This API is implemented by a driver (such
as HIMEM.SYS).
13
OS Functions/Services
The services provided by the OS to the
users are called services are function of OS.
I/O operations or I/O Handling
Program execution
Fault monitoring and error detection
Interrupt Handling
File or directory Management
Multi access environment
Resource allocation and management
Job priority management
Job to Job transition
Job translation management etc.
14
OS Functions/Services
I/O operations or I/O Handling
The operation in which we enter some data and
get some output from the computer.
User input the data in human understandable
format but OS translate it into machine readable
form, process it and then present back to user in
the same form as it was given to the computer.
15
OS Functions/Services
Fault Monitoring and error detection
The failure of any physical component of the
system, OS monitor or tell the faults.
Hardware errors includes,
Memory error
Device error
Software errors (arithmetic overflow, access
forbidden memory location) etc.
16
OS Functions/Services
Interrupt Handling
It is a signal which transfer control of CPU to a
fixed location, while at the same time storing the
previous values of the program counter.
When CPU is interrupted, it stops what it was
doing and immediately transfer to a fixed
location.
The fixed location normally contains the
starting address of the service routine.
17
OS Functions/Services
File or directory management
User data and program are stored in the form of
files.
Each file has a unique name and extension.
These files are organized in the form of
directory/folders.
This service enables the user to,
Create, modify, delete, rename, locate files etc.
Also backup and recovery mechanism.
Sharing of files
Access to files and data
Encryption and decryption of files etc.
18
OS Functions/Services
Multi access environment
Allowing several peoples to use the
computer simultaneously.
Efficient resource sharing
Transparency
Etc.
19
OS Functions/Services
Resource management
CPU management
Device management
Network Management
In multiple access environment, resources are
shared among all the active users on fair share
basis.
20
OS Functions/Services
Job priority system
Operating system determines and maintains order
in which jobs are executed in the system.
Scheduling at different levels are implemented in
the system by OS for getting maximum efficiency.
Priorities are defined through certain creteria.
21
OS Functions/Services
Job to job transition
Automatic transition from job to job is done
by operating system through special control
system
Job translation management
Operating system helps in translating the
user program using language translators
like,
Compilers
Interpreters
And other utility program for effective and smooth
operation.
22
Operating System Components
OS is not a single program, but it is an
integrated set of programs each of
which perform specific tasks,
OS is divided into different
modules/components
including,
Control programs
System service programs
Processing programs
These above groups has further
divisions
23
Operating System Components
Control programs
IPL (Initial Program Loader)
Supervisor
Job Controller
System service programs
IOCS (Input/Output control system)
Librarian
Linkage Editor
Processing Programs
Language Translators (compilers, assemblers,
Linkers, editors)
Utility programs
24
Operating System Components
Control Programs
Directs the operation of the computer system
Following tasks are done by these programs,
Managing resources
Job scheduling
Interrupts handling
Controlling data
Monitoring system status
IPL (Initial Program Loader)
The initial step of system start is carried by IPL.
The first program loaded and executed by the computer
It is a boot strap loader.
The main function of this program to check the existence of
OS.
25
Operating System Components
If OS is found the IPL loads rest of the OS by
executing bootstrap routines, located at boot sector
of the HDD.
In case of MS-DOS,
IO.sys
Boot Strap Routines)
(Boot sector routine
System disk CONFIG.sys
IPL
MSDOS.sys Autoexec.bat
Not System disk
COMMAND.com
C:\>
Batch File: Group of OS commands executed in sequence
26
OS Components
Supervisor
Heart of the OS
Load in RAM at the time of Bootup and resides
over there until system turned OFF.
All user programs are executed under supervisor.
The supervisor interrupts the commands supplied
by the user and call appropriate lower level
routine.
Actually supervisor supervises all the functions of
the computer.
Supervisor check the validity of the input
command and execute it appropriately.
27
OS Components
The main functions of the supervisor are,
Handle input/output operations
Memory allocation
Assignment of jobs to CPU
In case of MS-Windows/DOS, supervisor
module is commond.com
In case of Windows NT, supervisor module
is cmd.exe
In case of Unix, supervisor module is shell.exe
28
OS Components
Job Controller
Necessary for single user, multitasking system
and multi user system.
The main function of this program to keep the
record of each job running,
Concurrently
Parallely
Simultaneously
It assigns job to CPU according to certain criteria.
Suspension and resumption of jobs are done by
JC.
Allocation and de-allocation of memory to new
and completed process.
It is helping module of supervisor. 29
OS Components
System service programs
This group include modules that support
supervisor in performing different task like,
Input output management
Secondary storage management
The sub modules are as under,
Librarian
IOCS
Linkage Editor
30
OS Components
Librarian
Responsible for maintaining and managing
different functions required for the successful
access of secondary storage media.
This module performs,
File management
Disk management (space used and unused)
This module performs logical operations include,
Directory management, file management, allocation of
disk space, disk management functions, File system
management, file operations management (create,
update, delete, modify, rename etc)
Defragmentation process etc.
31
OS Components
IOCS (Input/output Control System)
Supervisor supporting program
It accesses different I/O devices attached with
the computer system
It is actually a universally device driver of OS.
This module performs physical operations
for different peripherals attached to the
computer.
The physical operations include,
Accessing of desired port
Checking the status of the port
Activation of the required buffer.
32
OS Components
Linkage Editor
Large libraries containing compiles code for
common operations normally I/O operations.
It process the machine language code produced
by assembler and create the final executable
module.
A linker does this by adding necessary subroutines
from system libraries.
In other words linker defines object codes into
completely executable form which is ready to
be loaded into RAM and executed by the
CPU.
33
OS Components
Processing Programs
These are not integrated part of OS but they
perform functions which helps the programmer in
the preparation and execution of system and
application software.
There are two types of processing programs
Linkage translator
Assembler
Compiler
Interpreter
Utility programs
34
Operating System Kernel
A kernel is a central component of an
operating system.
It acts as an interface between the user
applications and the hardware.
The sole aim of the kernel is to manage the
communication between the software (user level
applications) and the hardware (CPU, disk
memory etc).
The main tasks of the kernel are :
Process management
Device management
Memory management
Interrupt handling, I/O communication and File system.
35
OS Kernel
Types of kernels
May be classified mainly in two categories
Monolithic (Mono single, Lithic layer)
Micro Kernel.
Monolithic
Older approach
Basic system services like process and memory
management, interrupt handling etc were packed
into a single module in kernel space.
Some serious problems like,
Size was huge, Poor maintainability (bug fixing and
addition of new features resulted in recompilation of the
whole kernel code which could consume hours.
E.g. MS-DOS
36
OS Kernel
Modern Kernel approach (Modular Approach)
Kernel consists of different modules which can
be dynamically loaded and un-loaded.
Easy extension of OS’s capabilities.
Maintainability became so easy as only the
concerned module needs to be loaded and
unloaded every time if there is change or bug fix in
a particular module.
LINUX follows the Monolithic Modular Approach.
37
MicroKernels
This solve the problem of ever growing size of
kernel code which we could not control in
monolithic approach.
This architecture allows some basic services like,
Device driver management
Protocol stack
File system etc. to run in user space.
It reduces the kernel size and increases the security and
stability of OS.
E.g. if network service crashes due to the buffer overflow,
then only the networking services memory would be
corrupted, leaving the rest of the system still functional.
38
Microkernel
The important features include,
Managing memory protection
Process scheduling
Inter process communication (IPC)
Set of methods for the exchange of data among multiple
threads in one or more processes.
QNX follows the microkernel approach.
QNX is a commercial Unix-like real-time operating system
(RTOS), aimed primarily at the embedded systems market,
i.e. BlackBerry
39