From 3a778fee44b5b8aeeff35ca08d93095efefa8747 Mon Sep 17 00:00:00 2001 From: Eric-Paul Ickhorn Date: Fri, 19 Jul 2024 01:51:28 +0200 Subject: [PATCH] Add scripts for running bootloader and memdumping This commit adds two scripts: One for running the bootloader using Qemu, and one for dumping the memory used by the bootloader for debugging purposes. --- i386/dump.bash | 20 ++++++++++++++++++++ i386/run.bash | 3 +++ 2 files changed, 23 insertions(+) create mode 100755 i386/dump.bash create mode 100755 i386/run.bash diff --git a/i386/dump.bash b/i386/dump.bash new file mode 100755 index 0000000..1096a47 --- /dev/null +++ b/i386/dump.bash @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +if [[ -f "memory.dump" ]]; +then + rm -f memory.dump +fi + +if [[ -f "memory.bin" ]]; +then + rm memory.bin +fi + +if [[ ! -e "qmp.socket" ]]; +then + echo "Couldn't find socket (file: 'qmp.socket')." + exit -1 +fi + +echo "dump-guest-memory memory.dump" | qmp-shell -H qmp.socket +echo "dump memory memory.bin 0 0xa0000" | gdb --core=memory.dump diff --git a/i386/run.bash b/i386/run.bash new file mode 100755 index 0000000..82f3e2b --- /dev/null +++ b/i386/run.bash @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +qemu-system-i386 nightloader.bin -qmp unix:qmp.socket,server,nowait