Interrupts in Operating System:


Definition and Explanation:

An interrupt is a hardware-generated change-of-flow within the system. An interrupt handler deals with the cause of the interrupt. The control is then returned to the interrupted context and instruction.

Functions of Interrupts:

Each computer architecture has its own interrupt mechanism but they all have several functions in common.


Below is a brief list of the common functions of interrupts:

When an interrupt occurs, the control is transferred to the interrupt service routine. The interrupt service routine is generally accessed through an interrupt vector. Interrupt vector knows where to find the appropriate interrupt service routine for the current interrupt.

The interrupt architecture must save the address of the instruction that has been interrupted (the program counter).

Incoming interrupts must be disabled if there is an interrupt currently being processed. This is to prevent interrupts from being lost or overwritten by newly arriving interrupts.

An interrupt is generally caused by a hardware device such as a device driver letting the CPU know that some data has been read from the device and is waiting in the local device buffer.

A trap is a software-generated interrupt that is either caused by an error or by a user request for an I/O operation.

An operating system is interrupt driven. This means that if there are no interrupts, then the system will be idle.

The operating system must preserve the state of the CPU by storing the contents of the registers and the program counter.

The operating system must determine which type of interrupt has occurred. This can be done either by polling or by using a vectored interrupt system. Polling is the systematic checking of each device to see if it was the device responsible for generating the interrupt. If the operating system has a vectored interrupt system, then the identity of the device and the type of interrupt will be easily identifiable without checking each device.

The operating system must provide a segment of code that specifies what action is to be taken in the event of an interrupt. There must be a code segment that is specific to each type of interrupt.
Classification of Interrupts:

Different classes of interrupts are as follows:

Supervisor Call Interrupts (SVC): These interrupts are initiated by a running process that executes SVC instruction. It is a user request for a particular system service such as performing I/O or obtaining more storage etc.


I/O Interrupts: These are initiated by I/O. hardware. These interrupts send signal to CPU to indicate that the status of a channel or device has changed. I/O interrupts occur when I/O operation completes, I/O error occurs or a device gets ready etc.


External Interrupts: These are caused by different events. These events can the" expiration of a quantum on interrupting clock, pressing of interrupt key or receipt of a signal from another processor in a multiprocessor system etc.


Restart Interrupts: These interrupts occur when the restart button of console is pressed or restart signal is received from another processor in multiprocessor system.


Program Check Interrupt: These are caused by different problems during the execution of machine language instructions. Some problems include division by zero, arithmetic overflow or underflow, wrong format of data etc.


Machine Check Interrupts: These are caused by the hardware that does not function, properly.

Leave a Reply

Subscribe to Posts | Subscribe to Comments

Blog Archive

Powered by Blogger.

- Copyright © 2013 Taqi Shah Blogspot -Metrominimalist- Powered by Blogger - Designed by Johanes Djogan -