DSA, Database System & Operating System β Operating System and Process Management, NEC licence examination syllabus (Nepal Engineering Council).
Evolution of Operating Systems
From no OS at all to virtualised clouds β each generation solved the previous one's worst bottleneck.
π Where this lives: this history is not decoration β every stage left a fossil you still use. JCL-style batch thinking survives in cron jobs and CI pipelines. Time-sharing gave us the terminal and SSH. The distinction between "the program" and "the machine" that virtual memory introduced is why a container can pretend to own a whole OS. And serverless computing is batch processing with better marketing: submit a job, it runs somewhere, you get output. Search "history of operating systems Multics Unix" β Unix was written partly as a reaction to Multics being too ambitious, and that tension between capability and simplicity has never stopped.
The generations
GENERATION 0 β NO OPERATING SYSTEM (1940sβearly 1950s)
Β· the programmer WAS the operator: load the program by
switches or plugboard, run it, read the lights
Β· one user at a time, exclusive use of the machine
Β· SETUP TIME dominated: mounting tapes, loading the compiler,
loading the program, could take longer than the run
PROBLEM: the CPU sat idle between jobs.
GENERATION 1 β BATCH SYSTEMS (mid 1950s)
Β· a human operator collects jobs onto a tape, the machine
runs them one after another without intervention
Β· the RESIDENT MONITOR is the first thing resembling an OS:
a small program that stays in memory and loads the next job
Β· job control language (JCL) describes what to run
PROBLEM: still one job at a time, so the CPU idles during
every I/O operation.
GENERATION 2 β MULTIPROGRAMMED BATCH (1960s)
Β· several jobs held in memory at once
Β· when the running job blocks on I/O, the CPU switches to
another job
Β· REQUIRES: memory protection (one job must not corrupt
another) and CPU scheduling
This is the first true operating system in the modern sense.
PROBLEM: no interactivity β you still submit and wait.
GENERATION 3 β TIME SHARING (1960sβ70s)
Β· the CPU is switched between users so rapidly that each
believes they have the machine
Β· needs a TIMER INTERRUPT to force switches, so no process
can monopolise the CPU
Β· brings the terminal, the interactive shell, file systems
with per-user permissions
Β· CTSS, Multics, then UNIX (1969)
PROBLEM: response time degrades as users are added.
GENERATION 4 β PERSONAL COMPUTERS (1980s)
Β· one user, one machine β so the early PC OSes DROPPED
protection and multitasking as unnecessary
Β· MS-DOS had no memory protection at all; any program could
overwrite the OS
Β· the GUI (Xerox PARC β Macintosh β Windows) becomes the
interface
Note the regression: DOS was in some ways less advanced than
1960s mainframe OSes. Capability returned in the 1990s
(Windows NT, Linux) once PCs were powerful enough.
GENERATION 5 β DISTRIBUTED, MOBILE, VIRTUALISED (1990sβnow)
Β· networked systems: NFS, client-server, then the web
Β· REAL-TIME systems for control applications
Β· MOBILE: iOS/Android, where battery and background limits
are first-class concerns
Β· VIRTUALISATION: a hypervisor runs many OSes on one machine
Β· CONTAINERS: many isolated userlands on one kernel
Β· CLOUD/SERVERLESS: the machine becomes invisible
THE RECURRING PATTERN: each generation added a layer of
INDIRECTION to solve a resource problem β
batch β indirection between user and machine
multiprogramming β indirection between job and CPU
virtual memory β indirection between program and RAM
virtualisation β indirection between OS and hardware
containers β indirection between app and OS
The metrics that drove each change
Every generation optimised a different measure, and the shift
in what was being measured is the clearest way to see why the
designs changed.
BATCH maximise THROUGHPUT (jobs per hour)
nobody is waiting, so response time is
irrelevant
MULTIPROGRAMMING maximise CPU UTILISATION
keep the expensive CPU busy during I/O
TIME SHARING minimise RESPONSE TIME
a human is waiting at a terminal
REAL TIME guarantee a DEADLINE
being late is being wrong
MOBILE minimise ENERGY per task
the battery is the scarce resource
CLOUD minimise COST per request
hardware is rented by the second
CPU UTILISATION WITH MULTIPROGRAMMING β the calculation that
justified the whole generation.
If a process spends fraction p of its time waiting for I/O,
and n processes are in memory, then the probability that ALL n
are waiting simultaneously is pβΏ. So
CPU utilisation = 1 β pβΏ
With p = 0.8 (a typical I/O-bound job):
n = 1 β 1 β 0.8 = 20%
n = 2 β 1 β 0.64 = 36%
n = 3 β 1 β 0.512 = 49%
n = 4 β 1 β 0.410 = 59%
n = 5 β 1 β 0.328 = 67%
n = 10 β 1 β 0.107 = 89%
Going from 1 to 4 processes triples utilisation. That is the
entire economic argument for multiprogramming, and on a
machine costing millions of dollars it was decisive.
DIMINISHING RETURNS: from n=5 to n=10 gains only 22 more
points, and each extra process costs memory. The model also
assumes independence, which is optimistic β real processes
contend for the same disk.
The 1 β pβΏ model is worth remembering because it is the same shape as every resource-pooling argument you will meet: connection pools, thread pools, and cloud autoscaling all rely on the fact that independent consumers rarely peak together. It is also why the model's independence assumption is the first thing to question β correlated demand (everyone hitting the database at 9 a.m.) breaks it completely.
What an operating system actually is
Two complementary definitions, and exams ask for both.
AS A RESOURCE MANAGER
the OS arbitrates access to hardware among competing
processes: CPU time, memory, disk, network, devices. It
decides who gets what, when, and for how long.
AS AN EXTENDED MACHINE (abstraction provider)
the OS hides ugly hardware behind clean abstractions:
raw disk sectors β files and directories
physical RAM β virtual address spaces
one CPU β many processes
a network card β sockets
interrupt handlers β signals and events
Nobody writes disk-sector arithmetic to save a document. The
abstraction IS the product.
WHERE THE OS SITS:
ββββββββββββββββββββββββββββββββββ
β applications (user mode) β
ββββββββββββββββββββββββββββββββββ€
β system call interface β β the boundary
ββββββββββββββββββββββββββββββββββ€
β operating system (kernel mode)β
ββββββββββββββββββββββββββββββββββ€
β hardware β
ββββββββββββββββββββββββββββββββββ
DUAL-MODE OPERATION is what makes protection possible:
USER MODE restricted; privileged instructions trap
KERNEL MODE full access to hardware
A mode bit in the CPU records which one is active. A system
call switches to kernel mode through a controlled entry
point, so an application can request a privileged operation
without being able to perform one directly.
Without dual mode there is no protection β which is exactly
why MS-DOS had none, and why any DOS program could crash the
whole machine.
π Go further: the generations did not end, and the current one inverts an old assumption. Unikernels compile the application and just enough OS into a single bootable image β no processes, no user/kernel split, because the machine runs exactly one program (back to Generation 0, deliberately). Meanwhile eBPF lets you run sandboxed programs inside the Linux kernel without writing kernel code, blurring the user/kernel boundary the whole model rests on. Search "unikernel vs container" and "eBPF what it is".
π‘ Exam angle: list the generations in order with the problem each solved β serial processing wasted CPU on setup, batch wasted it on I/O, multiprogramming fixed that but had no interactivity, time sharing added it. Know that multiprogramming requires memory protection and scheduling. The CPU utilisation = 1 β pβΏ formula is a common numerical: compute it for given p and n and comment on diminishing returns. Give both definitions of an OS (resource manager and extended machine) and explain dual-mode operation as the basis of protection.
Syllabus points
Historical evolution of OS
Create a free account to tick topics off, take notes as you read, watch the video lessons and get a day-by-day study plan built around your exam date.
Related topics in Operating System and Process Management