From 3152b2ae078f83145774d2dbfaf6f471b8b766e8 Mon Sep 17 00:00:00 2001 From: Freya Murphy <freya@freyacat.org> Date: Tue, 25 Mar 2025 18:00:51 -0400 Subject: [PATCH] more qemu opts and gdb --- Makefile | 15 +++++++++++++-- util/{gdbinit.tmpl => gdbinit} | 4 ++-- 2 files changed, 15 insertions(+), 4 deletions(-) rename util/{gdbinit.tmpl => gdbinit} (92%) diff --git a/Makefile b/Makefile index 27f2133..4f4fef9 100644 --- a/Makefile +++ b/Makefile @@ -3,11 +3,22 @@ .SILENT: QEMU = qemu-system-i386 -QEMUOPTS = -drive file=bin/disk.img,index=0,media=disk,format=raw +QEMUOPTS = -drive file=bin/disk.img,index=0,media=disk,format=raw \ + -no-reboot -d cpu_reset \ + -serial mon:stdio \ + -m 4G \ + -display sdl \ + -enable-kvm \ + -name kern qemu: bin/disk.img - $(QEMU) -serial mon:stdio $(QEMUOPTS) + $(QEMU) $(QEMUOPTS) +qemu-gdb: bin/disk.img + $(QEMU) $(QEMUOPTS) -S -gdb tcp::1337 + +gdb: + gdb -q -n -x util/gdbinit clean: rm -fr .zig-cache diff --git a/util/gdbinit.tmpl b/util/gdbinit similarity index 92% rename from util/gdbinit.tmpl rename to util/gdbinit index d9a981d..ca2c885 100644 --- a/util/gdbinit.tmpl +++ b/util/gdbinit @@ -20,8 +20,8 @@ define hook-stop set $lastcs = $cs end -echo + target remote localhost:1234\n -target remote localhost:1234 +echo + target remote localhost:1337\n +target remote localhost:1337 # If this fails, it's probably because your GDB doesn't support ELF. # Look at the tools page at