Role of an operating system (OS) — AQA A-Level Computer Science
An operating system (OS) is core system software that manages computer hardware, system resources, and provides common services for application programs. It acts as an abstraction layer between hardware and user software, handling critical roles including processor scheduling, memory management, file management, peripheral handling, and interrupt processing.
Role of an operating system (OS) explained
An operating system (OS) is system software that sits between the hardware and the application programs and users.
Read the full explanation
One of its roles is abstraction: it hides the complexities of the hardware so that programmers and users do not need to know the detailed electrical and physical behaviour of each device. For example, when a program saves a file, it does not need to control the disk head, track and sector positions directly; it asks the OS to write data to a named file, and the OS handles the low-level operations through device drivers. Similarly, a printer driver lets a word processor send a document without knowing the printer's internal command set. This abstraction makes programs portable and easier to write, because the same application can run on different hardware configurations that the OS manages.
Your focus
- Understand that a role of the operating system is to hide the complexities of the hardware.
Which command word is this?
Set out the causes, reasons, or mechanisms of a process with technical accuracy. For example, explaining how an interrupt is processed requires stating the exact hardware actions, stack pushes, and register updates in sequence.
Role of an operating system (OS) exam tips
Topic Overview
The operating system is the master control program that hides the complexities of raw computer hardware from software developers and end users. It manages essential low-level components including processor time, volatile memory allocation, peripheral access, and permanent file systems, creating a stable platform known as a virtual machine.
Within the AQA A-Level specification, studying the OS bridges the gap between hardware architecture and practical computing. Mastering this topic requires understanding how system software orchestrates the CPU fetch-execute cycle, coordinates asynchronous input/output via interrupts, and optimizes scarce memory resources using paging, segmentation, and scheduling algorithms.
Key Concepts
- →Hardware Abstraction: The OS provides a consistent application programming interface (API) and virtual machine layer, shielding application developers from low-level hardware specifics through device drivers.
- →Memory Management: Employs paging (fixed-size blocks) and segmentation (variable-size logical blocks) to allocate physical RAM, protect processes from memory collisions, and enable virtual memory through secondary storage paging.
- →Processor Scheduling: Allocates CPU execution time using algorithms such as Round Robin, Shortest Job First, First Come First Served, and Multi-Level Feedback Queues to maximise processor utilisation, ensure fairness, and avoid starvation.
- →Interrupt Handling: Uses the interrupt register and Interrupt Service Routines (ISRs) to handle external hardware signals or software errors, preserving CPU register context via the system stack.
- →Peripheral and Buffer Management: Controls communication between fast internal buses and slow input/output devices using device drivers and memory buffers to prevent processor bottlenecks.
Marking Points
- States that the OS presents a simplified interface so users and programs do not handle hardware details directly.
- Gives a concrete example such as saving a file without controlling disk tracks or sectors.
- Explains that device drivers allow the OS to communicate with specific hardware.
- Explains that the abstraction allows applications to run across different hardware.
Examiner Tips
- 💡Look for options that describe a simpler interface or abstraction rather than direct control of hardware.
- 💡Use a concrete example such as file storage or printing to show understanding.
- 💡Reject options that claim the OS makes hardware unnecessary; the hardware is still required and managed.
- 💡Always state that register values and the Program Counter are saved to the 'system stack' when an interrupt is triggered, not generic 'memory' or 'cache'.
- 💡Use precise scheduling terms such as 'quantum', 'pre-emptive', 'throughput', 'starvation', and 'latency' when evaluating scheduling algorithms to secure top-band marks.
- 💡When explaining multi-tasking, explicitly state that on a single-core CPU, multitasking is an illusion created by rapid time-slicing (pre-emption), whereas true parallel execution requires multi-core hardware.
Common Mistakes
- States that the OS hides hardware from the processor; correct it by explaining that the abstraction is presented to programs and users.
- Describes hiding complexity as meaning the OS removes all hardware; correct it to say the OS still manages the hardware behind a simpler interface.
- Gives only a general description such as 'the OS helps the computer'; correct it with a specific example such as file saving or printing.
- Believing virtual memory makes a computer faster: Virtual memory actually slows execution compared to physical RAM because secondary storage access times are orders of magnitude slower; it merely prevents out-of-memory crashes.
- Assuming paging and segmentation are identical techniques: Paging divides memory into fixed-size physical frames based purely on capacity, while segmentation creates variable-length partitions based on the program's logical modules (e.g. methods, classes).
- Thinking interrupts pause the CPU immediately mid-instruction: The processor always completes the current Fetch-Decode-Execute cycle before checking the interrupt register during the decode/interrupt phase.
Revision Plan
- 1Step 1: Consolidate core definitions: list the main responsibilities of an OS (scheduling, memory management, peripheral management, file handling, user interface).
- 2Step 2: Construct comparative tables contrasting paging versus segmentation, and pre-emptive versus non-pre-emptive scheduling algorithms.
- 3Step 3: Draw a step-by-step flowchart of the interrupt lifecycle, tracking how the CPU stack, Program Counter, and Interrupt Service Routine interact.
- 4Step 4: Practice AQA 6-mark and 9-mark evaluation questions regarding operating system design, virtual memory trade-offs, and multi-access scheduling.
Exam Question Types
- 📋Comparison Questions: Contrasting paging and segmentation, or contrasting two scheduling algorithms (e.g. FCFS vs Round Robin) with reference to turnaround time and fairness.
- 📋Process Flow / Trace Questions: Detailing the step-by-step handling of a hardware or software interrupt, specifically naming registers, the system stack, and the ISR.
- 📋Scenario-Based Evaluation: Assessing which OS scheduling algorithm or memory configuration is optimal for a given computer system (e.g. real-time medical monitor vs desktop workstation).
Command Word Expectations (AQA)
Set out the causes, reasons, or mechanisms of a process with technical accuracy. For example, explaining how an interrupt is processed requires stating the exact hardware actions, stack pushes, and register updates in sequence.
Identify both similarities and differences between two concepts (such as paging vs segmentation or Round Robin vs Shortest Job First), linking differences to their structural causes or performance impacts.
Make a reasoned appraisal of different approaches, considering pros, cons, and contextual trade-offs before providing a definitive, justified conclusion tailored to the scenario.
How Students Lose Marks (Examiner Pitfalls)
Step-by-Step Worked Solutions
Question: Evaluate the use of Round Robin (RR) compared to Shortest Job First (SJF) scheduling in a multi-user, interactive desktop operating system. [6 marks]
- 1.Step 1: Define Round Robin and state its characteristics (allocates a fixed time slice or quantum to each process; pre-emptive; cycles through processes in a ready queue).
- 2.Step 2: Define Shortest Job First and state its characteristics (selects the process with the smallest estimated CPU run time; non-pre-emptive unless shortest remaining time first; requires prior knowledge of job lengths).
- 3.Step 3: Analyze suitability for multi-user/interactive desktop systems. Explain why Round Robin ensures responsiveness and fairness (prevents long processes from monopolising the CPU, avoids starvation).
- 4.Step 4: Critique SJF in this context. Explain that SJF provides high overall throughput and minimal average waiting time, but can lead to starvation of longer processes and is impractical in interactive systems where execution time cannot be predicted in advance.
- 5.Step 5: Form a justified conclusion. Round Robin is preferable for interactive multi-user environments because fairness and consistent response times outweigh overall throughput optimisation.
Question: Explain the role of virtual memory when physical RAM becomes full, and explain the cause and consequence of disk thrashing. [4 marks]
- 1.Step 1: Explain virtual memory creation and mapping (a designated section of secondary storage configured to act as an extension of physical RAM).
- 2.Step 2: Describe page swapping mechanism (pages that are currently inactive are copied from RAM to the swap file on secondary storage, freeing RAM frames for active pages).
- 3.Step 3: Explain the cause of disk thrashing (occurs when RAM is insufficient to hold the working sets of all executing processes, forcing the OS to continuously swap pages between RAM and secondary storage).
- 4.Step 4: Explain the consequence of thrashing (the CPU spends more time servicing page faults and managing disk I/O transfers than executing actual instructions, leading to catastrophic system slowdown and freeze).