GCSE · Computer Science · Eduqas · Spec C500QS

OS interrupt management

Mid-sentence, your phone buzzes. You glance, reply, then carry on from the exact word you stopped at. A processor pulls the very same trick.

Computer Science · Operating systems

Follow the processor through an interrupt

An interrupt is a signal telling the processor that an event needs attention, and managing it is one of the operating system's jobs. Program A is running when one arrives. Call each step before you see it.

Step through with Next. When Next is held, make your call, then see what really happens.

Processor is runningSaved on the stackWaiting
Program A, instr 3emptynone

Step 1. Program A is part-way through its instructions and is on instruction 3. Nothing needs attention yet, so the stack is empty.

Step 1 of 6Called right: 0 of 4

Try all three runs: a single interrupt, a higher-priority interrupt cutting in, and a lower-priority one arriving.

Where interrupts come from

Hardware or software?

Sort each event by what generates the interrupt.

Still to sort

Hardware (0)

A device needs attention.

Where the line is: The signal comes from a device such as the keyboard, mouse or printer.

Software (0)

A running program has caused an error.

Where the line is: The signal comes from a program that is running, not from a device.

5 of 5 still to sort.

Same signal, two possible sources. Decide who raised it.

Watch out: Ask what raised the signal: a device, or a running program that has caused an error.

Why interrupts exist

Processor keeps checkingvsDevice sends an interrupt

Two ways of noticing that a device needs attention.

Focus

Who notices the event?

Processor keeps checking

The processor, by checking each device to see if it needs attention

Device sends an interrupt

The device, by signalling the processor when it needs attention

The insight

With interrupts the device does the shouting, so the processor does not have to keep asking.

How is the processor's time spent?

Processor keeps checking

Keeps checking, even when nothing has happened

Device sends an interrupt

Carries on with its current task until a signal arrives

How promptly is an event dealt with?

Processor keeps checking

Only when the next check gets round to that device

Device sends an interrupt

Promptly, as the event happens

Where did the program go?

What happens to the interrupted program?

Program A is running. An interrupt arrives, its routine runs, and the routine finishes.

Which idea is closest to what you think happens to Program A?
How sure are you?

Your turn

Write it out

Describe how the operating system and processor deal with an interrupt. Include what happens if a higher-priority interrupt arrives while the first one is being handled. [5 marks]

0 words · your answer stays on this page and is not sent anywhere.

WHAT YOU'VE LEARNED

A quick recap of today's lesson.

How the processor drops a task, deals with something urgent, then picks up exactly where it left off.

What you need to know

  • An interrupt is a signal sent to the processor to say an event needs attention.
  • Managing interrupts is one of the operating system's jobs: it arranges for them to be detected and dealt with.
  • Hardware (a key press, a printer out of paper) and software (a program dividing by zero) can both generate interrupts.
  • Have a goYour classmate Sam insists: "Interrupts only come from devices. A program can't send one." Using what you just read, how do you prove Sam wrong?

    A running program that causes an error, such as dividing by zero, generates an interrupt.

    Sam only counted devices. Software can generate interrupts as well as hardware.

  • When an interrupt arrives, the task the processor is carrying out is paused, not cancelled.
  • Before the interrupt is dealt with, the paused task's state is saved, typically on a stack in memory.
  • That state is the processor's register contents, including the address of the next instruction.
  • Have a goA program is paused by an interrupt. Name the one thing in its saved state that tells the processor where to carry on.

    The address of the next instruction.

    Saving it (with the registers) means the task resumes where it paused. Without it the processor would have nowhere to carry on from.

  • An interrupt service routine (interrupt handler) is the specific code that deals with that kind of interrupt.
  • Once the routine finishes, the saved state is restored and the task resumes exactly where it left off.
  • A higher-priority interrupt goes first, and can interrupt the handling of a lower-priority one; lower-priority interrupts wait.
  • Have a goInterrupt P is being handled when interrupt Q arrives, and Q has a lower priority than P. What does Q do?

    Q waits until P has been dealt with.

    Arriving later does not let Q cut in. Only a higher-priority interrupt can interrupt the handling of another.

  • Interrupts let the computer respond promptly, without the processor having to keep checking every device.

