← IGCSE Computer Science Paper 1

OS function: handling interrupts

The OS receives each interrupt, picks the right ISR to run, manages priorities, then passes control back to the interrupted program so it can carry on.

Understanding OS function: handling interrupts in IGCSE Computer Science Paper 1

What it does: The pseudocode compares priorities, which is how the OS decides which interrupt to deal with first. The OS runs the ISR, then restores the saved state and resumes the interrupted program. The OS is the software in control. It receives each interrupt and picks the right interrupt service routine (ISR) to run. The OS manages interrupt priorities. A high priority interrupt, such as a power failure, is handled before a low priority one. Each type of interrupt has its own ISR. The OS selects the one that matches the source of the interrupt. Interrupt handling is an OS function. Like managing peripherals and multitasking, it is done by system software.

Common mistakes: After the ISR finishes, the OS must pass control back to the interrupted program so it can carry on. It should not delete it. The line should be: OS resumes the paused program. The OS only selects an ISR when an interrupt has been received. The condition should be: IF interrupt received THEN.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 409–418) and word search (Modules 390–418).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
Which statement about interrupts is correct?
The operating system receives the interrupt and decides which ISR should deal with itThe interrupted application program decides which ISR should deal with it
Matches
After the ISR ends, the OS restarts the interrupted program from the very beginning.
↓
The OS does not restart the program. It restores the saved state and resumes the program from the point where it was interrupted.
Applying
Meanings
Term
OS interrupt handling
Meaning
The OS receives each interrupt, picks the right ISR to run, manages priorities, then passes control back to the interrupted program so it can carry on.
Practice
IF interrupt received THEN
Testing
Gaps
IF interruptFlag = THEN
Check Answer
Spots
3OS runs the ISR
4OS deletes the paused program

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Manta Ray' badge — Graceful Coder, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. Which statement about interrupts is correct?
A. The interrupted application program decides which ISR should deal with it
B. The operating system receives the interrupt and decides which ISR should deal with it ✓
The OS is the software in control. It receives each interrupt and picks the right interrupt service routine (ISR) to run.
2. A printer runs out of paper while a student is typing in a word processor. What does the OS do after the ISR finishes?
A. It closes the word processor and restarts the computer
B. It passes control back to the word processor so it can carry on ✓
Once the ISR has finished, the OS resumes the interrupted program from where it stopped. The program is not closed.
3. Two interrupts arrive at the same time: a key press and a power failure warning. Which does the OS handle first?
A. The one with the higher priority, which is the power failure warning ✓
B. The one that arrived first in the alphabet, which is the key press
The OS manages interrupt priorities. A high priority interrupt, such as a power failure, is handled before a low priority one.
4. Which describes how the OS picks an ISR?
A. It chooses the ISR that matches the type of interrupt, such as a keyboard or a divide by zero error ✓
B. It always runs the same ISR, whatever the interrupt is
Each type of interrupt has its own ISR. The OS selects the one that matches the source of the interrupt.
5. Which statement is correct?
A. Handling interrupts is one of the functions of an operating system ✓
B. Handling interrupts is only done by application software
Interrupt handling is an OS function. Like managing peripherals and multitasking, it is done by system software.

Match the Pairs

OS interrupt handling → The OS receives each interrupt, picks the right ISR to run, manages priorities, then passes control back to the interrupted program so it can carry on.
OS selects ISR → When an interrupt arrives, the operating system chooses the correct interrupt service routine to deal with that particular interrupt, such as the keyboard ISR for a key press.
The OS manages priorities: if a higher priority interrupt arrives, it is handled before a lower priority one. → IF newInterrupt.priority > current.priority THEN run newInterrupt.ISR
After the ISR has finished, the OS passes control back to the interrupted program so it carries on from where it stopped. → CALL ISR RESTORE state RESUME program
After the ISR ends, the OS restarts the interrupted program from the very beginning. → The OS does not restart the program. It restores the saved state and resumes the program from the point where it was interrupted.
The keyboard sends an interrupt and the application program picks the ISR to run. → The application does not choose the ISR. The operating system receives the interrupt and selects the correct ISR.

Key Term

OS interrupt handling
The OS receives each interrupt, picks the right ISR to run, manages priorities, then passes control back to the interrupted program so it can carry on.

Fill in the Blanks

1. IF interruptFlag = TRUE THEN CALL OSHandler ENDIF
Hint: Type the Boolean value that shows an interrupt has arrived so the OS must act.
2. IF source = "keyboard" THEN CALL keyboardISR ENDIF
Hint: Type the keyword that makes the OS run the ISR it has chosen.
3. IF newPriority > currentPriority THEN CALL higherISR ENDIF
Hint: Type the comparison operator that checks whether the new interrupt is more important than the current task.
4. CALL keyboardISR RETURN TO interruptedProgram
Hint: Type the keyword that hands control back to the program that was interrupted.
5. REPEAT CALL nextISR UNTIL queueEmpty
Hint: Type the keyword that ends a REPEAT loop once its condition becomes true.

Spot the Error

Question 1
A Interrupt arrives at the OS
B OS finds the matching ISR
C OS runs the ISR
D OS deletes the paused program
Line D — After the ISR finishes, the OS must pass control back to the interrupted program so it can carry on. It should not delete it. The line should be: OS resumes the paused program.
Question 2
A WHILE program running
B IF no interrupt THEN
C OS selects the ISR
D ENDIF
E ENDWHILE
Line B — The OS only selects an ISR when an interrupt has been received. The condition should be: IF interrupt received THEN.
Question 3
A Keyboard priority = LOW
B Power failure priority = HIGH
C OS runs the LOW one first
D Then OS runs the LOW one
Line C — The OS manages priorities, so the higher priority interrupt (power failure) is handled first. The line should be: OS runs the HIGH one first.
Question 4
A INPUT interrupt_type
B IF interrupt_type = KEYBOARD
C OS runs printer ISR
D ENDIF
Line C — The OS must choose the ISR that matches the interrupt. A keyboard interrupt needs the keyboard ISR, not the printer ISR.
Question 5
A Printer jams
B Printer sends interrupt to app
C OS runs the printer ISR
D OS shows an error message
Line B — Interrupts are received by the operating system, not by an application. The line should be: Printer sends interrupt to OS.

Student with a class code? Join your class →