SLIDE 1
Interrupts
Eric McCreath
2
Interrupts
"Interrupt - An event that alters (or interrupts) the normal fetch-decode-execute cycle of execution in the system." Glossary of Computer Organization and Architecture Ed. 2, Null and Lobur. When an interrupt occurs the currently executing program is suspended and the program counter jumps to the interrupt handler (normally at a fixed location in memory). Once the interrupt handler completes the suspended program is restarted. The interrupt handler must return the CPUin exactly the same way it finds it. Hence the interrupted program is 'unaware' that the interrupt has every taken place.
3
Interrupts
Interrupts can be caused by: hardware events that electrically signal the CPU.(e.g. a key pressed, DMA transfer completing, network packet received, timer going off, a signal from another CPU), these are asynchronous events. software initiated events including: events that are used to capture problems in the execution of instructions (divide by zero, executing privileged instructions, reading/writing memory that out of the address range of the program executing)
- r events to call operating system functions (provides a
secure way of moving from an unprivileged to privileged mode). The CPU generally handles interrupts all in the same way (this is independent to how they are caused).
4
Interrupt Handler
The interrupt handler routine is a function for handling the interrupt event. When an interrupt occurs a table, at a known location in memory, is used to determine which interrupt handler to start executing. The interrupt handler routine must be written very carefully such that the state of the CPU is returned exactly how it was
- found. This will involve storing and restoring the register values