The big picture

An interrupt is a signal telling the processor that an event needs attention. The operating system pauses the current task, saves its state, runs the matching interrupt service routine, then restores the state so the task carries on exactly where it stopped. Priorities decide which interrupt goes first.

Key points

1An interrupt is a signal to the processor that an event needs attention, and the operating system arranges for it to be detected and dealt with.
2Hardware devices and running programs (software) can both generate interrupts.
3The current task is paused and its state (the registers, including the address of the next instruction) is saved, typically on a stack in memory.
4An interrupt service routine runs, then the saved state is restored and the task resumes exactly where it left off.
5A higher-priority interrupt is dealt with first and can interrupt a lower-priority one; lower-priority interrupts wait.

Worked example

Problem

Program Z is running. Interrupt MID arrives and its routine starts. While that routine is running, interrupt HIGH arrives, then interrupt LOW. HIGH has a higher priority than MID, and LOW has a lower priority than MID. In what order do the three routines finish, and how many saved states are on the stack while HIGH's routine is running?

⚠ Watch out

Assuming the interrupt that arrives first is always dealt with first. Priority decides: a later, higher-priority interrupt cuts in, and a later, lower-priority one waits.

🧠

Memory hook

Bookmark, don't bin: pause, save, run the routine, restore, resume.

✓

Check yourself

Cover the page. Say the five stages of dealing with an interrupt in order, then say what changes if a higher-priority interrupt turns up halfway through a routine.

Flashcards

(12)
What is an interrupt?
A signal sent to the processor to indicate that an event has occurred that needs attention.
Whose job is it to manage interrupts?
The operating system's: it arranges for interrupts to be detected and dealt with.
Give two examples of hardware generating an interrupt.
A key being pressed on a keyboard, and a printer running out of paper.
Give an example of software generating an interrupt.
A running program causing an error, such as an attempt to divide by zero.
What happens to the current task when an interrupt is received?
The task the processor is currently carrying out is paused.
What is saved before the interrupt is dealt with?
The state of the paused task: the processor's register contents, including the address of the next instruction.
Where is the paused task's state typically saved?
On a stack in memory.
What is an interrupt service routine?
The specific piece of code run to deal with that kind of interrupt (also called an interrupt handler).
What happens when the interrupt service routine finishes?
The saved state is restored and the paused task resumes from exactly where it left off.
A higher-priority interrupt arrives while a lower-priority one is being handled. What happens?
The higher-priority one is dealt with first; it can interrupt the handling of the lower-priority one.
What happens to a lower-priority interrupt that arrives during handling of a higher-priority one?
It waits.
Why use interrupts rather than the processor checking every device?
The computer can respond promptly to events as they happen, without the processor having to keep checking every device.

Tap any card to flip it, or use Study as deck to go through them one at a time. In the full lesson these run as a spaced-repetition deck — you rate each card Hard, Good or Easy and the tricky ones keep coming back until they stick.

Learning with Lightbulb is opening soon

You can use this lesson now. Join the waitlist and we'll let you know when the full Lightbulb experience is ready.

Keep me posted

More Eduqas GCSE Computer Science topics

See the full Eduqas Computer Science curriculum →

How this lesson was checked. This Eduqas GCSE Computer Science (specification C500QS)lesson was published through Lightbulb Learning's human-designed editorial process — the educational standards, accuracy rules and publication checks it must pass were authored and approved by Philip Halpin. It passed subject-specific assessment, automated educational checks and technical publication verification before going live (publication checks completed 16 November 2026). Published pages are monitored, human spot-checking is ongoing across the lesson library, and anything found wrong is corrected or withdrawn. How our lessons are made and checked. Spotted a mistake? Email hello@lightbulblearning.co and we'll review it.