O Level Computer Science 2210 · Area 1 · Computer systems

System software, application software and interrupts

This page sorts software into system software, which keeps the computer running, and application software, which does what the user wants. It then covers what an operating system actually does, the firmware layer underneath it, and how an interrupt stops the processor in its tracks and gets it back again. Marks are lost when students list operating system functions without saying what each one does, and when they describe an interrupt being dealt with but never say that the original program carries on.

Not started

Syllabus coverage

  • Describe the difference between system software and application software, and provide examples of each
  • Describe the role and basic functions of an operating system, including managing files, handling interrupts, providing an interface, managing peripherals and drivers, managing memory, managing multitasking, providing a platform for running applications, providing system security and managing user accounts
  • Understand how hardware, firmware and an operating system are required in order to run applications software
  • Describe the role and operation of interrupts, including how an interrupt is generated, how it is handled using an interrupt service routine, and what happens as a result
  • Understand that hardware interrupts include pressing a key on the keyboard and moving the mouse, and that software interrupts include division by zero and two processes trying to access the same memory location

Part of the O Level Computer Science syllabus 2210.

Software layers, and how an interrupt worksAn interrupt makes the processor stop what it is doing, deal with a signal, then resume.application softwareword processor, browser, gameoperating systemmemory, files, peripherals, usersfirmwarethe instructions built into the hardwarehardwareprocessor, memory, deviceseach layer needs the one beneath itAn interruptprocessorrunning a programinterruptservice routinehandles it, then returnsThe processor stops, saves its place,runs the routine, then carries on.
Hardware, firmware and the operating system drawn as three stacked layers beneath application software, each layer labelled with its role, and an interrupt signal arrow rising from a device input into the processor while the operating system handles it with an interrupt service routine.

System software and application software

Software is everything the computer runs, as opposed to everything it is made of, and the syllabus divides it by asking who the software is for. System software provides the services that the computer requires: it manages the hardware and keeps the machine working. Application software provides the services that the user requires: it does the job the person at the keyboard actually wants done.

The group that is easy to forget is utility software. A utility is a small program that carries out one housekeeping job, such as backing up files, compressing files, checking a disk for faults, or scanning for malware. Utilities are system software, not application software, because they keep the computer healthy rather than doing a task the user wants done for its own sake.

The two kinds of software run at the same time. When you type into a word processor, the word processor is application software and the operating system underneath it is system software, deciding how much processor time and memory the word processor is allowed. Application software cannot run on its own: without system software nothing would load it, there would be no memory to load it into, and there would be no way to save the file it produces.

Type of softwareWhat it is forExamples
System software: operating systemProvides the services the computer requires, managing hardware, memory, files, peripherals and usersWindows, macOS, Linux, Android, iOS
System software: utility softwareSmall maintenance programs that keep the computer working, secure and tidyBackup software, file compression, disk checking, anti-malware
Application softwareProvides the services the user requires, doing the task the user wants doneWord processor, spreadsheet, web browser, photo editor, video game
Use the test: if the software is there to keep the computer working, it is system software; if it is there to do something the user wants, it is application software.

The role of the operating system

The operating system (OS) is the system software that sits between the user, the application software and the hardware. Its role is to manage the resources of the computer and to provide the services that everything else needs. It is the first major piece of software to load when the machine is switched on, and it stays in charge until the machine is switched off.

Everything the operating system does follows from that role. The processor, memory, storage, screen and attached devices are limited resources, and several programs want them at the same time. The operating system decides who gets what, for how long, and in what order, so that no single program can take the machine over and so that programs do not collide with each other.

The syllabus names nine basic functions. They are usually taught as a list, but each one needs a sentence: a question that asks you to describe functions will not accept the names alone.

FunctionWhat it means in practice
Managing memoryKeeps track of which parts of RAM are free, allocates memory to a program when it starts and frees it when the program closes
Managing multitaskingShares processor time between several programs so that they appear to run at the same time
Providing an interfaceGives the user a way to control the computer, either a graphical user interface or a command-line interface
Managing filesOrganises files into folders and handles creating, naming, saving, copying, moving and deleting them
Managing peripherals and driversControls the attached devices and uses the correct driver to translate instructions into signals each device understands
Providing a platform for running applicationsGives application software the services it needs, such as memory and file access, so it does not need to know the details of the hardware
Providing system securityUses passwords and permissions to control what programs and users are allowed to do
Managing user accountsKeeps a separate account with its own settings and access rights for each user, and handles logging in and out
Handling interruptsResponds immediately when a device or a program signals that it needs attention
Name the function and then say what it does. 'Managing memory' on its own is half an answer; 'the operating system allocates RAM to each program and frees it when the program closes' is the mark.

