Ashok G

Linux, Observed

Build it. Then watch it run. Then name the principle.

There are good guides to building Linux from source — Linux From Scratch has been the standard for decades — and there are good books on system design. What I couldn’t find was the thing in between: a build where, after every component, you stop and look at it running with the instruments the kernel already carries (ftrace, perf, bpftrace, /proc, /sys), and where each thing you see is tied to a principle that shows up again in every large system you will ever design.

That’s this series. Twelve chapters, each with three parts:

  1. Build — what gets compiled or configured in this chapter, from upstream source, and the decision that mattered.
  2. Observe — a short experiment, usually a bpftrace one-liner or an ftrace session, that shows what the new component actually does: which syscalls, which kernel paths, how long, how often.
  3. Principle — one system-design idea the observation makes concrete. Not a slogan; the specific thing the trace just showed you.

The result is a working, bootable Linux of your own: musl, a static BusyBox userland, your own init, and a kernel you configured line by line — and, more usefully, the habit of asking “what is this actually doing?” and knowing how to find out.

Background

This assumes comfort at a shell and the ability to read C. No kernel experience is needed.

What’s unique about it

Setup

You need a disposable x86-64 Linux VM, and a weekend or more of compile time. The series is pinned to Linux 7.3, while Kernel, Traced uses 6.12 LTS. Chapter 4 boots a kernel before chapter 5 builds yours, so either use a distro kernel there or do chapter 5 first.

Chapters

  1. 0Why build what you could downloadSet up your build host, write your manifest, and take the first trace: what your distro's ls actually does.Draft
  2. 1The cross-toolchainBuild binutils, gcc, kernel headers and musl for a target of your own, then trace what a compiler actually does.Draft
  3. 2A libc, and what it costsCompare static and dynamic binaries, prove musl's loader is its libc, and hijack a function with LD_PRELOAD.Draft
  4. 3Userland in one binaryBuild BusyBox as the whole of /bin, compare it with toybox, and profile a shell pipeline.Draft
  5. 4PID 1Write an init in C, boot it, make a zombie on purpose, and find out exactly what the kernel will and won't let happen to process 1.Draft
  6. 5The kernel, from allnoconfigConfigure a kernel upward from nothing, check that every option survived, boot it, and read its initcall timeline.Draft
  7. 6Booting: firmware to first promptBuild a root disk, write an initramfs that mounts it, make it fail on purpose, and draw your boot as a timeline.Draft
  8. 7Storage and the page cacheWatch the page cache absorb a read, build a read-only erofs image, protect it with dm-verity, and tamper with it.Draft
  9. 8Networking by handBring up networking with ip alone, connect two namespaces, and follow one connect() from the syscall to the device.Draft
  10. 9Namespaces and cgroupsBuild a container from kernel objects with unshare, pivot_root and cgroup2, then hit its limits on purpose.Draft
  11. 10Reproducible, or it didn't happenBuild the same thing twice, get the same hash, and find the byte that differs when you don't.Draft
  12. 11The instrument panelBring the tools onto your own system, cheapest first: ftrace, perf, bpftool, then bpftrace, and measure what looking costs.Draft
  13. ·PrinciplesThe twelve system-design principles of the series, each anchored to the trace that made it concrete.