summaryrefslogtreecommitdiff
path: root/debug.sh
diff options
context:
space:
mode:
authorAda Christine <adachristine18@gmail.com>2023-05-13 10:59:24 +0000
committerAda Christine <adachristine18@gmail.com>2023-05-13 10:59:24 +0000
commit11239640cba1d187f0b09c4bc3c3e0b76d03bd0c (patch)
treed22dab2fd94564d3a24f190082b2406eaae0e04d /debug.sh
parent838f39324a1f305562addce6d807400522d9c469 (diff)
no more image.sh, use qemu fat emulation
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}