The classic types of operating system look like a random list to memorize — but they're really five answers to a single question: *how should the CPU's time be shared?* Each type was invented to fix a specific waste or need left by the one before it. Read them as a story, not a list.
From one job at a time to many at once
1Batch — jobs are queued and run *one after another* with no interaction. You hand in a job, it runs to completion, you collect the output later. Simple, but the CPU sits idle every time a job waits on slow I/O.
2Multiprogramming — keep *several* jobs in memory at once. The moment the running job blocks on I/O, the OS switches the CPU to another ready job. The CPU stops idling — but jobs still aren't interactive.
3Time-sharing — give each user or process a tiny slice of CPU time (a quantum) in rapid rotation. Switching is so fast that every user *feels* alone on the machine. This is what made interactive terminals (and modern desktops) possible.
4Real-time — correctness depends on *meeting deadlines*, not just on producing the right answer. A late result counts as wrong. Used where timing is safety-critical, like anti-lock brakes or a pacemaker.
5Distributed — spread the work across *many networked machines* (nodes) that cooperate so they appear to users as one system. Scales beyond a single box and survives one machine failing.
The thread through all of them
Batch wastes the CPU on every I/O wait. Multiprogramming fills those gaps. Time-sharing slices the gaps so finely it feels interactive. Real-time adds deadline guarantees; distributed adds more machines. Each type removes a limitation of the last.
Note these aren't mutually exclusive products. A modern Linux desktop is fundamentally a time-sharing system that also does multiprogramming, can be tuned for soft real-time work, and is routinely wired into distributed clusters. The categories describe *design goals*, not separate boxes.
Hard vs soft real-time
Hard real-time *must* never miss a deadline — a missed brake command is catastrophic. Soft real-time merely degrades when deadlines slip (a dropped video frame). A general-purpose OS like stock Linux gives soft, not hard, guarantees.
OperationTimeSpace
Batch · CPU idles on I/O waitsone job at a time—
Multiprogramming · fills the idle gapsswitch on I/O block—