Skip to the page
Year 11 · Computer Science · Autumn 1 · Software

Firmware, the boot process and interrupts

What this lesson covers

4.1 Types of software and interrupts

Cambridge IGCSE Computer Science 0478 · Topic 4: Software · Paper 1

You will learn to

  • Describe how the bootloader, stored as firmware, loads the operating system at start-up.
  • Explain how applications, the operating system, firmware and hardware work as layers.
  • Describe how an interrupt is handled: save the current task, run the ISR, then carry on.
  • Give examples of hardware interrupts and software interrupts.

Success criteria

  • I can put the steps from power on to desktop in the right order.
  • I can say which layer each part runs on: application, OS, firmware, hardware.
  • I can describe the three stages of handling an interrupt.
  • I can give one hardware interrupt and one software interrupt.
The syllabus points for this section
  • Explain the difference between system software and application software.
  • Describe the nine functions of an operating system.
  • Explain how hardware, firmware, the operating system and applications work as layers.
  • Describe how an interrupt is generated and handled by an interrupt service routine (ISR).
  • Give examples of software interrupts and hardware interrupts.

Key words

Say each word, then read what it means. Every one is in the glossary too.

System software
Software that runs and manages the computer, such as the operating system and utilities.
Application software
Software that does a task for the user, such as a word processor or game.
Operating system (OS)
System software that manages the hardware, files, memory and programs, and gives the user an interface.
Device driver
A small program that lets the OS communicate with one particular device.
Multitasking
Running several programs by giving each a short turn on the processor, so they seem to run at once.
Firmware
Software stored permanently in ROM or flash memory on the hardware.
Bootloader
Firmware that loads the operating system into RAM when the computer is switched on.
Interrupt
A signal to the processor that something needs its attention.
Interrupt service routine (ISR)
A small program that deals with one type of interrupt.
Compiler
A translator that turns the whole high-level program into machine code at once and creates an executable file.
IDE
Integrated development environment: one program with the tools to write, translate, run and debug code.

The explanation

Read it here, or open the study page below to go one step at a time with things to try.

Two kinds of software

Software is a set of instructions that tells the hardware what to do. There are two main kinds.

System software runs and looks after the computer itself. The user often does not notice it working.

Application software does a job the user wants done, such as writing an essay or editing a photo.

Application software needs system software underneath it. A word processor cannot run without an operating system.

System softwareApplication software
PurposeRuns and manages the computerDoes a task for the user
ExamplesOperating system, device drivers, utilities (anti-virus, backup, disk defragmenter), compilersWord processor, spreadsheet, web browser, video game, photo editor
Who it servesThe computer and the programs on itThe user
?Why?

System software hides the hard parts of the hardware. That means the people who write apps do not need to know how every printer or disk works.

!Watch out

A web browser is application software, even though it feels like part of the computer. Ask: does it do a task for the user? If yes, it is an application.

The operating system and its nine functions

The operating system (OS) is the most important piece of system software. Examples are Windows, macOS, Linux, Android and iOS.

It sits between the user, the applications and the hardware. It manages everything so that they all work together.

Cambridge lists nine functions. Learn all nine, with an example for each.

OS functionWhat it means in plain wordsExample
Managing filesLets you create, name, save, open, copy, move and delete files and foldersSaving `essay.docx` into a folder called `English`
Handling interruptsResponds to signals that need the processor's attentionPausing a game when you press Esc
Providing an interfaceGives the user a way to talk to the computerIcons, windows and menus (GUI) or typed commands (CLI)
Managing peripherals and driversTalks to devices such as printers through driver softwareInstalling a driver so a new printer works
Managing memoryDecides which program uses which part of RAMKeeping a browser and a music app in separate areas of RAM
Managing multitaskingShares processor time so several programs seem to run at onceMusic plays while you type
Providing a platform for running applicationsGives apps a stable base and services they can useAn app asks the OS to save a file instead of controlling the disk itself
Providing system securityProtects the computer and its data from threatsBuilt-in firewall, security updates, login screen
Managing user accountsKeeps each user's files, settings and permissions separateA student account cannot install software; an admin account can
!Watch out

In the exam, "manages files" alone may not get a mark. Add what it does, for example "lets the user rename and delete files".

Files, interface, peripherals and drivers

Managing files. The OS keeps track of where each file is stored on the disk. It organises files into folders and controls who can open them.

Providing an interface. A GUI (graphical user interface) uses windows, icons, menus and a pointer. A CLI (command line interface) uses typed commands. A GUI is easier to learn; a CLI is faster for experts.

Peripherals are devices connected to the computer, such as a printer, keyboard or webcam. A device driver is a small program that translates between the OS and one particular device.

The OS also uses buffers and queues for slow devices. For example, it holds a print job in a queue until the printer is ready.

e.g.Example
A teacher plugs a new printer into a classroom laptop. 1. The OS detects a new device. 2. It finds and installs the right driver. 3. When the teacher clicks Print, the OS sends the job to the print queue. 4. The driver turns the job into commands this printer understands.
?Why?

