Study
CSC-308 route
Unit 1 · Lesson 1 of 3 12 min

OS Purpose, Views and Evolution

Bridging raw interrupt-driven hardware and user applications from Batch jobs to Time-Sharing.

Without an operating system, printing a single line of text would require writing raw disk-controller register code by hand while hoping no other program overwrites your RAM. The operating system turns chaotic hardware into a shared, reliable workspace.

System Components and Dual Perspectives

A computer system works across five layers: hardware (CPU, RAM, I/O devices), the operating system, system utilities, application programs, and end users.

An operating system acts as both a resource allocator that manages CPU, memory, and I/O hardware and a control program that provides a safe, convenient interface between users and physical devices.

What you expect from the OS depends on where you sit:

  • User view: On a personal laptop, the OS optimises convenience and responsiveness. On a shared server or mainframe, it balances fair multi-user access with high hardware utilisation.
  • System view: To the hardware, the OS is both a resource allocator (arbitrating CPU time, RAM frames, file space, and I/O devices) and a control program (supervising execution to prevent errors and improper device access).

The Instruction Cycle and Interrupts

At the hardware level, the CPU repeatedly runs the instruction cycle: it fetches the next instruction pointed to by the Program Counter (PC), decodes the opcode, and executes the operation.

Modern operating systems are interrupt-driven. When a key is pressed, a disk read finishes, or a timer expires, hardware raises an interrupt—or software triggers a trap (exception) such as division by zero. The CPU pauses the active program, saves its state, runs the OS Interrupt Service Routine (ISR) via the interrupt vector, and resumes cleanly.

From Batch Processing to Time-Sharing

Early computers were far too expensive to sit idle while slow card readers or printers finished a job, so operating systems evolved to overlap work and share the CPU.

Operating systems evolved from Simple Batch (one job at a time), through SPOOLing and Multiprogramming (overlapping CPU work and I/O across several jobs in RAM), to Time-Sharing (rapid timer slices for interactive response).

SPOOLing (Simultaneous Peripheral Operations On-Line) uses magnetic disk as a fast staging buffer between slow I/O peripherals and a fast CPU, letting one job's I/O overlap with another job's computation.

Three Eras of Operating Systems
EraHow It WorkedStrengthLimitation
Simple BatchOperator grouped similar card jobs to run in sequenceAutomated job transitionsCPU sat idle during slow I/O
SPOOLing + MultiprogrammingSeveral jobs stayed in RAM; CPU switched whenever a job waited on I/OHigh CPU utilisationNo interactive user feedback
Time-Sharing (Multitasking)Rapid timer-driven switches in millisecond slicesFast interactive response timeRequires memory protection and scheduling
1. Simple Batch 1 job in RAM at a time CPU stalls during I/O No user interaction 2. Multiprogramming Multiple jobs in RAM Switch CPU on I/O wait High CPU utilisation 3. Time-Sharing Preemptive timer slices Rapid job switching Low response time Hardware Timer + Interrupts enable interactive CPU sharing
Each OS generation reduced wasted CPU idle time and tightened user responsiveness.

Pause & think

Why did Simple Batch systems waste CPU cycles even when disk drives existed, and how did SPOOLing plus Multiprogramming fix that?

An OS turns raw, interrupt-driven hardware into a safe, shared, and responsive computing platform by virtualising CPU time, RAM, and I/O devices.

Worked example

Worked Example: What Actually Happens When a Program Prints a Line

A student's program calls printf("done") in a terminal. Follow the request downward.

The facts. One process, one terminal, no network. The line appears before the program exits.

  1. 1
    The library collects the characters

    printf is a library function, not a system call. It formats the text into a buffer in the process's own memory and decides when the buffer is worth sending.

📌 If you remember nothing else…

  • The OS acts as both a resource allocator and a control program (user versus system view).
  • Modern kernels are interrupt-driven, handling hardware interrupts and software traps via ISRs.
  • Multiprogramming boosts CPU utilisation; time-sharing adds timer preemption for interactive response time.

Quick check

Did it land?

1. From the System View, what are the two primary functions of an Operating System?
2. How does Multiprogramming improve upon a Simple Batch operating system?
3. What does SPOOLing (Simultaneous Peripheral Operations On-Line) achieve in operating systems?

Spotted a mistake?