summaryrefslogtreecommitdiffhomepage
path: root/Private/NewBoot/Source
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlalelmahrouss@icloud.com>2024-03-03 20:04:14 +0000
committerAmlal El Mahrouss <amlalelmahrouss@icloud.com>2024-03-03 20:04:14 +0000
commit1be90ecf5c097c143ec90f463dbd73e7fa1ad3f9 (patch)
tree658c8d5e27903155d582fb0e14b08dbe1094a4d4 /Private/NewBoot/Source
parente93e0a0c548a407b7eadc8148687f626f2e26c42 (diff)
HCoreKrnl:HAL: Improve interrupt handling, found a solution to interrupt problem in C++; don't modify the stack on the C++ side.
Diffstat (limited to 'Private/NewBoot/Source')
-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 +