summaryrefslogtreecommitdiffhomepage
path: root/Private/NewBoot
diff options
context:
space:
mode:
authoramlal <amlal@el-mahrouss-logic.com>2024-03-24 23:07:58 +0100
committeramlal <amlal@el-mahrouss-logic.com>2024-03-24 23:07:58 +0100
commitab18ee1fd5fced5d6c75840f35455b609ed28223 (patch)
tree286bae618afe3e2db8fdd415a63b27a7862610e4 /Private/NewBoot
parentc1c1c7cb8ec2518b746804ecc2be9e0613fe685f (diff)
Revision of Handover: Remove bootloader field.
Signed-off-by: amlal <amlal@el-mahrouss-logic.com>
Diffstat (limited to 'Private/NewBoot')
-rw-r--r--Private/NewBoot/CxxRuntime/UnwindCxxKit.cxx29
-rw-r--r--Private/NewBoot/CxxRuntime/manifest.json3
-rw-r--r--Private/NewBoot/NetBoot/EfiModule.cxx7
-rw-r--r--Private/NewBoot/Source/HEL/AMD64/BootEPM.cxx6
-rw-r--r--Private/NewBoot/Source/HEL/AMD64/BootMain.cxx11
5 files changed, 14 insertions, 42 deletions
diff --git a/Private/NewBoot/CxxRuntime/UnwindCxxKit.cxx b/Private/NewBoot/CxxRuntime/UnwindCxxKit.cxx
deleted file mode 100644
index 8adfc981..00000000
--- a/Private/NewBoot/CxxRuntime/UnwindCxxKit.cxx
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * ========================================================
- *
- * CxxKit
- * Copyright Mahrouss Logic, all rights reserved.
- *
- * ========================================================
- */
-
-#include <FirmwareKit/EFI.hxx>
-
-namespace cxxkit
-{
-///! @brief C++ ABI unwinding
-///! Fini array (r1)
-///! Numbers of Fini (r2)
-EXTERN_C void __unwind(void (**finis)(void), int cnt)
-{
- for (int i = 0; i < cnt; ++i)
- (finis[i])();
-}
-} // namespace cxxkit
-
-EXTERN_C Int32 EfiMain(EfiHandlePtr handle, EfiSystemTable* SystemTable)
-{
- SystemTable->ConOut->OutputString(SystemTable->ConOut, L"NewBoot.exe: C++ Runtime Add-in\r\n");
-
- return kEfiOk;
-} \ No newline at end of file
diff --git a/Private/NewBoot/CxxRuntime/manifest.json b/Private/NewBoot/CxxRuntime/manifest.json
deleted file mode 100644
index e4afd692..00000000
--- a/Private/NewBoot/CxxRuntime/manifest.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "pluginName": "MP-C++ Runtime for HCore."
-}
diff --git a/Private/NewBoot/NetBoot/EfiModule.cxx b/Private/NewBoot/NetBoot/EfiModule.cxx
index 419a2be4..e5df4a3e 100644
--- a/Private/NewBoot/NetBoot/EfiModule.cxx
+++ b/Private/NewBoot/NetBoot/EfiModule.cxx
@@ -8,14 +8,19 @@
*/
#include <FirmwareKit/EFI.hxx>
+#include <BootKit/BootKit.hxx>
EXTERN_C Int32 EfiMain(EfiHandlePtr handle, EfiSystemTable* SystemTable)
{
InitEFI(ST);
+ InitGOP();
- /// - Find a network drive called ".\\HCoreWorkgroup"
+ /// - Find a network drive called "/OnlineInstall"
/// - Download our image
/// - Boot from it.
+ BTextWriter writer;
+ writer.Write(L"NetBoot.exe: Updating from OTP...\r\n");
+
return kEfiOk;
}
diff --git a/Private/NewBoot/Source/HEL/AMD64/BootEPM.cxx b/Private/NewBoot/Source/HEL/AMD64/BootEPM.cxx
index d59251e6..36702198 100644
--- a/Private/NewBoot/Source/HEL/AMD64/BootEPM.cxx
+++ b/Private/NewBoot/Source/HEL/AMD64/BootEPM.cxx
@@ -18,7 +18,7 @@ Void boot_try_write_partition_map(const Char* namePart, SizeT namePartLength,
if (namePartLength > kEPMNameLength || !namePart) return;
if (!ataInterface) return;
- ataInterface->Leak().mBase = kEPMStartPartition;
+ ataInterface->Leak().mBase = 0;
ataInterface->Leak().mSize = 512;
Char buf[512] = {0};
@@ -27,11 +27,11 @@ Void boot_try_write_partition_map(const Char* namePart, SizeT namePartLength,
BTextWriter writer;
- writer.Write(L"NewBoot.exe: Reading EPM boot block...\r\n");
+ writer.Write(L"NewBoot.exe: Checking for an EPM BootBlock...\r\n");
for (SizeT i = 0; i < kEPMMagicLength; i++) {
if (buf[i] != kEPMMagic[i]) {
- writer.Write(L"NewBoot.exe: Writing EPM boot block...\r\n");
+ writer.Write(L"NewBoot.exe: Writing an EPM BootBlock...\r\n");
BootBlockType* bootBlock = (BootBlockType*)buf;
diff --git a/Private/NewBoot/Source/HEL/AMD64/BootMain.cxx b/Private/NewBoot/Source/HEL/AMD64/BootMain.cxx
index 663c33d9..1f0bbc9b 100644
--- a/Private/NewBoot/Source/HEL/AMD64/BootMain.cxx
+++ b/Private/NewBoot/Source/HEL/AMD64/BootMain.cxx
@@ -157,10 +157,9 @@ EFI_EXTERN_C EFI_API Int EfiMain(EfiHandlePtr ImageHandle,
if (isIniNotFound) {
handoverHdrPtr->f_Magic = kHandoverMagic;
- handoverHdrPtr->f_Version = 0x1011;
- handoverHdrPtr->f_Bootloader = 0x11; // Installer
+ handoverHdrPtr->f_Version = kHandoverVersion;
- writer.Write(L"NewBoot.exe: Installing NewKernel and it's components...\r\n");
+ writer.Write(L"NewBoot.exe: Setting up OS...\r\n");
ST->ConOut->ClearScreen(ST->ConOut);
@@ -169,15 +168,15 @@ EFI_EXTERN_C EFI_API Int EfiMain(EfiHandlePtr ImageHandle,
Main(handoverHdrPtr);
} else {
handoverHdrPtr->f_Magic = kHandoverMagic;
- handoverHdrPtr->f_Version = 0x1011;
- handoverHdrPtr->f_Bootloader = 0xDD; // System present
+ handoverHdrPtr->f_Version = kHandoverVersion;
- writer.Write(L"NewBoot.exe: Running NewKernel...\r\n");
+ writer.Write(L"NewBoot.exe: Running OS...\r\n");
ST->ConOut->ClearScreen(ST->ConOut);
EFI::ExitBootServices(MapKey, ImageHandle);
+ /// TODO: Read catalog and read NewKernel.exe
}
EFI::Stop();