Memory, multitasking and drivers in more detail

Managing memory means the operating system keeps a record of which areas of RAM are in use and which are free. When a program starts it is given the memory it asks for; while it runs it must stay inside that allocation; when it closes the memory is released so that another program can use it. If a program tries to write outside its own area, the operating system stops it, which is what makes one crashing program survivable for the rest of the machine.

Managing multitasking means the operating system gives each running program a share of processor time and switches between them so quickly that each one appears to run continuously. The same function explains why a computer with one processor can play music while a document is being typed.

Managing peripherals and drivers means controlling the devices attached to the machine. Each device needs a driver, the small piece of software that translates a general instruction such as 'print this page' into the signals that particular printer understands. The operating system chooses the right driver, sends the data to it, and handles the device's signals back.

Providing an interface means giving the user a way to work with the machine: a graphical user interface with windows, icons and menus, or a command-line interface where commands are typed. Providing system security means controlling what programs and users may do, using passwords, permissions and access rights. Managing user accounts means keeping a separate account for each user with its own settings and files, and handling logging in and out.

  • Memory: track what is free, allocate it on start, free it on exit, stop a program writing outside its own area.
  • Multitasking: share processor time so several programs appear to run at once.
  • Drivers: translate general instructions into the signals a particular device understands.
  • Platform: supply memory, file access and device access so applications do not deal with the hardware directly.

Hardware, firmware and the operating system

A computer runs in layers, and you need to know what sits on what. Hardware is the physical equipment: the processor, memory, storage and devices. Firmware is software stored permanently in the hardware itself, usually in ROM, so that it is available the instant the machine is switched on and is not lost when the power goes off. Application software is the program the user is trying to run.

The layers build upwards. The bootloader is firmware: it runs on the hardware, and its job is to find and start the operating system. The operating system then runs on the firmware, using the basic instructions the firmware provides to communicate with the hardware. Application software runs on the operating system, using the services the operating system provides.

The chain is hardware, then firmware, then operating system, then application software, and each layer depends on the one below it. This is why a program cannot run by itself. Application software needs an operating system to load it, give it memory and give it access to files and devices; the operating system needs firmware to start it and to handle the lowest-level details of the hardware; and the firmware needs the hardware to exist at all. Break any layer and everything above it stops working.

  • The bootloader is firmware, and firmware runs on the hardware.
  • The operating system runs on the firmware.
  • Application software runs on the operating system.
  • Each layer depends on the layer below it, so a broken layer stops everything above it.
Learn the chain as a sentence: the bootloader (firmware) runs on the hardware, the operating system runs on the firmware, and applications run on the operating system.

Why applications need all three layers

A word processor does not contain instructions for reading a disk sector or lighting a pixel. It asks the operating system to open a file or draw a window, and the operating system does the rest. That is what 'providing a platform' means: the application is written against the operating system's services, not against the hardware.

The operating system in turn does not contain instructions for the particular disk controller or memory chips in the machine. Those details are handled by firmware, which knows the hardware it was written for and provides a standard way for the operating system to use it. Firmware is stored in ROM so that it is present immediately at switch-on, before anything has been read from disk.

So an application needs all three: the hardware to run on, the firmware to start and control that hardware, and the operating system to load the application and give it memory, files and devices. Remove any one and the application has nothing to stand on.

If a question asks why an application cannot run without an operating system, the answer is that the operating system loads it, allocates its memory and provides its access to files, devices and the interface.

What an interrupt is and why it is needed

An interrupt is a signal sent to the processor telling it to stop what it is doing and deal with something else straight away. Interrupts exist because the processor cannot know in advance when a key will be pressed or when a printer will run out of paper, and it cannot sit waiting for these events either, because that would waste almost all of its time. Instead the processor gets on with its work, and the outside world interrupts it when there is something to say.

The alternative would be polling: checking every device over and over to see whether it needs attention. Polling wastes processor time on devices that have nothing to report, and it still reacts more slowly than an interrupt, because the device has to wait until its turn to be checked. An interrupt lets the device announce itself the moment it needs something.

An interrupt is a signal to the processor that something needs attention now. It is not an error and it does not necessarily stop the program for good.

How an interrupt is generated and handled

An interrupt is generated by a device or by a program. The device or program sends a signal to the processor, and the processor checks for such signals at the end of each instruction, so it notices almost immediately.

When an interrupt arrives, the processor finishes the instruction it is currently executing, then saves the contents of its registers and the address of the next instruction, so that it can come back later. It looks up the address of the interrupt service routine (ISR) for that interrupt and jumps to it. The ISR is a short program written to deal with that particular interrupt: it reads the key that was pressed, handles the division by zero, or services the printer.

