The instrument, documented

Colophon

What this is, how it runs, and what it keeps. Plain facts, no register change - the same story the binary tells, written down.

What thunk is

From true zero to DOOM on a panel. You build the kernel, the driver, and the bus, then watch real hardware come up. Nothing leaves this machine.

thunk (n.) - a piece of code set aside to run later, not thrown away.

The four ways to run it

The course has to work on whatever machine a learner actually has - which usually means no hardware, and sometimes no permission to install anything. Every rung runs the same course from the same binary. Nothing here is a demo build.

  1. BROWSER

    This site. No install at all.

    The whole curriculum runs here, and the bench runs the real simulator compiled to WebAssembly, driving a virtual panel from the same bus events the binary produces. The zero-friction way in. Open the bench.

  2. BINARY

    The simulator, in-process.

    The thunk binary simulates the SPI bus, the panel, and the boot sequence deterministically - the terminal classroom, the checks, the annotated trace. The same binary emits the offline web build (thunk web): plain HTML, zero external URLs, for a machine that can install nothing and may phone nothing out.

    cargo run -p thunk-cli -- tui
  3. QEMU

    Same binary, a real kernel, no hardware.

    Boot a real Linux kernel in an emulated machine where the static thunk binary is the only userspace. PID 1 is a five-line init; the course runs, prints its bus trace over the serial console, and powers the machine off. No KVM required, so it runs anywhere QEMU installs.

    ./scripts/qemu-smoke.sh
  4. HARDWARE

    A real panel, on the open build.

    The open profile (--features open) adds thunk hw, which drives the same finale on a physical ILI9341-class panel over /dev/spidev and GPIO, with the same driver code the simulator runs. A BeaglePlay or similar board and about eight wires.

    cargo run -p thunk-cli --features open -- hw \
        --spidev /dev/spidev0.0 --dc-chip /dev/gpiochip2 --dc-line 10

The stack

SITE
SvelteKit, adapter-static: a fully prerendered SPA with no server runtime. Client-side navigation, view transitions, fonts self-hosted. Nothing is fetched from anywhere at runtime.
CONTENT
Every lesson and check is compiled from the Rust thunk-content crate and exported to JSON at build time - the same content the terminal classroom and the offline bundle render, only serialized. CI proves it never drifts from the curriculum.
BENCH
The bench is thunk-sim compiled to WebAssembly, driving a 240x320 canvas over the simulated SPI bus. The trace crosses into JavaScript as flat typed arrays; the panel is putImageData from RGB565 converted in Rust.
DOOM
The finale can hand the panel to DOOM: doomgeneric plus Freedoom, compiled into the same WASM harness and fed over the same bus, with the trace live underneath. The GPL-2.0 source and the licenses are served with the site: doomgeneric source (tar.gz), the GPL-2.0 text, and Freedoom's BSD license.

Privacy

No accounts. No telemetry. No analytics. Nothing you do here is sent anywhere. Your progress - XP, levels, achievements, the furthest lesson you opened - lives in this browser's localStorage under the key thunk.xp.v1, and nowhere else. Clearing the browser clears it, so the Operator card can export the whole record to a JSON file and import it back. That is the only copy that ever leaves the browser, and only when you ask for it.

Provenance

This build was cut from a known commit and a green test suite:

BUILD 5d67691 183 TESTS GREEN AIR-GAPPED

Licensed MIT / Apache-2.0. The course is the same three renderers over one content source: the terminal binary, the offline bundle, and this site. Back to the front door.