Ch 1 · 4.1 Types of Software and Interrupts · O Level Computer Science 2210
Topic 1 of 2 in Software — O Level Computer Science 2210 — 49 lessons.
Introduction
When you open a game, a whole stack of software is already working underneath it: firmware that woke the hardware up, an operating system managing memory and files, and a stream of interrupts reacting to every key you press. (Syllabus section 4.1.)
Key ideas — System software and application software
System software provides the services that the computer requires to run. It includes:
🧑🏫 Teacher's explanation
Think of a computer like a professional restaurant. The hardware is the physical building, the stove, and the ingredients. The system software is the restaurant staff—the manager and the chefs—who ensure the kitchen runs smoothly, the lights stay on, and the ingredients are organized. Without them, nothing happens. The application software is the menu items—the pizza or the pasta—which are the specific things the customer (the user) actually wants to consume. You don't eat the manager, but you need them to get your pizza.
📖 Definitions
🔍 Worked example — Easy
Classify the following list into System Software or Application Software: [Word Processor, Anti-virus, Web Browser, Disk Defragmenter, Spreadsheet, Operating System].
🔍 Worked example — Standard
Arrange the following layers in the correct order of execution during a computer's startup process (from lowest level to highest level): Operating System, Hardware, Firmware.
🔍 Worked example — Exam-style
A user is typing a document in a word processor. During this time, the computer encounters a 'Division by Zero' error in a background calculation. Identify if this is a hardware or software interrupt and explain why.
⚠️ Common errors
🧠 Quick check 1
🧠 Quick check 2
🎯 Exam question
Key ideas — The operating system
The operating system (OS) manages the hardware and provides a platform for applications. Its functions:
🧑🏫 Teacher's explanation
Think of a computer like a busy restaurant. The hardware is the kitchen equipment (stoves, pans, fridge). The Operating System (OS) is the restaurant manager. The manager doesn't cook the food, but they decide which chef uses which stove, ensure the waiters (drivers) know how to deliver orders, and handle sudden emergencies like a fire alarm (interrupts). Without the manager, the chefs would fight over the same pan and the customers wouldn't know how to order.
📖 Definitions
🔍 Worked example — Easy
Categorise the following into System Software or Application Software: Word Processor, Operating System, Web Browser, Device Driver.
🔍 Worked example — Standard
A user is typing on a keyboard while a large file is being downloaded. Explain the role of the Operating System in managing these two simultaneous actions.
🔍 Worked example — Exam-style
A program attempts to divide a number by zero. Identify the type of interrupt generated and describe the sequence of events that occurs.
⚠️ Common errors
🧠 Quick check 1
🧠 Quick check 2
🎯 Exam question
Key ideas — Hardware, firmware, OS and applications
Software runs in layers:
🧑🏫 Teacher's explanation
Think of a computer like a high-end restaurant. The Hardware is the physical building, the stoves, and the ingredients. The Firmware is the basic instruction manual for the kitchen staff on how to turn on the gas and lights when they first arrive. The Operating System is the Restaurant Manager; they don't cook the food, but they decide which waiter goes to which table, ensure the kitchen doesn't run out of space, and manage the staff so everything runs smoothly. Finally, the Application Software is the Chef; they are the ones actually performing the specific task the customer wants (like making a pizza). Without the manager (OS) and the building's basic systems (Firmware), the Chef (Application) has no place to work.
📖 Definitions
🔍 Worked example — Easy
Identify the layer of software/hardware for the following: 1. A word processor, 2. The BIOS/Bootloader, 3. The CPU.
🔍 Worked example — Standard
A user is typing on a keyboard while a program is performing a complex calculation. Describe the sequence of events involving interrupts.
🔍 Worked example — Exam-style
A program attempts to divide a number by 0. Determine the type of interrupt and the immediate consequence.
⚠️ Common errors
🧠 Quick check 1
🧠 Quick check 2
🎯 Exam question
(a) Describe the role of the Operating System in managing this interrupt. [2] (b) Explain the difference between a hardware interrupt and a software interrupt. [2] [4 marks]
Key ideas — Interrupts
An interrupt is a signal sent to the CPU from a device or a program to tell it that something needs attention.
🧑🏫 Teacher's explanation
Imagine you are reading a book (this is the CPU executing a program). Suddenly, your phone rings (this is an interrupt). You don't just ignore it; you mark your page with a bookmark (this is saving the current task's state), answer the phone (this is the Interrupt Service Routine), and once you finish the call, you use the bookmark to return exactly to the sentence you were reading (this is restoring the task).
📖 Definitions
🔍 Worked example — Easy
Identify whether the following are hardware or software interrupts:
🔍 Worked example — Standard
A CPU is executing a sequence of instructions. An interrupt occurs. Describe the sequence of events the CPU must perform to ensure the current task is not lost.
🔍 Worked example — Exam-style
A program is running on an operating system. The program attempts to write data to a memory location that is currently being used by another process. Identify the type of interrupt and the likely outcome.
⚠️ Common errors
🧠 Quick check 1
🧠 Quick check 2
🎯 Exam question
(a) Identify the type of interrupt generated by the keyboard press. [1] (b) Describe the steps the CPU takes to handle this interrupt and ensure the calculation can resume correctly. [4] [5 marks]
Worked example
The keyboard sends a hardware interrupt to the CPU. At the end of the current FDE cycle, the CPU checks for interrupts; finding this one, it saves the current task's registers and runs the interrupt service routine for the keyboard, which reads the key and passes it to the program. The CPU then restores the saved task and carries on.
🔍 Worked example — Easy
Identify whether the following are hardware interrupts or software interrupts:
🔍 Worked example — Standard
Describe the sequence of events when a hardware interrupt is received by the CPU while a program is executing.
🔍 Worked example — Exam-style
A CPU is executing a program. An interrupt occurs. Explain the difference between the role of the Operating System and the Firmware in this context.
⚠️ Common errors
Common mistakes
Practice
Answers: (1) System: an operating system, anti-virus (utility); application: a word processor, a web browser. (2) Any four from the table (managing files, memory, peripherals, multitasking, user accounts, security, interrupts, interface, platform). (3) The bootloader (firmware) runs on the hardware and loads the OS; the OS runs on that; applications run on the OS. (4) Hardware: pressing a key / moving the mouse; software: division by zero / two processes accessing the same memory. (5) The CPU checks for interrupts at the end of each FDE cycle; if one has higher priority, it saves the current task, runs the interrupt service routine, then restores the task.