Cambridge A-Level Computer Science 9618 – 16.1 Purposes of an Operating System (OS)
16.1 Purposes of an Operating System (OS)
What is an Operating System?
An operating system (OS) is system software that manages hardware resources and provides services to application programs. It acts as an intermediary between users, applications, and the computer hardware.
Core Purposes of an OS
Resource Management – CPU, memory, I/O devices.
Process Management – creation, scheduling, termination of processes.
File Management – organization, storage, retrieval of data.
Security & Protection – user authentication, access control.
User Interface – command‑line or graphical interaction.
Process Management – Understanding the Concept
Process management is the OS function that controls the execution of programs. A process is an instance of a program in execution, consisting of its code, data, and execution context.
Key Activities in Process Management
Process Creation – loading a program into memory and assigning a unique Process ID (PID).
Process Scheduling – deciding which ready process gets the CPU next.
Context Switching – saving the state of the current process and restoring the state of the next.
Process Synchronisation – coordinating processes that share resources.
Process Termination – releasing resources when a process finishes or is aborted.
Process States
A typical OS models a process using a finite‑state diagram. The most common states are shown below.
State
Description
New
Process is being created.
Ready
Process is loaded in memory and waiting for CPU time.
Running
Process is currently executing on the CPU.
Blocked (Waiting)
Process cannot continue until an external event occurs (e.g., I/O completion).
Terminated
Process has finished execution and resources are reclaimed.
Scheduling Algorithms
Scheduling determines the order in which ready processes receive CPU time. Common algorithms include:
First‑Come, First‑Served (FCFS)
Shortest Job Next (SJN) / Shortest Remaining Time (SRT)
Round Robin (RR) – uses a time quantum \$q\$.
Priority Scheduling – higher‑priority processes run first.
Multilevel Queue – separates processes into distinct queues with different policies.
Performance Metrics
When evaluating a scheduling algorithm, the OS considers several metrics:
CPU Utilisation: \$U = 1 - p^{n}\$, where \$p\$ is the probability that a process is waiting for I/O and \$n\$ is the number of processes.
Throughput – number of processes completed per unit time.
Turnaround Time – total time from process creation to termination.
Waiting Time – total time a process spends in the ready queue.
Response Time – time from request submission to first response (important for interactive systems).
Example: Round Robin Scheduling
In Round Robin, each process receives a fixed time slice \$q\$ (the quantum). After \$q\$ seconds, the process is pre‑empted and placed at the back of the ready queue.
Advantages:
Fair allocation of CPU time.
Good for time‑sharing systems.
Disadvantages:
Too small a quantum leads to excessive context switches.
Too large a quantum degrades to FCFS behaviour.
Suggested diagram: State transition diagram for a process (New → Ready → Running → Blocked → Ready → Terminated)
Summary
The operating system’s process management component is essential for:
Efficiently sharing the CPU among multiple programs.
Ensuring that each process progresses through its life‑cycle safely.
Providing mechanisms for synchronisation and communication between processes.
Optimising overall system performance using appropriate scheduling strategies.