From 716cca1b4e9dd4ba77bcfe77a5cfe520c5f6b016 Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Sun, 24 Aug 2025 18:40:01 +0200 Subject: [PATCH 1/3] Enable UEFI by default on x86_64 It boots faster and more reliable than SeaBIOS. And in practice you are unlikely to use BIOS on real hardware if you have an x86_64 capable CPU anyway. --- mk/qemu.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk/qemu.mk b/mk/qemu.mk index 202aca16..62db45e8 100644 --- a/mk/qemu.mk +++ b/mk/qemu.mk @@ -22,6 +22,7 @@ ifeq ($(ARCH),i686) endif else ifeq ($(ARCH),x86_64) gpu?=vga + uefi?=yes VGA_SUPPORTED=yes QEMU_ARCH=x86_64 QEMU_MACHINE?=q35 @@ -90,7 +91,6 @@ else ifeq ($(ARCH),aarch64) endif else ifeq ($(ARCH),riscv64gc) live=no - efi=yes audio=no gpu?=ramfb net=bridge From 16e98e3f28bb6995eddc976515b46f077e5ac4ab Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Sun, 24 Aug 2025 18:56:39 +0200 Subject: [PATCH 2/3] Add a make qemu mode to allow attaching gdb without waiting for it This way you can unconditionally enable this mode during development without being forced to attach a debugger every time you start a VM. --- mk/qemu.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mk/qemu.mk b/mk/qemu.mk index 62db45e8..b9740e61 100644 --- a/mk/qemu.mk +++ b/mk/qemu.mk @@ -272,6 +272,9 @@ endif ifeq ($(gdb),yes) QEMUFLAGS+=-d cpu_reset -s -S +else ifeq ($(gdb),nonblock) + # Allow attaching gdb, but don't block for it + QEMUFLAGS+=-d cpu_reset -s endif ifeq ($(UNAME),Linux) From 4f2efe1c56e85202d9371a91294c8fbbe94e4e9f Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Sun, 24 Aug 2025 19:05:28 +0200 Subject: [PATCH 3/3] Simplify gdb-userspace Turns out gdb already handles locating the .text section when you don't specify the offset. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 43dd5c14..cda1b210 100644 --- a/Makefile +++ b/Makefile @@ -101,7 +101,7 @@ gdb: FORCE # has started or you need to debug the interaction between the application and the kernel. # tl;dr: DO NOT USE THIS TARGET UNLESS YOU HAVE TO gdb-userspace: FORCE - rust-gdb $(GDB_APP_FILE) --eval-command="add-symbol-file $(GDB_KERNEL_FILE) 0x$(shell readelf -S $(GDB_KERNEL_FILE) | grep .text | cut -c43-58)" --eval-command="target remote :1234" + rust-gdb $(GDB_APP_FILE) --eval-command="add-symbol-file $(GDB_KERNEL_FILE)" --eval-command="target remote :1234" # An empty target FORCE: