From 11239640cba1d187f0b09c4bc3c3e0b76d03bd0c Mon Sep 17 00:00:00 2001 From: Ada Christine Date: Sat, 13 May 2023 10:59:24 +0000 Subject: no more image.sh, use qemu fat emulation --- debug.sh | 21 ++++++++++++++++++--- image.sh | 20 -------------------- 2 files changed, 18 insertions(+), 23 deletions(-) delete mode 100755 image.sh 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} diff --git a/image.sh b/image.sh deleted file mode 100755 index 267f84a..0000000 --- a/image.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash - -imagefile=uefi.img -loaderfile=loader/loader.efi -shimfile=kc/boot/efi.os -kernelfile=kc/core/kernel.os - -if [[ ! -f ${imagefile} ]]; then - dd if=/dev/zero of=${imagefile} bs=1024 count=1440 - mformat -i uefi.img -f1440 :: -fi - -mmd -i ${imagefile} -Do ::EFI -mmd -i ${imagefile} -Do ::EFI/BOOT -mcopy -i ${imagefile} -Do ${loaderfile} ::EFI/BOOT/BOOTX64.EFI -mmd -i ${imagefile} -Do ::adasoft -mmd -i ${imagefile} -Do ::adasoft/sophia -mcopy -i ${imagefile} -Do ${shimfile} -Do ::adasoft/sophia -mcopy -i ${imagefile} -Do ${kernelfile} -Do ::adasoft/sophia - -- cgit v1.3.1-1-g115d