Boot, a RISC-V computer · Malte Therkildsen

Boot

A RISC-V computer in the page

P34

Boot

Kind
Prototype in the Lab, 2026
What I built
Processor, machine, device tree, terminal, test page, inspector
Open the computer

Linux from its first instruction

Boot is a RISC-V computer I wrote in plain JavaScript, with no dependencies. It starts Linux 6.8 in the page from the first instruction, and the shell is ready after about 38.5 million instructions.

The processor

The processor runs RV32IMA: the base integer instructions, multiply and divide, and atomics. It runs in a Web Worker, so the page keeps responding while Linux starts. Each instruction is fetched from RAM, decoded with shifts and masks and executed in one loop over typed arrays, which allocates no memory per instruction.

The machine around it

Around the processor is a small machine: 64 MiB of RAM, a 16550 serial port for the terminal, a timer, and a register that powers off and restarts. Boot writes a device tree that describes this machine to Linux, and 5 instructions of firmware put its address in a register and jump to the kernel.

What it does not have

Boot has no memory management unit, so it runs a Linux kernel built without memory protection. It has no disk and no network. 3 of the riscv-tests need hardware Boot does not have, and the test page names that hardware.

  1. Firmware
  2. Kernel
  3. Init
  4. Shell

Linux starts when the computer comes into view.

Try

0 instructions

The computer, running in this page
Firmware

0instructions

About 38.5 million instructions from power on to the shell
  1. 83ffe00000000513li a0, 0x0
  2. 83ffe00483fff5b7lui a1, 0x83fff
  3. 83ffe00800058593mv a1, a1
  4. 83ffe00c800002b7lui t0, 0x80000
  5. 83ffe01000028067jr t0
(The firmware, all of it)
Boot at the shell on a phone, after ls / and free
The same computer on a 390 px screen, with the keys a phone keyboard does not have
The inspector, paused in the kernel after 81 million instructions, with registers and the instruction mix
The inspector, paused inside the kernel

800002b7lui t0, 0x80000

Each instruction is decoded with shifts and masks

40.0 % alu

of 81,015,461 instructions the kernel ran in the inspector

    Boot

    1234567 = 127 × 9721

    factor 1234567, divided on the M extension
    Boot against riscv-tests: every test passes

    75 of 75

    riscv-tests pass, in 26,995 instructions

    (3 more need hardware Boot does not have)

    Time on this computer is counted in instructions. The timer moves one tick for every 100 instructions, so Boot is a 100 MHz processor with a 1 MHz timer.