Why an operating system exists at all
Kernel — The core of the operating system, always resident in memory, which manages the CPU, memory and devices. Other parts of the OS — the interface, the utilities — can be replaced or restarted; the kernel cannot.
Without one, every program would have to contain its own code for reading a disk, driving a screen and talking to a network card — and any two programs running together would overwrite each other's memory. The operating system exists to solve both problems: it provides shared services so programs need not reinvent them, and it enforces separation so they cannot interfere.
It is loaded before anything else. Firmware on the motherboard starts, checks the hardware, finds the disk holding the OS, loads the kernel into memory and hands over control — a sequence called booting. From that moment the OS is in charge, and every other program runs by its permission.
Select Firmware, then Operating system, then Application. That is the boot order, and it is also the order of a request travelling back down when an application wants to save a file.
The five services it provides
The syllabus names five, and each exists because programs would otherwise conflict over a shared resource.
| Service | The problem it solves |
|---|---|
| Process management | many programs, one CPU — who runs next, and for how long |
| Memory management | many programs, one RAM — who gets which region, and keeping them apart |
| File management | organising storage into files and folders, and controlling access |
| Device management | talking to thousands of device models through drivers |
| Security and users | accounts, passwords and permissions, so one user cannot read another's files |
Multitasking on a single core
A single-core CPU executes one instruction at a time, yet twenty programs appear to run at once. The OS gives each a few milliseconds in turn and switches between them faster than a human can notice — time-slicing. Saving one program's state and restoring another's is a context switch. A multi-core processor genuinely runs several at once, but the illusion on one core is achieved entirely by switching.
Memory management, and why a short-of-memory machine crawls
Each program is given the illusion of a large private address space. The OS maps those virtual addresses onto whatever physical RAM happens to be free, which is what lets a program be written without knowing where in memory it will end up, and what stops one program from reading another's data.
When RAM fills, the OS writes the least recently used pages out to disk and reads them back when needed — paging, or swapping. Disk is thousands of times slower than RAM, so a machine that has started paging heavily becomes dramatically slow while the CPU sits idle waiting. That is the specific reason adding RAM often helps more than a faster processor.
A user complains that their computer is fine in the morning but crawls by the afternoon, with the disk light constantly on. Explain what is happening.
- The constant disk activity with a slow machine is the signature of paging.If the CPU were the bottleneck the processor would be at 100%, not the disk.
- Through the day more applications and browser tabs are opened, and each occupies RAM.Programs closed by the user free their memory; ones merely minimised do not.
- Once RAM is full the OS begins moving pages to disk to make room.It has no alternative — the alternative is refusing to run anything new.
- Every switch between programs now requires a disk read, which takes thousands of times longer than a memory access.Hence the disk light and the sluggishness together.
- The fixes: close unused programs, reduce startup programs, or add RAM.A faster disk shortens the delay; more RAM removes it.
RAM has filled and the OS is paging to disk — visible as constant disk activity with a slow machine.
Files, permissions and users
The file system organises storage into a hierarchy of folders, records where each file physically sits, and stores its metadata — name, size, type, dates, and who may do what with it.
Permissions are the security half. A typical scheme grants read, write and execute rights separately, to the owner, to a group, and to everyone else. That is what allows a school to give students read access to shared resources while preventing them from altering them, and it is why an administrator account should not be used for everyday work: any malware that runs inherits the permissions of the account that started it.
Deleting a file usually does not erase it
Deleting normally removes the file's entry from the index and marks its space as reusable. The data itself stays on the disk until something happens to overwrite it, which is why recovery software can retrieve deleted files — and why a disk being given away or sold must be securely wiped, not merely emptied of its recycle bin.
Types of operating system
Different jobs need different scheduling behaviour, and the syllabus lists the categories.
A single-user single-tasking system runs one program for one person — simple embedded devices. Single-user multi-tasking is what a laptop runs. A multi-user system serves several people at once on shared hardware, as a server does. A real-time system guarantees a response within a fixed time, which matters when the computer is controlling a car's brakes or a patient monitor — being right too late is the same as being wrong. And a distributed system spreads one job across many machines that appear as one.
Before you leave this chapter
- The OS provides shared services and enforces separation between programs.
- The kernel is the always-resident core; booting loads it before anything else runs.
- Five services: processes, memory, files, devices, and security.
- Multitasking on one core is time-slicing, not simultaneous execution.
- Heavy paging — a slow machine with a busy disk — means RAM is full.