Kodokon kodokon.com

Computer, program, operating system: who does what

Understand what a machine really is, what a program is, and what the operating system is actually for.

6 min · 3 questions

Open this lesson in Kodokon

A computer, a phone, a tablet: they are all machines doing the very same thing, running extremely simple instructions, but at incredible speed. Inside, three parts matter to us. The processor is the worker: it calculates, compares and moves data around, billions of times per second. The memory, usually called RAM, is its worktop: it keeps whatever the processor is using right now within arm's reach. Storage (a hard drive or an SSD) is the cupboard: it holds on to your files even when the machine is switched off.

The difference between memory and storage is what trips up beginners the most. Picture a kitchen: the worktop is big, but it gets cleared completely at the end of service, while the cupboards keep everything from one day to the next. Memory works the same way: it is fast, but it empties completely when the machine shuts down. Storage is slower, but it remembers. That is why an unsaved document vanishes in a power cut: it only ever existed on the worktop.

A program is a list of instructions written in advance, which the machine runs in order. Exactly like a cooking recipe: each step is dumb on its own, but the sequence produces a result. Programming is simply writing that recipe in a language the machine knows how to follow. Nothing magical about it: you break a task down into steps small enough that none of them is ambiguous.

TEXT
Program "make a coffee":
  1. Fill the water tank
  2. Put a capsule in the machine
  3. Place a cup under the spout
  4. Press the button
  5. Wait 30 seconds
  6. Take the cup away
A program is a sequence of precise steps, in a precise order.

One question is left: who decides which program runs, who keeps your files in order, who stops two applications from trampling on each other? That is the operating system, usually shortened to OS. It is the conductor of the orchestra. On computers, the big three are Windows, macOS (Apple's Macs) and Linux. On phones, they are Android and iOS. Your programs never speak to the hardware directly: they always go through the system.

TEXT
You
  |
Applications      (browser, game, code editor)
  |
System            (Windows, macOS, Linux)
  |
Hardware          (processor, memory, storage)
Each layer rests on the one below it; you act at the very top.

Knowledge check

Make sure you remember the key points of this lesson.

  1. What happens to the contents of memory when the machine shuts down?
    • They are wiped
    • They are saved to the disk automatically
    • They are sent over the internet
    • They stay intact for 24 hours
  2. What is a program?
    • A list of instructions the machine runs in order
    • An electronic component sitting inside the computer
    • A file that contains nothing but images
  3. What is the operating system for?
    • Connecting applications to the hardware
    • Displaying web pages
    • Making the processor faster