From cd400898f5a6ef04690231323c0be107ae330fb4 Mon Sep 17 00:00:00 2001 From: Amlal EL Mahrouss Date: Sun, 4 Aug 2024 12:16:22 +0200 Subject: [META] bump. Signed-off-by: Amlal EL Mahrouss --- Boot/Sources/HEL/AMD64/BootMain.cxx | 4 ++-- Boot/Sources/ProgramLoader.cxx | 13 +++---------- Boot/Sources/Root/bootloader.json | 2 +- Boot/amd64-efi.make | 6 +++--- 4 files changed, 9 insertions(+), 16 deletions(-) (limited to 'Boot') diff --git a/Boot/Sources/HEL/AMD64/BootMain.cxx b/Boot/Sources/HEL/AMD64/BootMain.cxx index efd18ef5..3f71d995 100644 --- a/Boot/Sources/HEL/AMD64/BootMain.cxx +++ b/Boot/Sources/HEL/AMD64/BootMain.cxx @@ -228,7 +228,7 @@ EFI_EXTERN_C EFI_API Int Main(EfiHandlePtr ImageHandle, diskFormatter.Format(kMachineModel, &rootDesc, 1); } - BFileReader readerKernel(L"newoskrnl.exe", ImageHandle); + BFileReader readerKernel(L"newoskrnl.dll", ImageHandle); readerKernel.ReadAll(0); @@ -241,7 +241,7 @@ EFI_EXTERN_C EFI_API Int Main(EfiHandlePtr ImageHandle, if (readerKernel.Blob()) { loader = new Boot::ProgramLoader(readerKernel.Blob()); - loader->SetName("\"newoskrnl.exe\" (64-bit SMP)"); + loader->SetName("\"newoskrnl.dll\" (64-bit SMP)"); } writer.Write("newosldr: Running: ").Write(loader->GetName()).Write("\r"); diff --git a/Boot/Sources/ProgramLoader.cxx b/Boot/Sources/ProgramLoader.cxx index 2103414a..be2650dc 100644 --- a/Boot/Sources/ProgramLoader.cxx +++ b/Boot/Sources/ProgramLoader.cxx @@ -70,18 +70,13 @@ namespace Boot // if this is a code header, then we can look for the entrypoint. if (sect->mCharacteristics & eUserSection) { - BS->AllocatePages(EfiAllocateType::AllocateAddress, EfiMemoryType::EfiLoaderCode, 1, &address_to_alloc); - if (!fStartAddress) { - fStartAddress = (VoidPtr)((UIntPtr)firstBytes + optHdr->mAddressOfEntryPoint); + fStartAddress = (VoidPtr)((VoidPtr)((UIntPtr)fBlob + 184 + (sect->mVirtualAddress - optHdr->mAddressOfEntryPoint))); + writer.Write("newosldr: Start Address set: ").Write((UIntPtr)fStartAddress).Write("\r"); } } - else - { - BS->AllocatePages(EfiAllocateType::AllocateAddress, EfiMemoryType::EfiLoaderData, 1, &address_to_alloc); - } } } else if (firstBytes[0] == kPefMagic[0] && @@ -125,9 +120,7 @@ namespace Boot err_fn(handover); } - volatile HEL::HandoverProc start = reinterpret_cast((UIntPtr)fStartAddress); - - start(handover); + rt_jump_to_address(reinterpret_cast(fStartAddress), handover, fStackPtr); err_fn(handover); } diff --git a/Boot/Sources/Root/bootloader.json b/Boot/Sources/Root/bootloader.json index e8bc99fd..fe1a57d4 100644 --- a/Boot/Sources/Root/bootloader.json +++ b/Boot/Sources/Root/bootloader.json @@ -1,4 +1,4 @@ { - "newoskrnl.exe": "kernel", + "newoskrnl.dll": "kernel", "ZETA/fonts.json": "rsrc" } diff --git a/Boot/amd64-efi.make b/Boot/amd64-efi.make index b866e650..c33ccc96 100644 --- a/Boot/amd64-efi.make +++ b/Boot/amd64-efi.make @@ -47,10 +47,10 @@ REM_FLAG=-f FLAG_ASM=-f win64 FLAG_GNU=-fshort-wchar -D__EFI_x86_64__ -D__NEWOS_OTA__ -mno-red-zone -D__KERNEL__ -D__NEWBOOT__ \ -DEFI_FUNCTION_WRAPPER -I./ -I../Vendor -I../Kernel -c -nostdlib -fno-rtti -fno-exceptions \ - -std=c++20 -D__HAVE_MAHROUSS_APIS__ -D__NEWOS_AMD64__ -D__MAHROUSS__ -D__BOOTLOADER__ + -std=c++20 -D__HAVE_MAHROUSS_APIS__ -D__NEWOS_AMD64__ -D__MAHROUSS__ -D__BOOTLOADER__ -I../ BOOT_LOADER=newosldr.exe -KERNEL=newoskrnl.exe +KERNEL=newoskrnl.dll DDK=libDDK.lib SCI=libSCI.lib @@ -97,7 +97,7 @@ download-edk: $(HTTP_GET) https://retrage.github.io/edk2-nightly/bin/DEBUGX64_OVMF.fd -O OVMF.fd BINS=*.bin -EXECUTABLES=newosldr.exe newoskrnl.exe OVMF.fd +EXECUTABLES=newosldr.exe newoskrnl.dll OVMF.fd TARGETS=$(REM_FLAG) $(OBJ) $(BIN) $(IMG) $(IMG_2) $(EXECUTABLES) -- cgit v1.2.3