Index

Module 05 · How Computers WorkBuild the machine's software

The program that starts programs

Processes Threads and the Kernel
Processes Threads and the Kernel · Open board

The kernel handing each program its own walled-off memory and its own turn on the chip. This lesson builds the ordinary program that asks the kernel for those walls, one command at a time: the shell.

Before you start. A process is one running program, walled off so nothing else can touch its memory. The kernel is the one program that can make new ones (Processes, Threads & the Kernel). Picture each process with numbered doors: when it opens a file, the kernel hands it a number, and the program reads and writes through that door. The numbers are file descriptors (I/O, Interrupts & the Bus). Part one of this build made a small machine that runs instructions (Build a stack machine). This part builds the program that starts other programs.

Continue reading with a plan

The first three lessons of every track are free. This lesson is included with a plan, which unlocks every lesson, board, video, lab and paper for one price.

View plans →Already a member? Sign in

Lab

The program needs twelve pages at once. What happens when it gets eleven frames?

Drag Frames of real memory from 24 down to 11, then back to 12, and watch Time spent working.

Open The working set →

Three long jobs are running when you press a key. How long until the keypress gets the CPU?

Click Take turns, drag How long one turn lasts from 100 ms down to 1 ms, and watch The keypress waits.

Open The time slice →

Related paper

Review How Computers Work →

Saved in this browser, and to your account when you sign in.