Explain why a computer system needs an Operating System (OS) and describe the main services it provides, in line with the Cambridge IGCSE/A‑Level syllabus.
An OS is the essential software layer that sits between the hardware and the user programmes. It makes a computer:
| Task | What the OS does | Typical example (exam‑style) |
|---|---|---|
| Process management | Creates, schedules, synchronises and terminates processes; maintains process states (new, ready, running, blocked, terminated). | Round‑robin scheduler gives each of three programmes a 10 ms time‑slice. |
| Memory management | Allocates and de‑allocates main‑memory blocks; provides virtual memory, paging and protection between processes. | A programme requests 8 KB more RAM; the OS swaps a seldom‑used page to disk to satisfy the request. |
| File‑system management | Creates, deletes and renames files and directories; maintains a hierarchical directory tree; stores file attributes (size, timestamps, permissions); controls access with read/write/execute rights. | When a user types rm report.doc, the OS removes the directory entry and frees the occupied blocks. |
| Device (hardware) management | Provides a uniform interface to peripherals via device drivers; buffers I/O, handles interrupts, and performs error recovery. | A printer driver converts a generic “print” request into the specific command sequence required by the HP LaserJet. |
| Security & protection | Authenticates users, enforces access‑control lists, isolates processes, and prevents unauthorised hardware access. | A non‑admin user cannot delete C:\Windows\system32 because the OS denies the operation. |
These tools are not part of the kernel but are bundled to help users and administrators manage the system.
zip, gzip) – reduce file size for storage or transmission.Exam‑style question: “A user’s hard‑disk has become unreadable after a power failure. Which bundled utility would you use to try to recover the lost data?” – Answer: the backup & restore tool (or a disk‑repair utility such as chkdsk).
Libraries contain reusable code that applications can call without re‑implementing common functions.
Typical examples:
printf(), sqrt(), file I/O.Code‑snippet illustration (pseudo‑code):
// programme.c – uses the standard C library (dynamic linking)#include <stdio.h>
int main(void) {
double r = 5.0;
double area = MPI * r * r; // MPI comes from the math library
printf("Area = %.2f\n", area);
return 0;
}
The call to printf is resolved at run‑time by the C run‑time library; the programme itself does not contain the implementation of printf.
open(), fork(), read()).A process moves through a set of states while the OS schedules it:
Common scheduling algorithms (briefly):
| Aspect | With an OS | Without an OS |
|---|---|---|
| Program development | Standard libraries, system calls, portable source code. | Direct hardware programming; code tied to a specific machine. |
| Resource sharing | Pre‑emptive scheduling, virtual memory, file locks. | Manual time‑slicing; high risk of conflicts and memory overlap. |
| Security | User accounts, permissions, process isolation. | All code runs with full hardware access; no protection. |
| Usability | CLI or GUI, file browsers, help systems. | Only low‑level firmware/monitor; no convenient interface. |
| Reliability | Fault handling, dead‑lock detection, graceful shutdown. | Any error can crash the whole machine. |
Two programmes need to append data to the same log file.
open("log.txt", O_APPEND); the OS returns a file descriptor.Without an OS each programme would have to implement its own low‑level locking protocol, greatly increasing the chance of data corruption.
For n independent processes with average service time Si and average inter‑arrival time Ai, the theoretical CPU utilisation is
\(U = \displaystyle\sum{i=1}^{n}\frac{Si}{A_i}\)
The scheduler tries to keep U close to 1 (full utilisation) while avoiding starvation.
Compilers, assemblers and interpreters rely on OS services to:
Thus the OS provides the runtime environment in which language translators operate.
Your generous donation helps us continue providing free Cambridge IGCSE & A-Level resources, past papers, syllabus notes, revision questions, and high-quality online tutoring to students across Kenya.