Wednesday, July 10, 2013

What are the types of interrupt? Explain.



The types of interrupt are:
·         External Interrupt: External interrupts are caused by some sources like I/O devices, hardware circuits, timing devices and any other hardware component. When an I/O device request for a service it generate an external interrupt. It is caused by some external event. These external interrupts are asynchronous, i.e. the interrupt might not occur at the same time, whenever the program is re-run.
·         Internal Interrupts: Internal interrupts are caused by erroneous or illegal use of instruction. They are also called as TRAPS. When an instruction leads an operation to divide a number by 0, an internal interrupt of attempt to divide by zero is generated. It is also caused by stack overflow, register overflow, invalid operation code etc. These interrupts are caused by some internal invent and are synchronous. The internal interrupt occur at the same place whenever the program is re-run.
·         Software Interrupts: Software interrupt is initiated by executing an instruction. It is a special call instruction that behaves like an interrupt rather than a subroutine call. The most common use of software interrupt is associated with a supervisor (or kernel) call instruction. This instruction provides a medium for the user program to switch from user mode to kernel mode by generating a software interrupt. Whenever a software interrupt is generated it changes the mode of the program and the control cannot be transferred to the arbitrary address. Computers often generate the software interrupt to communicate with the disk controller to request data be read or write from or to disk.

No comments:

Post a Comment