When the ISR has finished, the processor restores the saved registers and the address of the next instruction, and carries on from exactly where it left off, as though nothing had happened. That return is the part students leave out, and it is usually the last mark in the question.

Interrupts also have priorities, because two can arrive at once. A high-priority interrupt, such as a hardware failure warning, is dealt with before a low-priority one such as a key press. If a higher-priority interrupt arrives while a lower-priority ISR is running, the processor can interrupt the ISR, deal with the more urgent signal, and then return to finish the ISR. Interrupts waiting to be handled are held in a queue.

  • An interrupt is generated by a hardware device or by a running program.
  • The processor finishes the current instruction and saves its registers and the address of the next instruction.
  • It jumps to the interrupt service routine for that interrupt and runs it.
  • It restores the saved values and returns to the instruction it was about to execute.
  • Interrupts have priorities, and waiting interrupts are held in a queue.

Hardware and software interrupts

A hardware interrupt comes from a device. Pressing a key on the keyboard, moving the mouse, a printer signalling that it has finished a job, or a disk drive signalling that a read is complete are all hardware interrupts. The signal comes from outside the program that is running.

A software interrupt comes from a program while it is running. Division by zero is the standard example: the processor cannot produce a result, so an interrupt is raised and the operating system deals with it, usually by stopping the program and reporting the error. Two processes trying to access the same memory location is the other example; the operating system has to step in before one program corrupts another's data.

As a result of an interrupt something happens that would not have happened otherwise: a character appears on the screen, an error is reported to the user instead of the program failing silently, the next item of data is read from disk, or the processor starts another task. The point of interrupts is that the processor can respond immediately to an event without continuously checking every device to see whether it needs attention.

Hardware interruptSoftware interrupt
SourceA device outside the processorA program that is running
ExamplesPressing a key, moving the mouse, a printer finishing a job, a disk read completingDivision by zero, two processes trying to access the same memory location
Why it is raisedThe device needs the processor's attentionThe program has done something the processor cannot continue with
Typical resultThe device is serviced and the program carries onThe program is stopped and an error is reported to the user
Do not say interrupts are only for errors. A key press is an interrupt, and it is entirely normal.

Key terms you must be able to define

System software
Software that provides the services the computer requires, including the operating system and utility software.
Application software
Software that provides the services the user requires, such as a word processor, a spreadsheet or a web browser.
Utility software
Small system programs that maintain, protect or configure the computer, for example backup, file compression, disk checking and anti-malware software.
Operating system
The system software that manages the resources of the computer and provides the services that application software needs, including memory, files, peripherals, multitasking, security, user accounts, the interface and interrupts.
Firmware
Software stored permanently in the hardware, usually in ROM, so that it is available as soon as the computer is switched on.
Bootloader
The firmware that runs on the hardware when the computer is switched on and finds and starts the operating system.
Driver
The small piece of software that translates general instructions from the operating system into the signals a particular peripheral device understands.
Interrupt
A signal sent to the processor telling it to stop what it is doing and deal with something else immediately.
Interrupt service routine (ISR)
The short program run when a particular interrupt occurs, written to deal with that interrupt; the processor returns to the interrupted instruction once it has finished.
Hardware interrupt
An interrupt generated by a device, for example pressing a key on the keyboard or moving the mouse.
Software interrupt
An interrupt generated by a program while it is running, for example division by zero or two processes trying to access the same memory location.
Polling
Checking each device repeatedly to see whether it needs attention, instead of letting the device raise an interrupt.

In context

2210 sets its questions inside systems a student already uses - a school network, a phone, a supermarket till, a vending machine, a website. These show how the theory is applied to a context you have not seen before, then you answer for the system you are given.

On a school laptop

The operating system is system software and the web browser the student opens is application software, but both are needed at once: the browser cannot request a page without the operating system giving it memory and access to the network. The utility software on the laptop matters just as much, because it is what backs up the coursework folder and checks the disk for faults.

While you type

Every key you press generates a hardware interrupt. The processor finishes the instruction it is on, saves its registers and the address of the next instruction, jumps to the interrupt service routine for the keyboard, puts the character into the program's input, and then returns to exactly where it was. Without interrupts the processor would have to check the keyboard thousands of times a second and would have almost no time left for the word processor.

When a program divides by zero

A student's program asks the user for a number and divides by it, and the user enters zero. The processor cannot carry out the division, so a software interrupt is raised. The operating system's routine for that interrupt stops the program and displays an error message rather than letting the machine carry on with a meaningless result.

