Welcome to graduate2professional.blogspot.com

Monday, June 1, 2009

What is an Interrupt Service Routine?


  1. An Interrupt service routine (ISR), also known as an Interrupt handler.

  2. These handlers are initiated by either hardware interrupts or interrupt instructions in software, and are used for servicing hardware devices and transitions between protected modes of operation such as system calls.

For Example:Here is a scenario where the hardware does not support identifying the device that initiated the interrupt. In such cases, the possible interrupting devices need to be polled in software:

1.A device asserts the interrupt signal at a hardwired interrupt level.


2.The processor registers the interrupt and waits to finish the current instruction execution.

3.Once the current instruction execution is completed, the processor initiates the interrupt handling by saving the current register contents on the stack.

4.The processor then switches to supervisor mode and initiates an interrupt acknowledge cycle.

5.The interrupting device responds to the interrupt acknowledge cycle with the vector number for the interrupt.

6.Processor uses the vector number obtained above and fetches the vector.

7.The address found at the vector is the address of the interrupt service routine (ISR) for the interrupting device.


8.After the ISR routine has performed its job, the ISR executes the "return from interrupt" instruction.

9.Execution of the "return from interrupt" instruction results in restoring the processor state. The processor is restored back to user mode.

No comments:

Post a Comment