The Operating System and Interrupts: Quick Revision
A brief note on the nine functions of an operating system, hardware and software interrupts, and how an interrupt service routine is used. With the usual slips and questions to check yourself.
A brief note on The Operating System and Interrupts. Read it before a test. Try each question at the end before you open its answer.
The functions of an operating system
Managing files: where each file is stored; open, save, copy, move, delete; folders.
Handling interrupts: each interrupt is dealt with by its routine.
Providing an interface: a graphical user interface or a command line.
Managing peripherals and drivers: each device is worked through its device driver.
Managing memory: which part of RAM each program uses; programs kept apart; memory freed.
Managing multitasking: programs take very short turns on the processor.
Providing a platform for running applications: applications use its services.
Providing system security: passwords, access rights, updates.
Managing user accounts: each user has a login, files and settings.
Interrupts
An interrupt is a signal to the processor that something needs attention now.
Hardware interrupts come from devices: pressing a key on the keyboard, moving the mouse.
Software interrupts come from programs: division by zero, two processes trying to access the same memory location.
Handling an interrupt
The processor checks for interrupts at the end of each fetch-decode-execute cycle.
If the interrupt has a higher priority than the task, the state of the task (the register contents) is saved.
The interrupt service routine (ISR) for that interrupt is run.
The state is restored and the task carries on from where it stopped.
The highest priority interrupt is serviced first. The result depends on the routine: a key is stored, the pointer moves, or an error message is shown and a program is stopped.
The usual slips
A key press is a hardware interrupt, even though a program then uses the key.
Saving the state comes before the routine, and restoring comes after it.
The task carries on from where it stopped. It does not start again.
Check yourself
Name the function of the operating system that works a new printer.
Is a division by zero a hardware or a software interrupt?
What does the processor restore after an interrupt service routine has finished?
Sources
Cambridge IGCSE Computer Science 0478 syllabus for 2026, 2027 and 2028, section 4.1.