ccc

RV32 in your browser

the same Zig core as ./ccc — compiled to wasm32-freestanding
(click the terminal to play)
shell: type a command and press Enter · try ls /bin · cat /etc/motd · echo hi > /tmp/x · edit /etc/motd · ^C cancel · exit to halt
editor: arrow keys move · printable keys insert at cursor · Backspace delete · ^S save · ^X exit — note: use Ctrl (not Cmd on macOS, which the browser keeps for itself).
what's running: a from-scratch RV32 kernel (M-mode boot shim → S-mode kernel → cooked-mode console → fork/exec → on-disk shell + utilities) booted from shell-fs.img — the same binary that runs on the CLI via zig build kernel-fs.
how it works: shell execution walkthrough — keystroke → UART RX → PLIC → S-trap → cooked console → fork/exec → /bin/* → UART TX → ANSI render
⚠ requires a physical keyboard — desktop or laptop only. Mobile and tablet devices can't drive per-byte input.
snake controls: W A S D move · Space start · Q quit
how it works: snake execution walkthrough — bare-metal M-mode boot, CLINT timer trap, UART I/O
⚠ requires a physical keyboard — please play on a desktop or laptop. Mobile and tablet devices can't send key input.

      
    

This page fetched ccc.wasm (~50 KB of WebAssembly — just the emulator core), then fetches the selected RISC-V program (hello.elf, snake.elf, ...) on demand. The worker copies the ELF bytes into wasm linear memory and runs the emulator in chunks via runStart() / runStep(). UART output is captured into a buffer inside wasm linear memory; the worker copies it out via outputPtr() and consumeOutput() and posts it to this page for ANSI rendering. Drop a new .elf next to this page to add a program — no recompile.