diff --git a/.gitignore b/.gitignore index 25762c1a..4825c591 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ docs/Boot/ build/limine build/ovmf ZealOS-*.iso +ZealOS-*.raw diff --git a/build/build-temp-vm-uefi-iso.sh b/build/build-temp-vm-uefi-iso.sh index 5763089b..e1058e84 100755 --- a/build/build-temp-vm-uefi-iso.sh +++ b/build/build-temp-vm-uefi-iso.sh @@ -101,19 +101,20 @@ echo "Rebuilding kernel and OS..." qemu-system-x86_64 -machine q35,accel=kvm -drive format=raw,file=$TMPDISK -m 1G -rtc base=localtime -bios ovmf/OVMF.fd -smp 4 -device isa-debug-exit mount_tempdisk -sudo cp limine/limine-cd-efi.bin $TMPISODIR/ -sudo cp limine/limine-cd.bin $TMPISODIR/ +sudo cp -rf $TMPMOUNT/* $TMPISODIR +sudo cp limine/limine-cd-efi.bin $TMPISODIR/Boot/ +sudo cp limine/limine-cd.bin $TMPISODIR/Boot/ sudo cp limine/limine.sys $TMPISODIR/ sudo cp $TMPMOUNT/limine.cfg $TMPISODIR/limine.cfg -sudo cp -rf $TMPMOUNT/* $TMPISODIR +sudo rm -rf $TMPISODIR/EFI sudo cp -rf ../zealbooter/zealbooter.elf $TMPISODIR/Boot/ZealBooter.ELF umount_tempdisk sudo ls $TMPISODIR -al -xorriso -as mkisofs -b limine-cd.bin \ +xorriso -as mkisofs -b Boot/limine-cd.bin \ -no-emul-boot -boot-load-size 4 -boot-info-table \ - --efi-boot limine-cd-efi.bin \ + --efi-boot Boot/limine-cd-efi.bin \ -efi-boot-part --efi-boot-image --protective-msdos-label \ $TMPISODIR -o ZealOS-UEFI-limine-dev.iso diff --git a/build/build-temp-vm-uefi.sh b/build/build-temp-vm-uefi.sh index 2b13b56d..2c293ec6 100755 --- a/build/build-temp-vm-uefi.sh +++ b/build/build-temp-vm-uefi.sh @@ -99,10 +99,12 @@ fi echo "Rebuilding kernel and OS..." qemu-system-x86_64 -machine q35,accel=kvm -drive format=raw,file=$TMPDISK -m 1G -rtc base=localtime -bios ovmf/OVMF.fd -smp 4 -device isa-debug-exit +mv $TMPDISK ./ZealOS-UEFI-limine-dev.raw + echo "Testing UEFI..." -qemu-system-x86_64 -machine q35,accel=kvm -drive format=raw,file=$TMPDISK -m 1G -rtc base=localtime -bios ovmf/OVMF.fd -smp 4 +qemu-system-x86_64 -machine q35,accel=kvm -drive format=raw,file=ZealOS-UEFI-limine-dev.raw -m 1G -rtc base=localtime -bios ovmf/OVMF.fd -smp 4 echo "Testing BIOS..." -qemu-system-x86_64 -machine q35,accel=kvm -drive format=raw,file=$TMPDISK -m 1G -rtc base=localtime -smp 4 +qemu-system-x86_64 -machine q35,accel=kvm -drive format=raw,file=ZealOS-UEFI-limine-dev.raw -m 1G -rtc base=localtime -smp 4 echo "Deleting temp folder..." rm -rf $TMPDIR diff --git a/zealbooter/GNUmakefile b/zealbooter/GNUmakefile index 6148ec08..2c865310 100644 --- a/zealbooter/GNUmakefile +++ b/zealbooter/GNUmakefile @@ -4,10 +4,10 @@ override KERNEL := zealbooter.elf # Convenience macro to reliably declare overridable command variables. define DEFAULT_VAR = - ifeq ($(origin $1), default) + ifeq ($(origin $1),default) override $(1) := $(2) endif - ifeq ($(origin $1), undefined) + ifeq ($(origin $1),undefined) override $(1) := $(2) endif endef @@ -65,9 +65,9 @@ override NASMFLAGS += \ -f elf64 # Use find to glob all *.c, *.S, and *.asm files in the directory and extract the object names. -override CFILES := $(shell find ./ -type f -name '*.c') -override ASFILES := $(shell find ./ -type f -name '*.S') -override NASMFILES := $(shell find ./ -type f -name '*.asm') +override CFILES := $(shell find . -type f -name '*.c') +override ASFILES := $(shell find . -type f -name '*.S') +override NASMFILES := $(shell find . -type f -name '*.asm') override OBJ := $(CFILES:.c=.o) $(ASFILES:.S=.o) $(NASMFILES:.asm=.o) override HEADER_DEPS := $(CFILES:.c=.d) $(ASFILES:.S=.d) diff --git a/zealbooter/zealbooter.c b/zealbooter/zealbooter.c index 002b87e1..e06a52cd 100644 --- a/zealbooter/zealbooter.c +++ b/zealbooter/zealbooter.c @@ -8,11 +8,6 @@ static volatile struct limine_module_request module_request = { .revision = 0 }; -static volatile struct limine_kernel_address_request kernel_address_request = { - .id = LIMINE_KERNEL_ADDRESS_REQUEST, - .revision = 0 -}; - static volatile struct limine_hhdm_request hhdm_request = { .id = LIMINE_HHDM_REQUEST, .revision = 0 @@ -155,7 +150,7 @@ struct E801 { size_t uppermem; }; -struct E801 get_E801(void) { +static struct E801 get_E801(void) { struct E801 E801 = {0}; for (size_t i = 0; i < memmap_request.response->entry_count; i++) {