Switching the computer on

The moment the power comes on, the processor runs the bootloader from firmware in ROM, because nothing has been read from storage yet. The bootloader checks the hardware and loads the operating system. Only when the operating system is running can the student double-click an application, because the application needs the operating system to load it and to give it memory.

In a small business office

The office runs an operating system with a separate user account for each member of staff, so that the accounts files can be opened only by the people allowed to see them. Files are organised into folders by year, utilities back up the accounts every evening, and the printer works because the correct driver is installed for it.

Printing a long document

The printer is slow, but the word processor does not wait for it. The operating system sends the pages to the printer and returns the processor to the user. When the printer needs the next page it raises a hardware interrupt, the ISR sends more data, and the user carries on typing in between.

Flashcards

Click a card to flip it. Mark honestly — the tracker uses this.

Q1What is the difference between system software and application software?
System software provides the services that the computer requires, including the operating system and utility software. Application software provides the services that the user requires.
Q2Give two examples of utility software.
Any two of: backup software, file compression software, disk checking software, anti-malware software. Utilities are system software because they maintain or protect the computer.
Q3Name four functions of an operating system.
Any four of: managing memory, managing multitasking, providing an interface, managing files, managing peripherals and drivers, providing a platform for running applications, providing system security, managing user accounts, handling interrupts.
Q4What does the operating system do when it manages memory?
It keeps track of which parts of RAM are free, allocates memory to each program that needs it, frees it when the program closes, and stops a program writing outside its own area.
Q5What is firmware, and what runs on it?
Firmware is software stored permanently in the hardware, usually in ROM. The operating system runs on the firmware, and the bootloader is itself firmware that runs on the hardware.
Q6Put the layers in order: application software, hardware, operating system, firmware.
Hardware, then firmware, then operating system, then application software. Each layer depends on the one below it.
Q7What is an interrupt?
A signal sent to the processor telling it to stop what it is doing and deal with something else immediately.
Q8Give one example of a hardware interrupt and one of a software interrupt.
Hardware: pressing a key on the keyboard, or moving the mouse. Software: a program dividing by zero, or two processes trying to access the same memory location.
Q9What happens to the program the processor was running when an interrupt occurs?
The registers and the address of the next instruction are saved, the interrupt service routine runs, and then the saved values are restored so the program continues from the point of interruption.
Q10What is an interrupt service routine?
A short program written to deal with one particular interrupt, for example reading the key that was pressed or handling a division by zero. The processor jumps to it when the interrupt occurs.
Q11Why are interrupts better than polling?
Polling checks every device repeatedly and wastes processor time on devices that have nothing to report. An interrupt lets a device signal the processor only when it needs attention, so the response is immediate and no time is wasted.
Q12What is the role of an operating system?
To manage the resources of the computer and provide the services that application software and the user need, sitting between the user, the applications and the hardware.
0 of 12 marked as known

Exam-style questions

6 questions, 21 marks. Write your answer and press Mark my answer — it is marked against the scheme and tells you which points you made and what would gain the next mark. You can still reveal the scheme and mark it yourself instead.

IdentifyAO13 marks
A student uses a computer at home. Identify the type of software for each of the following: (a) the software that manages the memory and the peripherals, (b) the spreadsheet the student uses for homework, (c) the software that backs up her files every night.

Mark scheme — tick each point you actually made

Examiner tip: Decide each one by asking who the software is for. Software that keeps the computer running is system software, and software that does a job for the user is application software. Backup software is a utility, so it is system software even though the user starts it.
StateAO11 mark
State one function of an operating system other than handling interrupts.

Mark scheme — tick each point you actually made

Examiner tip: One function, clearly named. If you can add what it does in a few words you will be safe on the one-mark question and ready for the describe version of it.
DescribeAO14 marks
Describe the role and operation of an interrupt. Your answer should include how an interrupt is generated, how it is handled, and what happens as a result.

Mark scheme — tick each point you actually made

Examiner tip: Write the answer as a sequence. The mark for the return is the one most often lost, because students describe the interrupt being dealt with but never say that the original program carries on.
ExplainAO14 marks
Explain how hardware, firmware and an operating system are all required in order for a user to run application software on a computer.

Mark scheme — tick each point you actually made

Examiner tip: Answer upwards through the layers. Each mark is for one link in the chain: firmware on hardware, operating system on firmware, applications on the operating system, and what breaks if a layer is missing.
DescribeAO24 marks
A supermarket checkout operator scans an item and the barcode reader sends the code to the computer. Describe how the operating system deals with this, and explain why an interrupt is used rather than the computer checking the reader continuously.

