Interruption Flashcards
What is an Interrupt Request? (IRQ)
An Interrupt Request is a signal sent to a processor to momentarily stop its operations. The CPU stops what it’s currently doing and does something else of a higher priority. The fetch-decode-execute cycle is always going on; an IRQ request interrupts it.
Why are IRQs important?
When you have multiple devices connected to a computer, these devices need time to run their own operations and process data. When a device sends an IRQ, the processor stops and gives it time to run its operation.
What are IRQ channels?
IRQs are sent along a unique data line called a ‘channel.’ When an IRQ is referenced, it is done so alongside the channel number. Each device has its own channel number (IRQ number). E.g. Mouse is IRQ 12, printer is IRQ 4.
What do IRQ numbers do?
Devices require a unique IRQ to provide inputs to the processor or start a particular action. The number facilitates appropriate CPU response by assigning priorities to devices. The lower the IRQ number (e.g. 0), the more important the need for the input/action.
What generates IRQ requests?
Hardware, such as devices (e.g. printer) and software (e.g. an application requests something from the OS)
Describe the IRQ process.
Interrupts are added to an area called the Interrupt Service Routine. This holds instructions that will need to be fetched and executed to complete the interrupt’s commands. The contents of registers within the CPU cannot be lost so are copied into a reserved area of RAM called the Stack. These contents are added to the top of the stack, saving them for later. The interrupt will then be executed instead of the original instructions.
What is a Stack in the context of IRQ?
A stack is a last-in, first-out data structure where, in the case of an interrupt, the flags and program counter (PC) of the interrupted process/operation are temporarily stored while the IRQ’s operation takes place. After the interrupt is complete, the stack “pops” the recently stored flags and PC and the CPU continues where it left off.