Who is in charge?
Your laptop right now is running dozens of programs: a browser, a music player, a chat app, plus background services you never see. But there is one CPU, and inside it only a handful of cores — a core is one independent instruction-runner inside the CPU chip, each able to execute exactly one stream of instructions (one fetch-decode-execute loop from lesson 1-2) at a time. A typical laptop has 4 to 10 cores and one shared pool of RAM. Dozens of programs, a handful of cores: someone has to decide who gets what.
That someone is the operating system (OS): Windows, macOS, or Linux. The OS is itself a program, but a special one that is in charge of all the others. Its core, always-resident part is called the kernel. Every operations command you will ever type — kill, top, docker — is a conversation with this manager, which is why understanding it pays off weekly, not someday.
The OS has three big jobs:
- Share the hardware: give each program turns on the CPU cores and its own slice of RAM.
- Protect programs from each other: your browser cannot read your password manager's memory.
- Provide services: files, networking, the screen, the keyboard. Programs ask the OS instead of touching hardware directly.
The three rules in practice
Here is how the OS actually does those jobs:
- Programs get hardware services only by making requests to the OS, called system calls (you will meet them properly in lesson 8-1). There is no side door: the request is the only way in.
- The OS gives each program its own private region of memory and rejects any attempt to touch anyone else's (memory protection).
- When more programs want CPU time than there are cores, the OS decides who runs now and who waits (CPU scheduling, unit 6).
If a picture helps you remember: the hardware is a hotel, programs are guests, and the OS is the manager. Guests order room service instead of cooking in the kitchen (system calls), each room key opens only that guest's own room (memory protection), and the manager schedules the crowded gym (CPU scheduling).
Everything in this course is a closer look at one of these jobs. Keep this rule: your program never touches hardware directly. It always asks the OS.
Code exercise · python
Run this toy model of memory protection, job 2 above. The OS records which addresses each process owns; the hardware checks every access against that record and blocks anything outside it. (Real machines do this check in hardware on every single memory access.)
Quiz
Which of these is NOT one of the operating system's jobs?
Quiz
You wrote a Python script that reads a file. Which statement is accurate?
Problem
The always-loaded core of the operating system, the part that owns the hardware and handles requests from programs, has a one-word name. What is it?