Cards (9)

  • What are interrupts
    • An interrupt is a signal to the processor that stops its current task and performs a different task temporarily 
    • Interrupts can be hardware events or time-sensitive tasks 
    • When an interrupt occurs, the processor suspends the current program execution and transfers control to an interrupt service routine 
  • Purpose and Role of Interrupts 
    • Real-time Event Handling: hardware errors and signals from input devices e.g. hard disk failure 
    • Device Communication: alerts from external devices e.g. printer jams and network errors 
    • Multitasking: suspending processing in one application so that the user can switch to another
  • Interrupts types Image
  • The Interrupt Process #1
    1. Interrupt Request (IRQ
    • An external device or software generates an interrupt, signalling the processor to stop its current task 
    • The interrupt controller passes this to the interrupt handler for assessment 
    2. Interrupt Acknowledge
    • The interrupt handler decides if the interrupt needs to be dealt with now or later 
    • If yes, the current contents of the processor registers are saved in memory 
  • The Interrupt process #2

    3. Interrupt Service Routine (ISR) Lookup 
    • The processor fetches the corresponding Interrupt Service Routine (ISR) associated with the interrupt type 
    4. ISR Execution 
    • The processor transfers control to the ISR and executes the routine to handle the specific interrupt 
    5. Interrupt Exit
    • After the ISR completes, the processor restores the content of the registers from step 2 
    • The fetch-decode-execute cycle is resumed
  • Interrupt process Image
  • What is an ISR
    • An ISR is a special function that handles a particular interrupt type 
    • Each type of interrupt has a corresponding routine, e.g. printer jam, hard disk failure, file download error, network connection error all have routines to be followed when they happen 
    • ISRs should be concise, efficient, and carefully designed to minimise the time taken to execute, as they often need to handle time-sensitive events 
  • Interrupt priority and nesting 
    • Interrupt prioritisation means the processor can acknowledge and switch to resolving a higher-priority interrupt 
    • Prioritising interrupts is vital because many things can go wrong at the same time 
    • Lower-priority ISRs may be temporarily suspended until the higher-priority ISR completes the execution 
    • Nesting of interrupts refers to the ability of the processor to handle interrupts within interrupts 
    • Proper management of nested interrupts avoids potential conflicts and ensures system stability 
  • Interrupt priority handling Image