Interrupts Flashcards
What is an interrupt?
Signals generated by a software or hardware to notify the processor a process requires attention
How does an interrupt work?
obtains processor time via generating a signal or message as an indicator to processor they need to be serviced. it stops the processor and causes a break in the execution of the current routine
each interrupt has a priortiy and OS takes them into account when allocating processor time
theyre stored within abstract data structures called priortiy queues or an interrupt register
an interrupt can only interrupt lower priortiy taks to avoid any delays or loss of data to ensure most urgent tasks are performed first
When does an interrupt start?
When the current FDE cycle has finished to ensure the most efficienct use of the processor
Give an example of an interrupt
printer signalling completion of a job print or perpripheral signalling power failure
What is a ISR? and explain process of how interrupts are executed
Interrupt Service Routine
checks interrupt register at end of each FDE cycle
it compares priority levels of the interrupt and current task and if it is lower or equal priority to current task, then task continues
if it is higher priority the contents of special purpose registers in CPU is temporarily transferred into a stack stored in memory
location of appropriate ISR is loaded by loading relevant value into PC
flag is set to signal ISR has begun
once interrupt is serviced flag is reset. interrupt queue is checked for further interrupts of higher priority to process originally executed and if there is the process is repeated
if not, previous contents are popped from the stack and loaded back in the registers to resume processing