summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAda Christine <adachristine18@gmail.com>2024-01-29 23:40:41 +0000
committerAda Christine <adachristine18@gmail.com>2024-01-29 23:40:41 +0000
commitce0c451e37d761024774fb752d86f300c810a8d8 (patch)
tree2563065f3af13a99486bebf5677d7a96fbd515c4
parent168bf2e5fb3fe3a81ec8cc422785d600c7c173fb (diff)
more temporary
-rwxr-xr-xdebug.sh16
1 files changed, 10 insertions, 6 deletions
diff --git a/debug.sh b/debug.sh
index 00f043d..dd662a6 100755
--- a/debug.sh
+++ b/debug.sh
@@ -7,22 +7,26 @@ make -C loader &&
BOOT_DIR=EFI/BOOT
BOOT_FILE=BOOTX64.EFI
SYS_DIR=adasoft/sophia
+OVMF_DIR=/usr/share/ovmf/x64
LOADER_FILE=loader/loader.efi
SHIM_FILE=kc/boot/efi.os
KERNEL_FILE=kc/core/kernel.os
-tempdir=$(mktemp -d)
+tempdir=$(mktemp -d) &&
+rundir=${tempdir}/run &&
-mkdir -p ${tempdir}/${BOOT_DIR} ${tempdir}/${SYS_DIR} &&
-cp ${LOADER_FILE} ${tempdir}/${BOOT_DIR}/${BOOT_FILE} &&
-cp ${SHIM_FILE} ${KERNEL_FILE} ${tempdir}/${SYS_DIR} &&
+cp ${OVMF_DIR}/OVMF_VARS.fd ${tempdir} &&
+
+mkdir -p ${rundir}/${BOOT_DIR} ${rundir}/${SYS_DIR} &&
+cp ${LOADER_FILE} ${rundir}/${BOOT_DIR}/${BOOT_FILE} &&
+cp ${SHIM_FILE} ${KERNEL_FILE} ${rundir}/${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=fat:rw:${tempdir} -monitor stdio \
+ -drive if=pflash,format=raw,unit=1,file=${tempdir}/OVMF_VARS.fd \
+ -net none -drive file=fat:rw:${rundir} -monitor stdio \
-serial file:sophia.log -no-shutdown -no-reboot -s -S
rm -rf ${tempdir}