summaryrefslogtreecommitdiffhomepage
path: root/Private/FirmwareKit
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-04-24 08:24:36 +0200
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-04-24 08:24:36 +0200
commit1e0ecf576c5cc3272a1e5e0b5c0f09041014d90b (patch)
tree6b9a68e505e8be6dab6c33fa99a8ec47c79cc534 /Private/FirmwareKit
parent21de9c0793156287836efcf87b99a3ef948f4939 (diff)
Kernel: tons of patches and fixes.
Bootloader: Add error screen and support page in case of a catastrophic failure. Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'Private/FirmwareKit')
-rw-r--r--Private/FirmwareKit/EFI/API.hxx19
-rw-r--r--Private/FirmwareKit/Handover.hxx4
2 files changed, 22 insertions, 1 deletions
diff --git a/Private/FirmwareKit/EFI/API.hxx b/Private/FirmwareKit/EFI/API.hxx
index 138d6b42..536d12c8 100644
--- a/Private/FirmwareKit/EFI/API.hxx
+++ b/Private/FirmwareKit/EFI/API.hxx
@@ -7,7 +7,13 @@
#ifndef __EFI_API__
#define __EFI_API__
+#ifdef __NEWBOOT__
+#include <BootKit/Rsrc/NewBootFatal.rsrc>
+#include <Builtins/Toolbox/Toolbox.hxx>
+#endif // ifdef __NEWBOOT__
+
#include <FirmwareKit/EFI/EFI.hxx>
+#include <FirmwareKit/Handover.hxx>
#include <KernelKit/MSDOS.hpp>
#include <KernelKit/PE.hxx>
@@ -34,7 +40,8 @@ Bascially frees everything we have in the EFI side.
inline void ExitBootServices(UInt64 MapKey, EfiHandlePtr ImageHandle) noexcept {
if (!ST) return;
- while (ST->BootServices->ExitBootServices(ImageHandle, MapKey) != kEfiOk);
+ while (ST->BootServices->ExitBootServices(ImageHandle, MapKey) != kEfiOk)
+ ;
}
enum {
@@ -63,6 +70,16 @@ inline void RaiseHardError(const EfiCharType *ErrorCode,
ST->ConOut->OutputString(ST->ConOut, L" ***\r\n");
+#ifdef __NEWBOOT__
+ ToolboxInitRsrc();
+
+ ToolboxDrawRsrc(NewBootFatal, NEWBOOTFATAL_HEIGHT, NEWBOOTFATAL_WIDTH,
+ (kHandoverHeader->f_GOP.f_Width - NEWBOOTFATAL_WIDTH) / 2,
+ (kHandoverHeader->f_GOP.f_Height - NEWBOOTFATAL_HEIGHT) / 2);
+
+ ToolboxClearRsrc();
+#endif // ifdef __NEWBOOT__
+
EFI::Stop();
}
} // namespace EFI
diff --git a/Private/FirmwareKit/Handover.hxx b/Private/FirmwareKit/Handover.hxx
index ae64f223..5ab19fdf 100644
--- a/Private/FirmwareKit/Handover.hxx
+++ b/Private/FirmwareKit/Handover.hxx
@@ -86,3 +86,7 @@ struct HandoverInformationHeader {
*/
typedef void (*HandoverProc)(HandoverInformationHeader* pHandover);
} // namespace NewOS::HEL
+
+
+/// @brief Bootloader global header.
+inline NewOS::HEL::HandoverInformationHeader* kHandoverHeader = nullptr;