A compiler and a kernel targeting RISC-V, together.
In your terminal, use the following commands:
meson setup build
meson compile -C build
You must build the compiler first. After building the compiler, use the following command:
build/mallard-asm src/kernel/kernel.mpf
Currently, the kernel only runs with QEMU. To run the kernel, use the following command:
qemu-system-riscv64 -machine virt -bios none -smp 1 -nographic -kernel mallard-kernel.elf
To debug the kernel, use the following command:
qemu-system-riscv64 -machine virt -bios none -smp 1 -nographic -kernel mallard-kernel.elf -S -gdb tcp::1234
This will put QEMU into a stopped state while it waits for you to connect GDB.
Execute GDB using the command riscv64-unknown-elf-gdb mallard-kernel.elf
.
After executing GDB, use the following commands within GDB:
target remote 127.0.0.1:1234
layout asm
Using GDB you may now step through instructions using the si
command.