3rd Lecture OS
3rd Lecture OS
3rd Lecture OS
CS(407)
Lecture 3
Instructor
Sibgha Zia
Department of Computer Science
UAF Sub Campus Burewala
06/10/2021
Interrupts (stop the continuous progress of activity)
“Interrupts are signals sent to the CPU by external devices, normally I/O devices.”
They tell the CPU to stop its current activities and execute the appropriate part of the
operating system.
“Interrupt is a hardware generated change of flow within the system”
vi. An OS is interrupt driven. This means that if there is no interrupt ,then the system
will be idle.
vii. The operating system must determine which type of interrupt has occurred. This can
be done by polling or by using vectored interrupt system.(direction)
Polling is a systematic checking of each device to see if it was the device responsible
for generating the interrupt. If the operating system has vectored interrupt system,
then the identity of the device and the type of interrupt will be easily identifiable
without checking each device.
An interrupt handler deal with the cause of the interrupts.
It is a kind of special block of code when interrupt occur control directly jumps to the
interrupt handler and execute that code which is placed in the handler.
Classes of Interrupts
Supervisor call interrupts SVC: interrupts are initiated by a running process that
executes SVA )
Restart interrupts: Are occur when the restart button of console is pressed
Machine check interrupts: are caused by the hardware that does not function
properly.
Kernel
The kernel provides the most basic interface between the computer itself and the rest of
operating system.
The kernel is responsible for the management of central processor.
The kernel includes the dispatcher to allocate the central processor, to determine
the cause of an interrupt and initiate its processing,
some provision for communication among the various system
user task currently active in system.
Structure of kernel based operating system
hardware
kernel
Operating system
Functions of kernel
Kernel is the core of Operating system.
The main function are:
i. Provides mechanism for creation and deletion of process.
ii. Provide CPU scheduling ,memory management and device management for these
processes.
iii. Provide synchronization tools so processes can synchronize their action.
iv. Provide a communication tool so process can communicate with each other.
2) Microkernel: Its a stripped-down version of Monolithic Kernel where the Kernel itself
can do most of the job done, and there is no need of an extra GUI. They should be used
where security and the crashing system isn’t or will not happen.
3) Hybrid Kernel: This Kernel is what we see most. Windows, Apple’s macOS. They are a
mix of Monolithic Kernel and Microkernel. It moves out drivers but keeps system
services inside the Kernel – similar to how drivers are loaded when Windows Starts the
bootup process.
4) Nano Kernel: If you need to have a kernel, but its majority of function is set up outside,
then this comes into the picture.
5) Exo Kernel: This kernel only offers process protection and resource handling. However
it is mostly used when you are testing out an in house project, and you upgrade to a
better Kernel type.
System Calls
Provide an interface between a user program and operating system. It is a
programmatic method in which a computer program requests a service from the
kernel of the OS.
System call offers the services of the operating system to the user programs via
API (Application Programming Interface).
Many system calls are written in Assembly language and are machine dependent.
Why do you need System Calls in OS?