Pre-requirement:
- Install qemu for RISC V 64-bit or 32-bit.
- Build VIMIX (see build_instructions), make sure
PLATFORM
inMakefileArch.mk
is set toqemu
.
Run
make qemu
Or run manually:
qemu-system-riscv64 -machine virt -bios none -kernel build/kernel-vimix -m 128M -smp 4 -nographic -global virtio-mmio.force-legacy=false -drive file=build/filesystem.img,if=none,format=raw,id=x0 -device virtio-blk-device,drive=x0,bus=virtio-mmio-bus.0
Start qemu with
make qemu-gdb
qemu will wait for a debugger to attach, plain gdb
works as well as VSCode.
Note: In both cases, gdb
or VSCode
, qemu must be started manually.
In VSCode
, a launch.json
is provided with various settings:
- 32-bit vs 64-bit must be selected matching the compile target.
- Either user space applications or the kernel can be debugged, but not both at the same time (read: no stepping through a syscall into the kernel).
- Adjust the presets for user space apps that don't have one.
Launch gdb from the project directory to apply the settings from .gdbinit
. If gdb refuses to load these settings, add the full path to the gdbinit to your ~/.config/gdb/gdbinit
.
Up: README
build_instructions | debugging | run_on_qemu | run_on_spike | run_on_visionfive2 | overview_directories | architectures | kernel | user space