Thursday, 13 June 2013

Interrupts

Virtually all computers provide a mechanism by which other modules (I/O, memory) may interrupt the normal processing of the processor.

Classes of Interrupts:
  1. Program: Generated by some condition that occurs as a result of an instruction execution, such as arithmetic overflow, division by zero, attempt to execute an illegal machine instruction and reference outside a user’s allowed memory space.
  2. Timer: Generated by a timer within in the processor. This allows the operating system to perform certain functions on a regular basis.
  3. I/O: Generated by an I/O controller, to signal normal completion of an operation or to signal a variety of error condition.
  4. Hardware failure: Generated by a failure , such as power failure or memory parity error.
Interrupts are provided primarily as a way to improve processing efficiency. With interrupts, the processor can be engaged in executing other instructions while an I/O operation is in progress. From this point of the user program, an interrupts is that; an interruption of the normal sequence of execution. When the interrupt processing is completed, execution resumes. Thus, the user program does not have to contain any special code to accommodate interrupts, the processor and the operating system are responsible for suspending the user program and then resuming it at same point.