summaryrefslogtreecommitdiff
path: root/debug.sh
diff options
context:
space:
mode:
Diffstat (limited to 'debug.sh')
-rwxr-xr-xdebug.sh21
1 files changed, 18 insertions, 3 deletions
diff --git a/debug.sh b/debug.sh
index 988fb5c..00f043d 100755
--- a/debug.sh
+++ b/debug.sh
@@ -4,11 +4,26 @@ make -C kc/core &&
make -C kc/boot &&
make -C loader &&
-./image.sh &&
+BOOT_DIR=EFI/BOOT
+BOOT_FILE=BOOTX64.EFI
+SYS_DIR=adasoft/sophia
+
+LOADER_FILE=loader/loader.efi
+
+SHIM_FILE=kc/boot/efi.os
+KERNEL_FILE=kc/core/kernel.os
+
+tempdir=$(mktemp -d)
+
+mkdir -p ${tempdir}/${BOOT_DIR} ${tempdir}/${SYS_DIR} &&
+cp ${LOADER_FILE} ${tempdir}/${BOOT_DIR}/${BOOT_FILE} &&
+cp ${SHIM_FILE} ${KERNEL_FILE} ${tempdir}/${SYS_DIR} &&
qemu-system-x86_64 -d int \
-drive if=pflash,format=raw,unit=0,file=/usr/share/ovmf/x64/OVMF_CODE.fd,readonly=on \
-drive if=pflash,format=raw,unit=1,file=OVMF_VARS.fd \
- -net none -drive file=uefi.img,if=ide,format=raw -monitor stdio \
- -serial file:sophia.log -no-shutdown -no-reboot -s -S
+ -net none -drive file=fat:rw:${tempdir} -monitor stdio \
+ -serial file:sophia.log -no-shutdown -no-reboot -s -S
+
+rm -rf ${tempdir}