Saturday, 4 July 2015

Operating System : How Operating System Work ?



Role of Interrupts
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.
1.Hardware Interupts are generated by hardware devices to signal that they need some attention from the OS.
2.Software Interupts are generated by programs when they want to request a system call to be performed by the operating system.
3.Traps are generated by the CPU itself to indicate that some error or condition occured for which assistance from the operating system is needed.

CPU Execution Mode
There are two modes of execution,known as user mode and kernel or supervisor mode.
User mode is restricted in thatcertain instructions cannot be executed, certain registers cannot be accessed, and I/O devices can not be accessed.
Kernel mode has none of these restrictions. A system call will set the CPU to kernel mode, as will traps and interrupts. Application programs cannot do this.

Supervisor mode
»Can execute all machine instructions
»Can reference all memory locations

User mode
»Can only execute a subset of instructions
»Can only reference a subset of memory locations

CPU Response to Interrupts
The CPU performs the following actions in response to an interrupt:
Using the pointer to the current process control block, the state and all register values for the process are saved for use when the process is later restarted.
The CPU mode bit is switched to supervisory mode.
Using the pointer to the interrupt handler table and the interrupt vector, the location of the kernel code to execute is determined. The interrupt vector is the IRQ for hardware interrupts 


 




 






•Reference :
•Stallings, William, Operating Systems, Second Edition, Prentice-Hall International Editions, Englewood Cliffs, New Jersey, 1995.
•Tanenbaum, Andrew S., Modern Operating Systems, Prentice-Hall International Editions,
Englewood Cliffs, New Jersey, 1992.
 

Thank You




Share this

0 Comment to "Operating System : How Operating System Work ?"

Post a Comment