Skip to content

Commit 4f72d60

Browse files
committed
Update os/Makefile: Added QEMU_ARGS
1 parent e004386 commit 4f72d60

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

os/Makefile

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,21 +55,22 @@ disasm-vim: kernel
5555

5656
run: run-inner
5757

58+
QEMU_ARGS := -machine virt \
59+
-nographic \
60+
-bios $(BOOTLOADER) \
61+
-device loader,file=$(KERNEL_BIN),addr=$(KERNEL_ENTRY_PA)
62+
5863
run-inner: build
59-
@qemu-system-riscv64 \
60-
-machine virt \
61-
-nographic \
62-
-bios $(BOOTLOADER) \
63-
-device loader,file=$(KERNEL_BIN),addr=$(KERNEL_ENTRY_PA)
64+
@qemu-system-riscv64 $(QEMU_ARGS)
6465

6566
debug: build
6667
@tmux new-session -d \
67-
"qemu-system-riscv64 -machine virt -nographic -bios $(BOOTLOADER) -device loader,file=$(KERNEL_BIN),addr=$(KERNEL_ENTRY_PA) -s -S" && \
68+
"qemu-system-riscv64 $(QEMU_ARGS) -s -S" && \
6869
tmux split-window -h "riscv64-unknown-elf-gdb -ex 'file $(KERNEL_ELF)' -ex 'set arch riscv:rv64' -ex 'target remote localhost:1234'" && \
6970
tmux -2 attach-session -d
7071

7172
gdbserver: build
72-
@qemu-system-riscv64 -machine virt -nographic -bios $(BOOTLOADER) -device loader,file=$(KERNEL_BIN),addr=$(KERNEL_ENTRY_PA) -s -S
73+
@qemu-system-riscv64 $(QEMU_ARGS) -s -S
7374

7475
gdbclient:
7576
@riscv64-unknown-elf-gdb -ex 'file $(KERNEL_ELF)' -ex 'set arch riscv:rv64' -ex 'target remote localhost:1234'

0 commit comments

Comments
 (0)