Vectored Interupt Mechanisim | |||||||||||||
Once an interrupt has occurred, what does the CPU do with it? For each interrupt the CPU must run some code specified by the OS. In order to do this the CPU has a vector of memory addresses for each interrupt.
The CPU looks into the vector, which is stored somewhere in memory. It will then jump to the address stored in that vector. In the above case we have two interrupts, a hardware failure and a I/O.
The OS will store code at these memory addresses to handle the interrupt. The hardware failure may result in a dialog box being popped up for the user to inform them of the failure. Once the CPU has finished it will pop the stack and restart execution from the previous program counter position. |