Interrupts
Author |
Message |
cyberguy
|
Posted: Sun Nov 22, 2009 9:21 pm Post subject: Interrupts |
|
|
Can someone explain how does the interrupt mechanism works in steps? and secondly explain interrupt handling with respect to device management? |
|
|
|
|
|
Sponsor Sponsor
|
|
|
DemonWasp
|
Posted: Mon Nov 23, 2009 1:54 am Post subject: RE:Interrupts |
|
|
When a hardware interrupt occurs, the CPU's PC register (program counter) is sent to an address specified by the hardware. The Operating System's Kernel has an event handler that lives at that address and determines what to do with the event. Usually, this involves sleeping the existing process and doing something new (this happens on clock interrupts, for example). The OS may also choose to resume the thread in progress, in which case the interrupt handler simply returns.
Devices can communicate with the CPU either by interrupt or by polling (usually defined by their interface). A device controlled by polling waits until the CPU requests information from it, then provides that information or executes an order. A device which uses interrupts will "prompt" the CPU for more orders or information when it's ready, using interrupts.
For more detail, see Wikipedia or a university-level CS class on operating systems. |
|
|
|
|
|
|
|