How tombl/distro works
This repository provides a Linux-on-WebAssembly runtime, guest-side syscall access, and distro guest components. A typical workflow boots a machine with kernel plugins and devices, runs guest code, then exposes guest process, filesystem, or network operations through the guest API. The excerpts establish kernel worker/platform relationships and guest client/transport/syscall relationships; several major subsystems are present in the tree but not sampled, so their internal links are omitted or marked unverified.
Main entry points: syscalls.ts Syscall table · worker.ts Wasm workers · client.ts Guest client · wasm.ts Wasm loading
Components 25
Kernel runtime
- Machine runner
packages/runner/src/run.ts - Wasm workers
packages/kernel/src/worker.ts - Platform adapter
packages/kernel/src/platform.ts - Wasm loading
packages/kernel/src/wasm.ts - Wasm inspection
packages/kernel/src/wasm_binary.ts - Worker endpoints
packages/kernel/src/endpoint.ts
Guest interface
- Guest ABI
packages/linux-guest/src/abi.ts - Guest transport
packages/linux-guest/src/conn.ts - Syscall table
packages/linux-guest/src/syscalls.ts - Guest client
packages/linux-guest/src/client.ts - File handles
packages/linux-guest/src/file.ts - Child processes
packages/linux-guest/src/process.ts - Guest networking
packages/linux-guest/src/network.ts - HTTP framing
packages/linux-guest/src/http.ts - Guest fetch bridge
packages/linux-guest/src/guest-fetch-handler.ts
Devices and storage
- Virtio devices
packages/kernel/src/virtio/device.ts - Virtio filesystem
packages/kernel/src/virtio/fs.ts - Virtio queues
packages/kernel/src/virtio/queue.ts - Block device
packages/kernel/src/virtio/block.ts - Virtual networking
packages/kernel/src/virtio/net.ts - Guest vsock
packages/kernel/src/virtio/vsock.ts - Disk worker
packages/runner/src/disk-worker.ts - Browser disk worker
apps/site/opfs-disk-worker.js
Linux distro
- Guest syscall agent
distro/guest-agent/agent.c - Guest init
distro/basic-init/init.c
Connections 24
- Wasm workers → Platform adapter: uses
packages/kernel/src/worker.ts - Wasm workers → Wasm loading: invokes
packages/kernel/src/worker.ts - Wasm workers → Wasm inspection: inspects
packages/kernel/src/worker.ts - Wasm workers → Worker endpoints: listens on
packages/kernel/src/worker.ts - Wasm loading → Platform adapter: loads through
packages/kernel/src/wasm.ts - Wasm loading → Wasm inspection: reads
packages/kernel/src/wasm.ts - Virtio filesystem → Virtio devices: uses
packages/kernel/src/virtio/fs.ts - Virtio filesystem → Virtio queues: uses
packages/kernel/src/virtio/fs.ts - Disk worker → Block device: configures
packages/runner/src/disk-worker.ts - Browser disk worker → Block device: configures
apps/site/opfs-disk-worker.js - Guest client → Guest transport: opens sessions
packages/linux-guest/src/client.ts - Guest client → Syscall table: invokes
packages/linux-guest/src/client.ts - Guest client → File handles: creates
packages/linux-guest/src/client.ts - Guest client → Child processes: creates
packages/linux-guest/src/client.ts - Guest transport → Guest vsock: connects via
- Syscall table → Guest transport: exchanges over
packages/linux-guest/src/syscalls.ts - Syscall table → Guest ABI: encodes with
packages/linux-guest/src/syscalls.ts - File handles → Syscall table: invokes
packages/linux-guest/src/file.ts - Child processes → Syscall table: invokes
packages/linux-guest/src/process.ts - Guest fetch bridge → HTTP framing: frames traffic
packages/linux-guest/src/guest-fetch-handler.ts - Guest fetch bridge → Guest networking: uses
packages/linux-guest/src/guest-fetch-handler.ts - Machine runner → Wasm workers: boots through
- Guest syscall agent → Syscall table: serves protocol
- Guest init → Guest syscall agent: starts