diff options
Diffstat (limited to 'Boot/Sources')
| -rw-r--r-- | Boot/Sources/HEL/AMD64/BootMain.cxx | 4 | ||||
| -rw-r--r-- | Boot/Sources/ProgramLoader.cxx | 13 | ||||
| -rw-r--r-- | Boot/Sources/Root/bootloader.json | 2 |
3 files changed, 6 insertions, 13 deletions
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<HEL::HandoverProc>((UIntPtr)fStartAddress); - - start(handover); + rt_jump_to_address(reinterpret_cast<HEL::HandoverProc>(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" } |
