Show understanding of how an OS can maximise the use of resources

Published by Patrick Mutisya · 8 days ago

Cambridge A-Level Computer Science 9618 – 16.1 Purposes of an Operating System (OS)

16.1 Purposes of an Operating System (OS)

Objective

Show understanding of how an OS can maximise the use of resources.

1. Why an Operating System is Needed

  • Provides a common interface between hardware and user programs.
  • Manages hardware resources so that multiple programs can run concurrently.
  • Ensures system stability, security and efficient operation.

2. Core Functions of an OS

  1. Process Management – creation, scheduling, termination and synchronization of processes.
  2. Memory Management – allocation, swapping, paging and protection of RAM.
  3. File System Management – organising data on storage devices, providing hierarchical directories.
  4. Device Management – drivers, I/O scheduling and buffering.
  5. Security & Protection – authentication, access control, isolation of processes.

3. Resource Management Strategies

The OS employs several strategies to maximise the utilisation of CPU, memory, storage and I/O devices.

ResourceManagement TechniqueEffect on Utilisation
CPUPre‑emptive multitasking with time‑slicingReduces idle time; each process gets a quantum, improving overall throughput.
MemoryVirtual memory with pagingAllows programs to use more memory than physically available, decreasing page‑fault overhead.
Disk StorageFile caching and write‑back buffersSpeeds up read/write operations by keeping frequently accessed data in RAM.
I/O DevicesInterrupt‑driven I/O and DMACPU is freed while data transfer occurs, increasing parallelism.

4. Maximising CPU Utilisation

The proportion of time the CPU is actively executing user processes is called CPU utilisation:

\$\$

U_{CPU} = \frac{\text{CPU time spent on processes}}{\text{Total elapsed time}} \times 100\%

\$\$

Techniques to raise \$U_{CPU}\$ include:

  • Shorter time‑slices for interactive tasks.
  • Priority‑based scheduling (e.g., round‑robin with dynamic priorities).
  • Load balancing across multiple cores or CPUs.

5. Maximising Memory Utilisation

Effective memory use is measured by the memory utilisation factor:

\$\$

U_{MEM} = \frac{\text{Allocated memory in use}}{\text{Total physical memory}} \times 100\%

\$\$

Key OS mechanisms:

  • Paging – divides memory into fixed‑size pages; only needed pages are kept in RAM.
  • Segmentation – logical division of a program’s address space, allowing sharing of code segments.
  • Swapping – moves entire processes to disk when RAM is scarce, freeing space for active tasks.

6. Maximising I/O Throughput

Throughput can be expressed as:

\$\$

T_{IO} = \frac{\text{Number of I/O operations completed}}{\text{Unit time}}

\$\$

OS techniques to increase \$T_{IO}\$:

  • Use of interrupts instead of polling.
  • Implementation of direct memory access (DMA) to bypass the CPU.
  • Scheduling algorithms such as elevator (SCAN) for disk arm movement.

7. Example: How a Modern OS Balances Resources

Consider a scenario where a user runs a web browser, a music player, and a background backup utility simultaneously.

  1. The scheduler assigns higher priority to interactive tasks (browser, music player) and lower priority to the backup.
  2. Virtual memory allows the backup to use disk space as additional RAM, preventing the system from running out of physical memory.
  3. Disk caching stores frequently accessed web pages in RAM, reducing disk reads.
  4. DMA transfers music data from the sound card to memory without CPU involvement, keeping the CPU free for UI responsiveness.

8. Summary

  • The OS abstracts hardware, providing a stable platform for applications.
  • Through process, memory, file and device management, the OS maximises the utilisation of all system resources.
  • Scheduling, virtual memory, caching and interrupt‑driven I/O are core techniques that reduce idle time and improve throughput.

Suggested diagram: Flowchart showing interaction between user programs, the OS kernel, and hardware components (CPU, memory, storage, I/O devices).