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.
?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 outA 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.
!Watch outIn 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.ExampleA 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.ExampleYou 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.ExampleIn 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.ExampleSwitching 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 outFirmware 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.
?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 outDivision 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.ExampleYou 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 outLower-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.