OS Fundamentals
IB Syllabus: A1.3.1 – Role of operating systems, A1.3.2 – Functions of an operating system
Table of Contents
- Key Concepts
- Worked Examples
- Quick Check
- Trace Exercise
- Spot the Error
- Fill in the Blanks
- Predict the Output
- Practice Exercises
- Connections
Key Concepts
What is an Operating System? (A1.3.1)
An operating system (OS) is system software that manages a computer’s hardware and software resources and provides common services to application programs. Every device with a processor – from a smartphone to a supercomputer – runs an operating system.
The OS serves two fundamental purposes:
Abstraction – hiding hardware complexity from users and applications. Without the OS, every program would need to know exactly how to communicate with the specific brand and model of hard drive, printer, or network card installed. The OS provides a uniform interface so applications do not need to deal with hardware details. For example, a word processor calls “save file” and the OS handles where and how the data is physically written to disk.
Resource management – fairly allocating the computer’s limited resources (CPU time, memory, storage, devices) among multiple competing programs and users. When you have a browser, a music player, and a document editor running simultaneously, the OS decides which program gets CPU time, how much RAM each receives, and how they share the network connection.
The OS acts as an intermediary between hardware and application software. Applications make requests to the OS (e.g., “open this file,” “print this page”), and the OS translates those requests into hardware-specific instructions. This layered approach means applications are portable – the same program can run on different hardware as long as the OS handles the translation.
Without an operating system, every programmer would need to write low-level code to manage hardware directly. This was the reality in early computing – and it made programming slow, error-prone, and hardware-specific.
Key Functions of an Operating System (A1.3.2)
The OS performs many functions simultaneously to keep the computer running smoothly. Each function manages a specific category of resources.
Process Management
A process is a program that is currently loaded into memory and either running or waiting to run. Process management involves:
- Creating new processes when programs are launched
- Scheduling processes to share CPU time fairly (deciding which process runs next)
- Context switching – saving the state of one process and loading the state of another when the CPU switches between tasks
- Terminating processes when they finish or encounter an error
- Inter-process communication (IPC) – allowing processes to exchange data safely
On a modern computer, dozens or hundreds of processes may be active at once. The OS creates the illusion of simultaneous execution by switching between them very rapidly.
A common exam mistake is confusing a program with a process. A program is a passive set of instructions stored on disk. A process is an active instance of that program loaded in memory and being executed. You can have multiple processes of the same program (e.g., two browser windows are two separate processes).
Memory Management
The OS is responsible for managing the computer’s RAM:
- Allocating memory to processes when they start and deallocating it when they finish
- Protecting memory spaces – ensuring one process cannot read or write another process’s memory (this prevents crashes and security breaches)
- Virtual memory – using a portion of secondary storage (the swap file or swap partition) to extend the apparent size of RAM
When RAM is full, the OS uses paging to move less-used blocks of memory (called pages) from RAM to disk. When a process needs a page that is on disk, a page fault occurs – the OS must load that page back into RAM, which is much slower.
If the computer spends more time swapping pages in and out than doing useful work, this is called thrashing. Thrashing causes severe performance degradation – the computer appears to freeze or become extremely slow.
You can observe virtual memory in action: if your computer slows dramatically when many applications are open, the OS is likely swapping pages between RAM and disk. Adding more RAM reduces the need for paging.
File Management
The OS organises and controls access to data stored on secondary storage:
- Directories (folders) – hierarchical structure for organising files
- File operations – create, read, write, delete, rename, copy, move
- Access permissions – controlling which users can read, write, or execute files
- File allocation – tracking which physical sectors on the storage device belong to each file
- File metadata – storing file name, size, creation date, modification date, and permissions
The file system (e.g., NTFS on Windows, APFS on macOS, ext4 on Linux) is the OS component that manages how files are stored on disk.
Device Management
The OS manages communication with all I/O (input/output) devices – keyboards, mice, monitors, printers, network cards, and more.
- Device drivers – specialised software modules that provide a uniform interface between the OS and a specific hardware device. Each device needs its own driver, but applications interact with all devices through the same OS interface.
- Buffering – temporarily storing data in memory while it is being transferred between a device and the CPU. This compensates for speed differences (the CPU is much faster than most devices).
- Caching – keeping frequently accessed device data in memory for faster retrieval
- Spooling – queuing output for a slow device so the CPU does not have to wait. For example, when you print multiple documents, the OS places them in a print queue (spool) and sends them to the printer one at a time while the CPU continues other work.
Spooling is a frequently examined concept. The key idea is that the CPU is too fast to wait for a slow device like a printer. Instead, the OS stores the print job in a queue and processes it in the background, freeing the CPU for other tasks.
Security
The OS protects the system and its data through multiple mechanisms:
- Authentication – verifying who the user is (e.g., password, fingerprint, face recognition). This answers the question: “Are you who you claim to be?”
- Authorization – determining what an authenticated user is allowed to access (e.g., file permissions, network resources). This answers the question: “Are you allowed to do this?”
- Encryption – protecting data by converting it into an unreadable format that requires a key to decrypt
- Audit logging – recording user actions and system events for review (e.g., login attempts, file access, configuration changes)
- Account lockout – disabling accounts after repeated failed login attempts to prevent brute-force attacks
A very common exam mistake is confusing authentication and authorization. Authentication = identity (proving who you are). Authorization = access (determining what you are allowed to do). A user must be authenticated before they can be authorized. Think of it like a security checkpoint: the guard checks your ID (authentication), then checks if your name is on the guest list (authorization).
Accounting and Monitoring
The OS tracks how resources are being used:
- Resource monitoring – measuring CPU usage, memory consumption, disk I/O, and network traffic in real time
- Quotas – setting limits on resources a user or process can consume (e.g., maximum disk space per student account)
- Performance analysis – identifying bottlenecks (e.g., a process consuming 95% of CPU time)
- Usage logging – recording how much of each resource each user has consumed over time (important in shared environments like schools or cloud servers)
System administrators use monitoring tools (e.g., Task Manager on Windows, Activity Monitor on macOS) to diagnose performance issues and ensure fair resource distribution.
GUI and Accessibility
The OS provides the interface through which users interact with the computer:
- GUI (Graphical User Interface) – the visual interface with windows, icons, menus, and pointers (the WIMP model)
- Window management – handling overlapping windows, minimising, maximising, resizing, and switching between applications
- CLI (Command Line Interface) – text-based interface where users type commands. Preferred by system administrators and developers for its power and scriptability
- Accessibility features – screen readers, high-contrast modes, keyboard navigation, voice control, and magnification for users with disabilities
Most modern operating systems offer both GUI and CLI options. The GUI is more intuitive for everyday users; the CLI is more efficient for repetitive tasks and system administration.
Virtualization
Virtualization enables one physical computer to run multiple virtual computers simultaneously:
- A hypervisor is software that creates and manages virtual machines (VMs)
- Each VM behaves like a separate computer with its own OS, CPU allocation, RAM, and storage
- VMs are isolated from each other – if one crashes, the others are unaffected
- Virtualization is the foundation of cloud computing – cloud providers run thousands of VMs on shared physical hardware
There are two types of hypervisors:
- Type 1 (bare-metal) – runs directly on hardware (e.g., VMware ESXi, used in data centres)
- Type 2 (hosted) – runs on top of an existing OS (e.g., VirtualBox, used on desktops)
Networking
The OS manages the computer’s network connections:
- NIC management – controlling the network interface card(s) to send and receive data
- TCP/IP stack – implementing the networking protocols that enable internet communication
- DHCP – automatically obtaining an IP address when connecting to a network
- Firewall – filtering incoming and outgoing network traffic based on security rules
- VPN – creating secure, encrypted connections over public networks
Every time you open a website, the OS handles dozens of networking operations: resolving the domain name, establishing a TCP connection, sending requests, receiving data, and routing it to the correct application.
Summary of OS Functions
| Function | What it manages | Key concepts |
|---|---|---|
| Process Management | CPU time | Processes, scheduling, context switching |
| Memory Management | RAM | Allocation, virtual memory, paging |
| File Management | Storage | Directories, permissions, file operations |
| Device Management | I/O devices | Drivers, buffering, spooling |
| Security | Access control | Authentication, authorization, encryption |
| Accounting | Resource usage | Quotas, monitoring, bottlenecks |
| GUI | User interface | WIMP, accessibility, CLI vs GUI |
| Virtualization | Virtual machines | Hypervisors, VMs, containers |
| Networking | Network connections | NIC, TCP/IP, DHCP, firewall |
OS Layer Model
The OS sits between application software and hardware, acting as the intermediary layer:
+------------------------------------------+
| Application Software |
| (Word processor, Browser, Game) |
+------------------------------------------+
| Operating System |
| +--------+--------+--------+--------+ |
| |Process |Memory |File |Device | |
| |Mgmt |Mgmt |Mgmt |Mgmt | |
| +--------+--------+--------+--------+ |
| |Security|Account |GUI |Network | |
| +--------+--------+--------+--------+ |
+------------------------------------------+
| Hardware |
| (CPU, RAM, Disk, I/O Devices) |
+------------------------------------------+
Applications never communicate directly with hardware. They make requests to the OS (called system calls), and the OS translates those requests into hardware-specific instructions. This means applications do not need to know the details of the hardware – they only need to know how to talk to the OS.
Types of Operating Systems
This goes beyond the IB syllabus but helps build understanding.
Different environments require different types of operating systems:
- Batch OS – processes jobs in batches without user interaction. Jobs are queued and executed sequentially. Used in payroll processing and bank statement generation.
- Real-time OS (RTOS) – guarantees responses within strict time deadlines. Used in aircraft control systems, medical devices, and industrial robots where a delayed response could be catastrophic.
- Multi-user / Multi-tasking OS – allows multiple users and/or multiple programs to share the computer simultaneously. All modern desktop and server operating systems (Windows, macOS, Linux) fall into this category.
- Distributed OS – manages a group of networked computers so they appear to the user as a single system. Used in large-scale computing (e.g., Google’s infrastructure, supercomputer clusters).
Worked Examples
Example 1: What Happens When You Double-Click an Application?
When you double-click an application icon on the desktop, the OS orchestrates a complex sequence of operations. Here is a step-by-step trace of which OS functions are involved:
| Step | What happens | OS Function |
|---|---|---|
| 1 | The desktop detects the double-click event on the icon | GUI management – the window manager captures the mouse event and identifies which icon was clicked |
| 2 | The OS checks whether the user has permission to run this application | Security – authorization check (does this user have execute permission on this file?) |
| 3 | The OS locates the application file on the storage device | File management – the file system resolves the file path and finds the physical location on disk |
| 4 | The OS allocates a block of RAM for the new application | Memory management – the OS reserves memory space for the program’s code, data, and stack |
| 5 | The OS creates a new process and adds it to the ready queue | Process management – a new process control block (PCB) is created with a unique process ID |
| 6 | The scheduler allocates CPU time to the new process | Process management – the scheduler decides when the new process gets its turn on the CPU |
| 7 | The application’s window appears on screen | GUI management – the window manager creates and renders the application window |
| 8 | The application reads its configuration files from disk via the device driver | Device management – the device driver handles the low-level I/O with the storage device |
This example illustrates how even a simple user action – double-clicking an icon – involves nearly every OS function working together.
Example 2: Match OS Functions to Scenarios
For each scenario, identify which OS function is primarily responsible.
| # | Scenario | OS Function | Explanation |
|---|---|---|---|
| 1 | A teacher cannot access student grade files on the school network | Security (authorization) | The teacher’s account does not have permission to access that directory |
| 2 | The computer slows dramatically when 20 applications are open | Memory management (thrashing) | RAM is full, so the OS is constantly swapping pages to and from disk |
| 3 | A student sends a document to the printer but it does not print immediately | Device management (spooling) | The print job is queued because the printer is busy with another job |
| 4 | A user types their password incorrectly and their account is locked | Security (authentication) | The authentication system detected repeated failed login attempts |
| 5 | A new USB keyboard is plugged in and works without installing software | Device management (drivers) | The OS has a built-in generic driver for USB keyboards (plug and play) |
| 6 | The system administrator notices one process is using 90% of CPU | Accounting and monitoring | The monitoring system tracks resource usage and identifies bottlenecks |
Quick Check
Q1. A computer has multiple programs running at the same time. Which core purpose of the OS ensures each program gets a fair share of the CPU, memory, and devices?
Q2. Which OS function is responsible for providing device drivers that allow the OS to communicate with hardware peripherals?
Q3. What does the operating system do when RAM is completely full and a new program needs memory?
Q4. Which statement correctly distinguishes authentication from authorization?
Q5. When multiple users send documents to a shared printer, the OS places each job in a queue. What is this technique called?
Trace Exercise
A user double-clicks “report.docx” on the desktop. Trace through the operating system functions that handle each step of this process. Type the name of the OS function responsible for each step.
Trace: Opening a Document
A user double-clicks "report.docx" on the desktop. For each step, identify which OS function is responsible.
| Step | Action | OS Function |
|---|---|---|
| 1 | User double-clicks the file icon on the desktop | |
| 2 | OS checks if the user has permission to open the file | |
| 3 | OS locates the file on the hard drive | |
| 4 | OS allocates RAM for the word processor application | |
| 5 | OS creates a new process for the word processor | |
| 6 | OS loads the file data from disk through the device driver |
Spot the Error
A student wrote revision notes about OS security functions. One line contains an error in the description. Click the line with the error, then pick the correct fix.
Pick the correct fix for line 3:
Fill in the Blanks
Complete the summary of OS functions by filling in the correct term for each description.
Fill in the blanks to match each OS function to its description:
OS FUNCTIONS SUMMARY
====================
manages the allocation and deallocation of RAM.
provides a uniform interface to hardware devices through drivers.
verifies a user's identity before granting access.
queues print jobs so the CPU does not wait for the slow printer.
tracks resource usage and enforces quotas.
Predict the Output
A computer has 4 GB of RAM and the OS has configured 8 GB of swap space on the hard drive for virtual memory. Three processes are started, each requiring 2 GB of memory.
Can all three processes run at the same time? (Type Yes or No)
A user types their password incorrectly 3 times in a row. The OS automatically locks their account for 15 minutes.
Which OS function is responsible for locking the account? (Type the function name)
Practice Exercises
Core
-
OS Functions – Name and describe four key functions of an operating system. For each function, give a specific example of how a student would encounter it during a typical school day.
-
Abstraction – Explain how the OS provides abstraction using the example of printing a document. In your answer, describe what would happen if the OS did not provide this abstraction – what would the application programmer need to do instead?
-
Security Terms – Distinguish between authentication, authorization, and encryption. For each, provide a real-world analogy (not a computer example) that illustrates the concept.
Extension
- Virtual Memory – A school computer has 8 GB of RAM and 16 GB of swap space. Thirty students each open a browser (using 500 MB) and a word processor (using 200 MB) simultaneously.
- (a) Calculate the total memory required.
- (b) Explain how virtual memory allows this to work.
- (c) Explain what paging and page faults are.
- (d) Describe what happens if the total demand exceeds both RAM and swap space (thrashing).
- OS Comparison – Compare how a real-time operating system (RTOS) differs from a general-purpose operating system (like Windows or macOS). In your answer, discuss: (a) the importance of response time guarantees, (b) two examples of systems that require an RTOS, and (c) why a general-purpose OS would be unsuitable for those systems.
Challenge
- School OS Design – A school of 500 students and 50 teachers needs to select and configure an operating system for its computer labs. The school has a limited IT budget and must ensure:
- Students can only access their own files
- Teachers can access student work for grading
- Resource-intensive applications (e.g., video editing) do not slow down other users
- Students working from home can access school resources
Evaluate which OS functions are most critical for this scenario. For each function you identify, explain why it is important and describe one specific configuration decision the IT department should make. Rank the functions in order of priority and justify your ranking.
Connections
- Prerequisites: CPU Architecture – the OS manages CPU scheduling through the fetch-decode-execute cycle; understanding registers and the FDE cycle explains how context switching works
- Prerequisites: Primary Memory – OS memory management controls the RAM/cache hierarchy; understanding cache hits/misses and the memory hierarchy explains why virtual memory is slower than RAM
- Related: Cloud Computing – virtualization (A1.3.2) is a key OS function enabling cloud infrastructure; hypervisors manage VMs that run in cloud data centres
- Forward: Scheduling – scheduling algorithms (FCFS, Round Robin, Priority) implement the process management function covered on this page
- Forward: Polling and Interrupts – how the OS detects and responds to hardware events using polling loops and interrupt service routines