Skip to content

ya7on/mb8

Repository files navigation

MicroBot-8bit

GitHub License codecov Docs Ask DeepWiki GitHub top language GitHub code size in bytes

MicroBot-8bit is an 8-bit microcomputer in the vein of the ZX Spectrum/Commodore 64, originally inspired by CHIP-8. It comes with a tiny CP/M-like OS layer, a GPU TTY, keyboard input, and a disk-backed filesystem stub.

sh.bin

Running

Compile assembly

We use customasm to build all assembly sources.

Install once:

cargo install customasm

Build everything (kernel, user-space programs, tests):

make all

Targets:

  • make kernel — build the kernel image (kernel/main.bin)
  • make user — build user-space programs under user/
  • make tests — build assembly tests under kernel/tests

Run VM

After building, run the VM with the kernel entrypoint first and then any user programs:

cargo run -- run ./kernel/main.bin ./user/sh.bin ./user/hw.bin ./user/ls.bin ./user/exit.bin ./user/help.bin

The first path is always the kernel; subsequent arguments are user-space binaries loaded by the OS.

Assembly

User-space programs live under user/. For a minimal shell example, see user/sh.asm; build with make user and run with the kernel:

cargo run -- run ./kernel/main.bin ./user/sh.bin ./user/hw.bin ./user/ls.bin ./user/exit.bin ./user/help.bin

Architecture

Full documentation can be found in the book.