Labs
In-browser labs
Decoders, walkers and visualizers that run in any browser, no Mac needed. Each one is also embedded in the chapter that uses it. A lab never replaces the native work: every checkpoint still runs on your Mac.
35 labs, each embedded in the chapter or primer that uses it.
ESR decoder
Split an ESR_EL2 syndrome into its fields, flip bits to see what changes, and see what macvmm would do with the exit.
Runs in browser
Used in chapter 07
Two-stage translation walker
Walk a guest virtual address through the guest's page tables to an IPA, then through HVF's stage 2, with each stage's granule set separately, and see the exact fault registers when a walk fails.
Runs in browser
Used in chapter 05
MMIO trap emulator
Step real guest loads and stores through chapter 07's path: the exit, the syndrome decode, the bus, the device, then PC + 4; then break it on purpose.
Runs in browser
Used in chapter 07
Virtqueue visualizer
Play the driver and the device on one split virtqueue: publish requests, ring the doorbell, walk and serve chains, reclaim them, then misbehave as the driver and watch which check refuses each hostile ring.
Runs in browser
Used in chapter 15, chapter 16
DTB explorer
Open a device tree blob, click a node to see its bytes, and watch #address-cells decide how every reg is read.
Runs in browser
Used in chapter 10
Boot timeline
See where a Linux boot's VM exits cluster and where they stop: chapter 14's real reference boot, its three deliberate breakages, or a trace file from your own run, on one zoomable time axis.
Runs in browser
Used in chapter 14
Toy VMM
Run one toy guest under eight strategies, from bare metal to hardware assist, and count who executes each instruction: the CPU or the VMM.
Runs in browser
Used in chapter 00
Trap or not
Sort ten guest actions by where they stop: in our VMM, in the macOS kernel, or nowhere at all.
Runs in browser
Used in chapter 01
Exception stepper
Pick where the code runs and what happens, take the exception, watch what the CPU saves, then return with ERET.
Runs in browser
Used in chapter 02
PSTATE builder
Build the boot value 0x3c5 from its fields, find the one bit that makes the EL1t mistake 0x3c4, and see why HVF refuses EL2 (0x3c9).
Runs in browser
Used in chapter 06
Litmus
Step two threads through a machine with visible store buffers, list every outcome arm64, x86-64 and the paper model allow, and tell a lucky zero from a guaranteed one.
Runs in browser
Used in chapter 16, the memory-ordering primer
repr(C) layout
Type a Rust struct and see where each field lands, where the padding goes, and whether it matches the C struct in the header.
Runs in browser
Used in chapter 01
A64 encoder
Build an instruction word from its labelled bit fields, or take a word apart, and watch the 32 bits and the little-endian bytes change together.
Runs in browser
Used in chapter 02
Guest address translator
Build a region table, hand the VMM a guest address and a length, and see whether it forms a host pointer, refuses, or (with a wrapping addr + len) reaches memory outside guest RAM.
Runs in browser
Used in chapter 04
System registers and SMCCC IDs
Take two 32-bit numbers apart field by field: build or decode an SMCCC function ID and see what macvmm answers, and decode an mrs or msr word (or its trap syndrome) into a register name and macvmm's policy for it.
Runs in browser
Used in chapter 08
PL011 poke
Write and read the UART's registers as the guest, type bytes as the host, and watch FR, the receive FIFO, RIS, MIS and the interrupt line change.
Runs in browser
Used in chapter 09
Timer timeline
Step through one 100 ms sleep of chapter 11's test guest with no interrupt controller: the counter and its offset, the alarm, the WFI sleep, the VTIMER exit and the three masks, on one time axis.
Runs in browser
Used in chapter 11
Interrupt lifecycle
See an interrupt as state, not a call: a level line, an edge and a latched edge played against a masked CPU, and, from chapter 12, one interrupt inside the GIC, when the source stops asking early, late or never.
Runs in browser
Used in chapter 11, chapter 12
Image inspector
Drop a kernel file, or pick one, flip a header byte, and see which of the loader's checks fails first and where everything would go in RAM.
Runs in browser
Used in chapter 13
Boot-log annotator
Paste a Linux boot log and see each line's stage, what it means, and the device-tree node and chapter behind it; a cut-off log tells you which stage never finished.
Runs in browser
Used in chapter 14
Virtio status handshake
Step through a driver bringing up a virtio-mmio device (status bits, feature negotiation, queue setup, the doorbell), then play drivers that misbehave and see what the device refuses.
Runs in browser
Used in chapter 15
virtio-blk request
Build a disk request descriptor by descriptor, see its header bytes, and watch which of the device's checks fires, what reaches the disk and which status byte comes back.
Runs in browser
Used in chapter 18
Frame dissector
Split one virtio-net buffer into its 12-byte header, Ethernet, ARP or IPv4 and ICMP fields, then see what macvmm's device and the receiving guest do with it.
Runs in browser
Used in chapter 19
SMP boot timeline
Step through how a secondary CPU starts: the boot CPU calls CPU_ON, the VMM fills a mailbox, the parked thread wakes and enters the guest with the context in x0; then break the MPIDR and watch the three lookups disagree.
Runs in browser
Used in chapter 20
Boot chain
Step through direct boot and firmware boot side by side: who loads what, where, what is in x0 and x1, whether boot services are alive, and who owns the DTB at each step.
Runs in browser
Used in chapter 21, the uefi primer
vmapple map
Browse the vmapple board's memory map and device inventory, each row cited and tagged observed, inferred or unknown, and switch evidence off to see which claims rest on it.
Runs in browser
Used in chapter 24
Hostile-ring fuzzer
Patch one of chapter 25's planted bugs into chapter 16's queue code, let a seeded fuzzer invent hostile descriptor rings, and see which invariant catches the first failing input.
Runs in browser
Used in chapter 25
System call stepper
Single-step an app's svc from user mode into the kernel and back, then compare it with a page fault, predicting which of mode, PC, saved return address and reason change at each step.
Runs in browser
Used in chapter 00, the os-basics primer
Linker map
Move sections, change the start address and the stack, and watch the symbol addresses, the program headers (filesz versus memsz) and the exact bytes of the flat binary change together.
Runs in browser
Used in chapter 03, the bare-metal-rust primer
Cache views
Write guest RAM from the VMM or an MMU-off guest, then clean or invalidate cache lines and see who reads stale data and which operation can lose a write.
Runs in browser
Used in chapter 13, the caches primer
Lock order
Be the scheduler for two threads and their locks: step them into a deadlock, see the cycle, fix the order, then make a condvar lose its wake-up.
Runs in browser
Used in chapter 09, the host-concurrency primer
ANSI filter
A guest can print bytes that make your terminal change its title, write your clipboard or type for you, so macvmm filters them. Type the bytes a guest prints and see three views side by side: what a terminal would do with them, what macvmm's safe policy lets through (and the rule behind every removal), and what strict writes to a log.
Runs in browser
Used in chapter 09, the tty-termios primer
ELF inspector
Decode an ELF file's header and program headers byte by byte, see what a loader copies into guest RAM, and find which check catches a broken byte.
Runs in browser
Used in chapter 13, the elf primer
cpio inspector
Drop an initramfs (or pick a sample) and walk it the way Linux does: every member, every newc header field and padding byte, which later entries overwrite earlier ones, the boot-log lines that follow, and what a host cpio tool shows instead.
Runs in browser
Used in chapter 13, the cpio-initramfs primer
Durability ladder
Follow one guest fsync() through the guest page cache, the VMM, the host page cache, the drive's cache and flash, choose how the VMM answers FLUSH, then kill the process or cut the power and see what the guest's journal finds.
Runs in browser
Used in chapter 18, the block-storage primer
Planned with later chapters
These labs belong to chapters that are not written yet.