Closed TornaxO7 closed 1 month ago
For any other nix fans, here's a shell.nix
that works for me:
with import <nixpkgs> {};
pkgsCross.riscv64.mkShell {}
Then execute:
$ nix-shell
$ make qemu
qemu-system-riscv64 -machine virt -bios none -kernel kernel/kernel -m 128M -smp 3 -nographic -global virtio-mmio.force-legacy=false -drive file=fs.img,if=none,format=raw,id=x0 -device virtio-blk-device,drive=x0,bus=virtio-mmio-bus.0
xv6 kernel is booting
hart 2 starting
hart 1 starting
init: starting sh
$
Damn, thank you for pointing out pkgsCross
!
Hello! This PR adds a nix-shell which setups the cross-compiler and qemu which let's you start hacking immediately.