Index

Free, with Google

Keep going, free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

Start free with Google

A chalk plan

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year.

See plansStart free instead

Module 13 · From Scratch · Container Runtime · with code: Go · about 11 min to read

Play it as a journeyTutor comes with a plan

Container 04: /proc and /dev

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

The kernel’s table of processes. This stage mounts the window through which a program reads that table.

Before you start. Container 03: A Mount Namespace and pivot_root gave the box Alpine’s files and found that ps printed only its header. This stage fixes that. You need the idea of a mount from that lesson: a file system attached at a folder. The new idea is that some file systems are not stored on any disk. The kernel makes their files up on demand, so that a program can read the kernel’s state with the same cat and ls it uses for everything else. /proc is the main one (Processes, Threads & the Kernel names what it shows).

Lesson 98 of 117 in From Scratch

The rest of this lesson is part of a plan.

A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.

See plansAlready a member? Sign in

Or start free: a free account opens lessons 2 and 3 of every track.

In this lesson

  • 18 October 2026: a /dev/null nobody else could write to
  • /proc: the kernel as a folder
  • The mount table shows what you did
  • /dev: four files programs expect
  • The box has full root

Terms it explains: mount, umask, device files, major, minor, capabilities, `mountProc`, `mountDev`, `child`, The tests, Changes to try, context switch, fork/exec, init/systemd, kernel, MMU + page table, namespaces + cgroups, page (~4KB) / frame, page fault, PID, preemption, process, scheduler, segfault, swap, syscall, thread, user vs kernel mode (ring 3/0), virtual memory.

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

How many workers should a pool have, and why does the answer flip when the tasks mostly wait?

Drag Workers on shift down to the core count, then push Share of each task spent waiting to 90% and watch Finished each second.

Open The thread pool

Related papers

Review From Scratch