summaryrefslogtreecommitdiffhomepage
path: root/Boot/Sources/ProgramLoader.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Boot/Sources/ProgramLoader.cxx')
-rw-r--r--Boot/Sources/ProgramLoader.cxx13
1 files changed, 3 insertions, 10 deletions
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);
}