From 9abd69032362d5340fc48a260228b73b3e7cbe46 Mon Sep 17 00:00:00 2001 From: Yifan Wu Date: Sun, 30 Apr 2023 01:02:04 +0800 Subject: [PATCH] Update os/Makefile: Added QEMU_ARGS --- os/Makefile | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/os/Makefile b/os/Makefile index b0c1fc74..9815cee4 100644 --- a/os/Makefile +++ b/os/Makefile @@ -67,24 +67,25 @@ disasm-vim: kernel run: run-inner +QEMU_ARGS := -machine virt \ + -nographic \ + -bios $(BOOTLOADER) \ + -device loader,file=$(KERNEL_BIN),addr=$(KERNEL_ENTRY_PA) \ + -drive file=$(FS_IMG),if=none,format=raw,id=x0 \ + -device virtio-blk-device,drive=x0,bus=virtio-mmio-bus.0 + run-inner: build - @qemu-system-riscv64 \ - -machine virt \ - -nographic \ - -bios $(BOOTLOADER) \ - -device loader,file=$(KERNEL_BIN),addr=$(KERNEL_ENTRY_PA) \ - -drive file=$(FS_IMG),if=none,format=raw,id=x0 \ - -device virtio-blk-device,drive=x0,bus=virtio-mmio-bus.0 + @qemu-system-riscv64 $(QEMU_ARGS) debug: build @tmux new-session -d \ - "qemu-system-riscv64 -machine virt -nographic -bios $(BOOTLOADER) -device loader,file=$(KERNEL_BIN),addr=$(KERNEL_ENTRY_PA) -s -S" && \ + "qemu-system-riscv64 $(QEMU_ARGS) -s -S" && \ tmux split-window -h "riscv64-unknown-elf-gdb -ex 'file $(KERNEL_ELF)' -ex 'set arch riscv:rv64' -ex 'target remote localhost:1234'" && \ tmux -2 attach-session -d gdbserver: build - @qemu-system-riscv64 -machine virt -nographic -bios $(BOOTLOADER) -device loader,file=$(KERNEL_BIN),addr=$(KERNEL_ENTRY_PA) -s -S + @qemu-system-riscv64 $(QEMU_ARGS) -s -S gdbclient: @riscv64-unknown-elf-gdb -ex 'file $(KERNEL_ELF)' -ex 'set arch riscv:rv64' -ex 'target remote localhost:1234'