Explain why a computer system requires an Operating System (OS)

Published by Patrick Mutisya · 14 days ago

Operating Systems – Why an OS is Required

5.1 Operating Systems

Objective

Explain why a computer system requires an Operating System (OS).

Key Reasons for an OS

  • Resource Management: The OS allocates CPU time, memory, and I/O devices among competing programs.
  • Hardware Abstraction: Provides a uniform interface so that applications need not know the details of the underlying hardware.
  • User Interface: Supplies a convenient way for users to interact with the system (CLI or GUI).
  • Security & Protection: Enforces access controls, isolates processes, and prevents accidental or malicious interference.
  • Multitasking & Multiprogramming: Allows several programs to run concurrently, improving system utilisation.
  • File System Management: Organises data on storage devices and provides a hierarchical namespace.
  • Device Management: Uses device drivers to control peripherals without exposing low‑level details to applications.

How the OS Provides These Services

  1. Bootstrapping – loads the kernel from non‑volatile storage into RAM.
  2. Kernel – core component that runs in privileged mode, handling interrupts, scheduling, and memory management.
  3. System Calls – defined API that user programs invoke to request OS services.
  4. Interrupt Handling – reacts to hardware signals, enabling asynchronous I/O.

Comparison: With vs. Without an OS

AspectWith OSWithout OS
Program DevelopmentStandard libraries, system calls, portable code.Direct hardware programming; code is hardware‑specific.
Resource SharingPre‑emptive scheduling, virtual memory.Manual time‑slicing; high risk of conflicts.
SecurityUser permissions, process isolation.All code runs with full hardware access.
UsabilityGraphical/command‑line interface.Only low‑level firmware or monitor.

Illustrative Example

Consider two programs that need to write to the same disk file. The OS ensures that:

  1. Each program receives a file descriptor via a system call.
  2. The OS locks the file, writes data from the first program, then releases the lock.
  3. The second program can then safely write its data.

If no OS were present, both programs would have to implement their own locking mechanism, leading to potential data corruption.

Mathematical \cdot iew of Scheduling

The CPU utilisation \$U\$ for a set of \$n\$ independent processes with average service time \$Si\$ and inter‑arrival time \$Ai\$ can be approximated by:

\$\$

U = \sum{i=1}^{n} \frac{Si}{A_i}

\$\$

The OS scheduler aims to keep \$U\$ as close to \$1\$ as possible without causing starvation.

Suggested diagram: Layered view of a computer system showing hardware at the bottom, the OS kernel above it, and user applications on top.

Summary

  • An OS abstracts hardware, making programming easier and more portable.
  • It manages resources efficiently, enabling multitasking and better system utilisation.
  • Security, stability, and user interaction are all provided by the OS.
  • Without an OS, each application would need to implement low‑level hardware control, leading to complexity, incompatibility, and reduced reliability.