summaryrefslogtreecommitdiffhomepage
path: root/Private/NewBoot
diff options
context:
space:
mode:
Diffstat (limited to 'Private/NewBoot')
-rw-r--r--Private/NewBoot/Source/BootMain.cxx26
1 files changed, 9 insertions, 17 deletions
diff --git a/Private/NewBoot/Source/BootMain.cxx b/Private/NewBoot/Source/BootMain.cxx
index 53a217b6..67c6929a 100644
--- a/Private/NewBoot/Source/BootMain.cxx
+++ b/Private/NewBoot/Source/BootMain.cxx
@@ -7,8 +7,6 @@
* ========================================================
*/
-#define __BOOTLOADER__ 1
-
#include <BootKit/BootKit.hxx>
#include <KernelKit/MSDOS.hpp>
#include <KernelKit/PE.hpp>
@@ -21,7 +19,7 @@
#endif // ifdef __x86_64__
#ifndef kBootKrnlSections
-#error Please provide the amount of sections the kernel has.
+#error [NewBoot/HCoreLdr] Please provide the amount of sections the kernel has.
#endif // !kBootKrnlSections
#define kBootReadSize \
@@ -33,11 +31,13 @@ typedef void (*bt_main_type)(HEL::HandoverInformationHeader* HIH);
EFI_EXTERN_C EFI_API Int EfiMain(EfiHandlePtr ImageHandle,
EfiSystemTable* SystemTable) {
- InitEFI(SystemTable);
- InitQT();
+ InitEFI(SystemTable); // Init the efi library.
+ InitQT(); // Quick Toolkit for UI
BTextWriter writer;
+ /// Splash screen stuff
+
writer.Write(L"MahroussLogic (R) HCoreLdr: ");
writer.Write(BVersionString::Shared()).Write(L"\r\n");
@@ -52,6 +52,8 @@ EFI_EXTERN_C EFI_API Int EfiMain(EfiHandlePtr ImageHandle,
.Write(SystemTable->FirmwareVendor)
.Write(L"\r\n");
+ /// Read Kernel blob.
+
BFileReader kernelImg(L"HCOREKRNL.EXE", ImageHandle);
kernelImg.Size(kBootReadSize);
@@ -70,6 +72,7 @@ EFI_EXTERN_C EFI_API Int EfiMain(EfiHandlePtr ImageHandle,
ExecOptionalHeaderPtr optHdr = reinterpret_cast<ExecOptionalHeaderPtr>(
(UIntPtr)&ptrHdr->mCharacteristics + 1);
+ // first check for kernel.cfg inside ESP/EPM.
BFileReader systemIni(L"KERNEL.CFG", ImageHandle);
systemIni.Size(1);
@@ -83,18 +86,7 @@ EFI_EXTERN_C EFI_API Int EfiMain(EfiHandlePtr ImageHandle,
UInt64 posSeek = 0;
- /****
- *
- * LOAD KERNEL CODE
- *
- *
- *
- *
- *
- *
- *
- * LOAD KERNEL CODE
- */
+ // load sections here
kernelImg.File()->SetPosition(kernelImg.File(), &posSeek);
kernelImg.Size(kBootReadSize +