The processor
pico-v runs RV32IMFD: the RISC-V base set, multiply and divide, floating point, machine and user mode,
interrupts. A timer, a keyboard, an 80 by 25 text screen, a pixel display and a 1 MiB disk sit at memory
addresses. Time is counted in instructions, so every run repeats exactly.
The kernel
kernel.sb, about a thousand lines of scribble, plus 114 instructions of assembly that save
and restore a program on every trap. It runs up to seven programs, each in user mode in a 128 KiB slot, and
takes the processor back from each with a timer interrupt every 16,384 instructions. Programs ask it for
everything with ecall: 28 system calls for the screen, keys, files and other programs.
The disk
hbfs: a directory of 64 files and a table chaining each file's 512-byte sectors. It lives in this browser,
so what you write is still there after a reload. cat kernel.sb shows the kernel's own source,
read off the disk by the kernel.