Without drivers, the OS would need to know the details of every device ever made. Drivers mean a new device only needs one new small program.

Memory and multitasking

Managing memory. Every running program needs space in RAM. The OS gives each program its own area and takes it back when the program closes.

It also stops one program from writing into another program's memory. This prevents crashes and protects data.

If RAM is full, the OS can use virtual memory: it moves pages of data that are not in use to secondary storage.

Managing multitasking. A single processor core can only run one instruction at a time. The OS gives each program a tiny slice of processor time in turn.

The slices are so short that all the programs seem to run at the same time. The OS decides the order using priorities.

e.g.Example
You are on a video call, a file is downloading and you are typing notes. The OS switches the processor between all three many times a second. The video call gets a high priority so the sound does not stutter.
?Why?

Sharing memory and processor time fairly is what lets one computer do many jobs smoothly.

Platform, security and user accounts

Providing a platform for running applications. Apps do not control hardware directly. They ask the OS to do things for them, such as "save this file" or "show this window".

This is why an app written for Android will not run on iOS. Each app is written for one platform.

Providing system security. The OS asks for a password or fingerprint at login. It installs security updates and can run a firewall and anti-malware.

Managing user accounts. Each user has a username and password. The OS keeps their files and settings apart and gives each account its own access rights (what it is allowed to do).

e.g.Example
In a school network: A student account can open its own files and run approved software. A teacher account can also see shared class folders. An administrator account can install software and create new accounts.

The layers: hardware, firmware, OS, applications

Software is built in layers. Each layer runs the one above it.

Hardware is the physical parts. When you switch on, the hardware runs the firmware.

Firmware is software stored permanently in ROM or flash memory on the motherboard. It includes the bootloader, a small program that loads the OS from storage into RAM.

The OS then starts and takes control. Finally, the OS runs the applications you choose.

e.g.Example
Switching on a school laptop: 1. Power reaches the hardware. 2. The hardware runs the firmware stored in ROM/flash. 3. The bootloader loads the OS (for example Windows) from the SSD into RAM. 4. The OS starts, shows the login screen, then runs the apps you open.
?Why?

The OS lives on the SSD, which the processor cannot run from directly. Something permanent and small must load it first. That job belongs to the firmware.

!Watch out

Firmware is not the same as the OS. Firmware is stored in ROM or flash on the motherboard and is there even if the SSD is empty.

There is a diagram for this step in the IGCSE library.

What an interrupt is and how it is generated

An interrupt is a signal sent to the processor. It says "something needs your attention now".

Interrupts are generated by hardware (a device) or by software (a running program).

Each interrupt has a priority. An urgent one, such as a power failure, is dealt with before a less urgent one.

TypeWhere it comes fromExamples
Hardware interruptA device sends a signal to the processorA key is pressed; the mouse is moved; the printer runs out of paper; a paper jam
Software interruptA program or the OS causes itDivision by zero; two processes trying to access the same memory location; a program asking to read a file
?Why?

Without interrupts, the processor would have to keep asking every device "anything for me?". That wastes time. With interrupts, devices tell the processor only when they need it.

!Watch out

Division by zero is a software interrupt, not a hardware one. It is caused by the instruction the program runs, not by a device.

How the processor handles an interrupt

The processor checks for interrupts at the end of every fetch–decode–execute cycle.

If there is an interrupt with a higher priority than the current task, the processor stops what it is doing.

It saves the current state (the contents of its registers, such as the PC) so it can come back later.

It then runs an interrupt service routine (ISR): a small program written to deal with that type of interrupt.

When the ISR finishes, the processor reloads the saved state and carries on with the task exactly where it stopped.

e.g.Example
You are typing in a word processor and press the letter K. 1. The keyboard sends an interrupt signal. 2. At the end of the current FDE cycle, the processor sees it. 3. It saves its registers (including the PC). 4. The keyboard ISR runs and puts the code for K into a buffer. 5. The registers are restored. 6. The word processor carries on and shows K on screen.
?Why?

Saving the state is the key step. Without it, the processor would not know which instruction to go back to, and the program's data in the registers would be lost.

!Watch out

Lower-priority interrupts wait. If a new interrupt has a lower priority than the one being handled, it is queued until the ISR finishes.

There is something to try for this step in the IGCSE library.

After the ISR: what happens next

When the ISR is finished, the processor checks for any other interrupts that are waiting.

If there are more, it handles them in priority order. Each one gets its own ISR.

When none are left, it restores the saved state and the original program continues.

Try the interrupt toy above. Press Key press while the program runs, then press Step a few times. Watch the PC and ACC being saved on the stack and then put back.

StageWhat the processor does
1. SignalA device or program sends an interrupt
2. CheckAt the end of the FDE cycle, the processor checks the interrupt and its priority
3. SaveCurrent register contents are saved
4. ISRThe correct interrupt service routine runs
5. More?Any other waiting interrupts are handled
6. RestoreSaved registers are reloaded
7. ResumeThe original task carries on

Study it

Open the study page and go one step at a time.

Check yourself

One question at a time. The reason shows after each answer.

Saved on this device.