From e2bbec91d70847cc5a2ff67eb84ca4a3c2d03e85 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Sun, 4 Feb 2024 10:59:24 +0100 Subject: Kernel: Depend less on NewFS, add support for FileSystem protocol in NewBoot. Signed-off-by: Amlal El Mahrouss --- Private/NewBoot/Source/Entrypoint.cxx | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'Private/NewBoot/Source/Entrypoint.cxx') 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 @@ -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; } -- cgit v1.2.3