You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
This lesson examines the five core functions of an operating system in depth: process management, memory management, file management, I/O management and the user interface. The OCR H446 specification requires detailed understanding of each function.
A process is a program that is currently being executed, along with its associated data, registers and state information. The OS must manage many processes that may be competing for CPU time.
| State | Description |
|---|---|
| New | The process has been created but not yet admitted to the ready queue |
| Ready | The process is in memory and waiting for CPU time. It has everything it needs except the CPU |
| Running | The process is currently being executed by the CPU |
| Waiting (Blocked) | The process is waiting for an event (e.g. I/O completion, user input) |
| Terminated | The process has finished execution |
+-----+ +---------+
| New | ----> | Ready | <--------+
+-----+ +----+----+ |
| |
Scheduler dispatches |
| |
+----v----+ |
| Running | --------+
+----+----+ (time slice expired /
| interrupt / preempted)
|
+-------+-------+
| |
I/O request Process completes
| |
+-----v-----+ +-----v------+
| Waiting | | Terminated |
| (Blocked) | +------------+
+-----+------+
|
I/O complete
|
+-------> Ready
Every process has a Process Control Block — a data structure maintained by the OS that stores all the information needed to manage the process.
| PCB Field | Content |
|---|---|
| Process ID (PID) | Unique identifier for the process |
| Process state | Current state (ready, running, waiting, etc.) |
| Program counter | Address of the next instruction to execute |
| CPU registers | Saved register values when the process is not running |
| Memory allocation | Information about the memory pages/segments assigned |
| Priority | The process's scheduling priority |
| I/O status | List of I/O devices allocated to the process |
| Accounting info | CPU time used, start time, etc. |
When the OS switches the CPU from one process to another, it performs a context switch:
Context switching is overhead — the CPU does no useful work during the switch. Frequent switching (e.g. with many processes) increases overhead.
The OS must allocate and manage main memory (RAM) among all running processes.
| Goal | Explanation |
|---|---|
| Allocation | Assign memory to processes as they need it |
| Protection | Prevent one process from accessing another process's memory |
| Efficient use | Minimise wasted (unused) memory |
| Virtual memory | Allow processes to use more memory than physically available |
| Feature | Paging | Segmentation |
|---|---|---|
| Block size | Fixed (e.g. 4 KB) | Variable |
| Based on | Physical memory structure | Logical program structure |
| External fragmentation | None | Can occur |
| Internal fragmentation | Can occur (last page may not be full) | None |
| Address translation | Page table | Segment table |
The OS manages how files are stored on secondary storage, organised into directories, and accessed by users and programs.
| Function | Description |
|---|---|
| Creating and deleting files | The OS allocates space on disk and creates directory entries |
| Reading and writing | The OS translates file operations into disk read/write commands |
| Directory management | Organises files into a hierarchical directory (folder) structure |
| Access control | Manages permissions (read, write, execute) for different users |
| File naming | Maintains the mapping between human-readable file names and physical disk locations |
| Disk space allocation | Decides which blocks on the disk to use for each file |
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.