target := "riscv64gc-unknown-none-elf" mode := "debug" build-path := "../../target/" + target + "/" + mode + "/" m-firmware-file := build-path + "rustsbi-qemu" m-bin-file := build-path + "rustsbi-qemu.bin" objdump := "riscv64-unknown-elf-objdump" objcopy := "rust-objcopy --binary-architecture=riscv64" gdb := "riscv64-unknown-elf-gdb" threads := "1" build: firmware @{{objcopy}} {{m-firmware-file}} --strip-all -O binary {{m-bin-file}} firmware: @cargo build --target={{target}} qemu: build @qemu-system-riscv64 \ -machine virt \ -nographic \ -bios none \ -device loader,file={{m-bin-file}},addr=0x80000000 \ -smp threads={{threads}} run: build qemu asm: build @{{objdump}} -D {{m-firmware-file}} | less debug: build @qemu-system-riscv64 \ -machine virt \ -nographic \ -bios none \ -device loader,file={{m-bin-file}},addr=0x80000000 \ -smp threads={{threads}} \ -gdb tcp::1234 -S gdb: @{{gdb}} --eval-command="file {{m-firmware-file}}" --eval-command="target remote localhost:1234"