diff options
| author | Ada Christine <adachristine18@gmail.com> | 2023-05-13 10:59:24 +0000 |
|---|---|---|
| committer | Ada Christine <adachristine18@gmail.com> | 2023-05-13 10:59:24 +0000 |
| commit | 11239640cba1d187f0b09c4bc3c3e0b76d03bd0c (patch) | |
| tree | d22dab2fd94564d3a24f190082b2406eaae0e04d | |
| parent | 838f39324a1f305562addce6d807400522d9c469 (diff) | |
no more image.sh, use qemu fat emulation
| -rwxr-xr-x | debug.sh | 21 | ||||
| -rwxr-xr-x | image.sh | 20 |
2 files changed, 18 insertions, 23 deletions
@@ -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 - |
