📁 Paper 2 · 3.4 Computer Systems
3.4.4a Operating System Functions
AQA 8525 · GCSE Computer Science · ~12 min read
Notes
──
Video
──
Worksheet
──
Quiz

Memory Management and Virtual Memory

The OS's memory management function allocates RAM to running programs, tracks which memory areas are free or in use, and protects programs from accessing each other's memory space.

When RAM is full, the OS uses virtual memory — it temporarily moves data from RAM to secondary storage (the hard drive), freeing RAM for the active process.

Virtual Memory — when RAM is full:
RAM (fast)
⇄ swap
Disk (slow pagefile)
Pages of data are swapped in/out of RAM as needed. This is called PAGING.

Virtual memory allows the computer to run programs larger than the available RAM, but accessing the disk is much slower than RAM, so heavy use of virtual memory significantly slows performance ("disk thrashing").

Process Management and Multitasking

A process is a program that is currently being executed. On a single-core CPU, only one process can run at any given moment, yet modern computers appear to run many programs simultaneously — this is multitasking.

The OS achieves multitasking through scheduling: rapidly switching CPU time between processes, giving each a small time slice. From the user's perspective it appears everything runs simultaneously.

Process States

StateMeaning
RunningCurrently using the CPU
ReadyWaiting for CPU time (not blocked)
Waiting / BlockedWaiting for an I/O event (e.g. user input, disk read) before it can proceed

Interrupts

An interrupt is a signal sent to the CPU by hardware or software indicating that an event requires immediate attention. When an interrupt occurs, the CPU:

  1. Saves the current state (so it can resume later)
  2. Runs the interrupt handler (a small routine in the OS)
  3. Returns to what it was doing before

Examples of interrupts: keyboard key pressed, mouse click, network packet arrives, timer (used by the scheduler), hardware error, divide-by-zero error.

Interrupts are prioritised — higher-priority interrupts (e.g. hardware errors) pause lower-priority ones.

File Management

The OS manages the file system — the structure used to store and retrieve files on storage devices. Key responsibilities:

  • Organising files in a directory (folder) hierarchy
  • Maintaining a file allocation table or directory entries that map filenames to physical locations on disk
  • Controlling access (read, write, execute permissions)
  • Managing file metadata: name, size, type, creation date, modification date, permissions
File systemUsed inNotes
FAT32USB drives, older WindowsSimple, compatible; max file size 4 GB
NTFSModern WindowsSupports large files, permissions, encryption, journaling
ext4LinuxModern Linux standard; journaling, large files
APFSmacOS / iOSOptimised for SSDs

Device Management

The OS manages all connected hardware devices through device drivers. It provides a Hardware Abstraction Layer (HAL) so application software can interact with hardware without needing device-specific code.

The OS also manages I/O scheduling — controlling the order in which read/write requests to storage are handled.

Exam tip: Virtual memory is frequently examined. Key points: it uses secondary storage (disk) as extra RAM when RAM is full; it is much slower than RAM; it prevents programs from crashing due to insufficient RAM. Also know what an interrupt is and give an example.
⚠️ Common Mistakes
  • Virtual memory is NOT the same as RAM — it uses disk space as an extension of RAM, and is much slower
  • Multitasking on a single core is achieved by time-slicing — only one process actually runs at a time; it just switches very rapidly
  • An interrupt does NOT terminate a process — it temporarily pauses it; the CPU saves state and returns to it after handling the interrupt
Video coming soon

Key points

  • Memory management: allocates RAM to processes; virtual memory uses disk when RAM is full — slow!
  • Process management: scheduling gives each process a time slice; multitasking is rapid switching
  • Process states: running, ready, waiting/blocked
  • Interrupt: signal to CPU requiring attention; CPU saves state, handles interrupt, resumes
  • File management: OS organises directories, maps filenames to disk locations, controls access
  • Device management: uses drivers and a HAL to communicate with hardware
Click slide or press arrow keys to navigate
✍️

Worksheet — 3.4.4a OS Functions

8 questions · 22 marks

Q1Explain what virtual memory is and why it is used.[3]
✅ Mark scheme
Mark scheme
Virtual memory uses part of secondary storage (hard drive) as if it were RAM [1]; it is used when RAM is full, allowing programs to continue running that would otherwise fail [1]; data is swapped between RAM and disk as needed (paging) [1].
Q2A computer with 4 GB RAM is running several large applications. It begins to slow dramatically. Explain why, using the term virtual memory.[2]
✅ Mark scheme
Mark scheme
The 4 GB of RAM is insufficient for all running applications [1]; the OS is using virtual memory — frequently swapping data between RAM and the much slower hard drive (disk thrashing), causing significant slowdown [1].
Q3Describe the three states a process can be in.[3]
✅ Mark scheme
Mark scheme
Running: the process is currently executing on the CPU [1]; Ready: the process is waiting for CPU time (not blocked) [1]; Waiting/Blocked: the process is waiting for an I/O event before it can continue [1].
Q4Explain how a single-core CPU can appear to run multiple programs at the same time.[2]
✅ Mark scheme
Mark scheme
The OS scheduler rapidly switches CPU time between processes (time-slicing) [1]; each process gets a small time slice in turn; the switching is so fast that it appears simultaneous to the user [1].
Q5What is an interrupt? Give two examples.[3]
✅ Mark scheme
Mark scheme
An interrupt is a signal sent to the CPU (by hardware or software) indicating an event requires immediate attention [1]; examples — any two from: key pressed, mouse click, network packet arrives, timer interrupt, divide-by-zero error, hardware fault [2].
Q6Describe what happens when the CPU receives an interrupt during normal execution.[3]
✅ Mark scheme
Mark scheme
The CPU saves the current state of the process (registers, PC) so it can resume later [1]; it then runs the interrupt handler (a small OS routine that deals with the interrupt) [1]; once the interrupt is handled, the CPU restores the saved state and resumes the interrupted process [1].
Q7State two pieces of metadata the OS typically stores for each file.[2]
✅ Mark scheme
Mark scheme
Any two from: filename, file size, file type/extension, creation date, modification date, file permissions (read/write/execute), physical location on disk [2].
Q8Evaluate the use of virtual memory: state when it is beneficial and when it becomes a problem.[4]
✅ Mark scheme
Mark scheme
Beneficial: allows programs to run even when RAM is insufficient [1]; prevents programs crashing immediately due to out-of-memory errors [1]; Problem: accessing disk is much slower than RAM (seconds vs nanoseconds) [1]; heavy use causes disk thrashing — the system becomes very slow and the hard drive has to work constantly [1].
Check your answers above.
Topic Quiz
Q 1 of 10
You scored
out of 10
Card 1 of 6
Click to flip
🎉
All done!
TermDefinition
🎯

Mini Test — 3.4.4a OS Functions

Timed exam conditions.

  • 8 questions · 10 minutes
  • 5 MCQ + 3 short answer
← 3.4.3b Utility Software
38 of 57 · AQA 8525
3.4.4b OS User Interfaces →