diff options
| author | Amlal El Mahrouss <amlalelmahrouss@icloud.com> | 2024-02-04 10:59:24 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlalelmahrouss@icloud.com> | 2024-02-04 10:59:24 +0100 |
| commit | e2bbec91d70847cc5a2ff67eb84ca4a3c2d03e85 (patch) | |
| tree | 1e7fec7c232b0c750157007113ce8f86d43b7e76 /Private/NewBoot/Source/Entrypoint.cxx | |
| parent | aff54fd3dc6855b62c047f126c6fe20ca717ee0f (diff) | |
Kernel: Depend less on NewFS, add support for FileSystem protocol in
NewBoot.
Signed-off-by: Amlal El Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'Private/NewBoot/Source/Entrypoint.cxx')
| -rw-r--r-- | Private/NewBoot/Source/Entrypoint.cxx | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/Private/NewBoot/Source/Entrypoint.cxx b/Private/NewBoot/Source/Entrypoint.cxx index 39769b87..4839ee1f 100644 --- a/Private/NewBoot/Source/Entrypoint.cxx +++ b/Private/NewBoot/Source/Entrypoint.cxx @@ -7,7 +7,6 @@ * ======================================================== */ -#include "BootKit/Arch/ATA.hxx" #define __BOOTLOADER__ 1 #include <BootKit/BootKit.hxx> @@ -43,26 +42,18 @@ EFI_EXTERN_C Int EfiMain(EfiHandlePtr ImageHandle, UInt64 mapKey = 0; - BFileReader img(L"HCoreKrnl.exe"); + BFileReader img(L"\\EFI\\BOOT\\HCoreKrnl.exe"); - SizeT sz = 0UL; - PEImagePtr blob = (PEImagePtr)img.Fetch(sz); + PEImagePtr blob = (PEImagePtr)img.Fetch(ImageHandle); - if (!blob || sz < 1) + if (!blob) EFI::RaiseHardError(L"HCoreLdr_NoSuchKernel", L"Couldn't find HCoreKrnl.exe!"); - ExecHeaderPtr headerPtr = (ExecHeaderPtr)blob; + writer.WriteString(L"HCoreLdr: Running HCoreKrnl.exe...\r\n"); - if (blob[0] == kMagMz0 && blob[1] == kMagMz1) { - writer.WriteString(L"HCoreLdr: Running HCoreKrnl.exe...\r\n"); - /// Load Image here - } else { - EFI::RaiseHardError(L"HCoreLdr_NotPE", L"Not a PE file! Aborting..."); - } - - EFI::Stop(); EFI::ExitBootServices(mapKey, ImageHandle); + EFI::Stop(); return kEfiOk; } |