Mark scheme — tick each point you actually made

Examiner tip: Apply the general sequence to the barcode reader rather than repeating it without a context. The last mark needs the word polling, or a clear description of continuous checking and the time it wastes.
ExplainAO25 marks
A programmer's computer slows down badly when several applications are open at once. Explain how three functions of the operating system are involved, and suggest one function that would help the programmer manage the machine.

Mark scheme — tick each point you actually made

Examiner tip: Name each function, then apply it to the slow machine. 'Managing memory' alone is not a mark; 'the operating system must share RAM between more applications, so each gets less' is.

Exam technique for this topic

  • Learn the nine operating system functions as a list, and be ready to say what each one does. The question almost always asks you to describe functions rather than just name them, and a list of names alone earns nothing.
  • For an interrupt question, write the sequence in order: the interrupt is generated, the processor finishes the current instruction, the registers and the address of the next instruction are saved, the interrupt service routine is run, and the processor returns to where it left off. Missing the return costs the last mark.
  • Give one hardware example and one software example when asked for types of interrupt, and label which is which. A key press and division by zero are the two the examiner expects, but any valid pair will do as long as the labels are right.
  • When a question asks for examples of software, say which type each example is. 'A word processor is application software' scores; 'a word processor' on its own does not answer the question that was asked.
  • Keep the levels of the machine apart in your answers: applications run on the operating system, the operating system runs on the firmware, and the firmware, including the bootloader, runs on the hardware.

Why students lose marks here

A student wroteA student wrote: 'System software is the operating system and application software is everything else.'
Why it loses marksThis misses utility software, which is system software even though it is not the operating system. Backup programs, file compression tools, disk checkers and anti-malware are all utilities, and they provide services the computer requires rather than services the user wants.
The answer that scoresSystem software provides the services that the computer requires, and it includes both the operating system and utility software. Application software provides the services that the user requires. A backup program is system software because it maintains the computer, while the word processor it is protecting is application software.
A student wroteA student wrote: 'When an interrupt happens the program stops and has to be started again from the beginning.'
Why it loses marksThe processor does not lose the program it was running. It finishes the current instruction, saves the contents of its registers and the address of the next instruction, runs the interrupt service routine, and then restores everything it saved so the interrupted program carries on as though nothing had happened.
The answer that scoresThe processor finishes the instruction it is executing and saves the contents of its registers and the address of the next instruction. It then looks up the address of the interrupt service routine for that interrupt and jumps to it. When the ISR has finished, the saved registers and the address of the next instruction are restored, and the processor continues from exactly the point at which it was interrupted.
A student wroteA student wrote: 'The operating system manages memory by deleting files when RAM is full.'
Why it loses marksDeleting files is a storage decision, not memory management, and the operating system does not delete a user's files to make room. Managing memory means tracking which areas of RAM are free, allocating them to programs, freeing them when a program closes, and stopping a program writing outside its own area.
The answer that scoresManaging memory means keeping track of which parts of RAM are in use and which are free, allocating memory to a program when it starts, freeing that memory when the program closes, and preventing a program from writing outside the area it has been given. If RAM runs short, the operating system can move pages to virtual memory rather than delete the user's files.
A student wroteA student wrote: 'Firmware is another name for the operating system, because both are software.'
Why it loses marksThey are different layers. Firmware is stored permanently in the hardware, usually in ROM, and is present at switch-on; the operating system is loaded afterwards, from storage, by the bootloader, which is itself firmware.
The answer that scoresFirmware is software stored permanently in the hardware, usually in ROM, so it is available immediately when the machine is switched on. The bootloader is firmware and it starts the operating system, which runs on top of the firmware. Application software then runs on the operating system.
A student wroteA student wrote: 'An interrupt is generated when a program crashes, and the only result is an error message.'
Why it loses marksA crash may raise a software interrupt, but most interrupts come from ordinary devices doing ordinary things, such as a key press, a mouse movement or a printer asking for more data. The result of an interrupt is that the device is serviced and the interrupted program then carries on.
The answer that scoresAn interrupt can be generated by a hardware device, such as a key press or a mouse movement, or by software, such as division by zero or two processes accessing the same memory location. The processor saves its registers and the address of the next instruction, runs the interrupt service routine, and then returns to what it was doing. An error message is only one possible outcome.

Where this fits in O Level Computer Science 2210

This page is one topic of Cambridge O Level Computer Science 2210. O Level Computer Science 2210 is the course home: every area and every topic in Cambridge's own order, the papers you sit and what each one tests, and the exam-practice tools. The full topic list, with each topic linked to its revision page, is on the O Level Computer Science 2210 syllabus page.