xv6-riscv ported to the Zig build system
- Zig
- QEMU (riscv64)
- GDB (riscv64 or multiarch; for debugging)
$ apt-get install qemu-system-misc gdb-multiarch$ brew install qemu riscv64-elf-gdb$ zig build
$ ls zig-out/bin
_cat _forktest _grind _ln _mkdir _stressfs _zombie
_dorphan _forphan _init _logstress _rm _usertests kernel
_echo _grep _kill _ls _sh _wc mkfs$ zig build qemu
*** Loading ./.zig-cache/o/66e5103f4307166ed7059e40ee48255a/fs.img
xv6 kernel is booting
hart 2 starting
hart 1 starting
init: starting sh
$ usertests -q
usertests starting
test copyin: OK
test copyout: OK
test copyinstr1: OK
...$ zig build qemu-gdb
*** Now run 'zig build gdb' in another window.$ zig build gdb$ zig build gdb -Dgdb=riscv64-elf-gdbMIT
- (2025) Sped0n/zv6: Zig reimplementation of xv6-riscv's kernel
- Uses hardcoded paths to
zig-out
- Uses hardcoded paths to
- (2024) pYtato-KK/xv6-riscv-zig: xv6-riscv ported to the Zig build system
- Installs a copy of
fs.imginzig-outbut uses a different copy in.zig-cachewhen running QEMU
- Installs a copy of
- (2024) aryalaadi/zinit-xv6-riscv: Zig reimplementation of xv6-riscv's init system
- Not really idiomatic Zig
- (2023) binarycraft007/xv6-riscv-zig: partial Zig reimplementation of xv6-riscv
- Uses custom build steps (in Zig) instead of standalone programs for generating
fs.imgandusys.S
- Uses custom build steps (in Zig) instead of standalone programs for generating
- (2023) candrewlee14/xv6-riscv-zig: partial Zig reimplementation of xv6-riscv
- Based on
binarycraft007/xv6-riscv-zig
- Based on
- (2022) chaoyangnz/rvz: incomplete Zig reimplementation of xv6-riscv
- Only implements drivers for clock and UART
- (2022) saza-ku/xv6-zig: Zig reimplementation of xv6-x86's kernel
- xv6-x86 is old and unmaintained