summaryrefslogtreecommitdiffhomepage
path: root/dev/Kernel/FirmwareKit/Handover.hxx
diff options
context:
space:
mode:
authorAmlal EL Mahrouss <amlalelmahrouss@icloud.com>2024-08-15 18:35:34 +0200
committerAmlal EL Mahrouss <amlalelmahrouss@icloud.com>2024-08-15 18:35:34 +0200
commitf3d931aa7cfaf96baef8383b59a8938779541ee7 (patch)
treefdb9fc51badb3dbd03e46ab0766a49d9522e13e2 /dev/Kernel/FirmwareKit/Handover.hxx
parent86640816e8b1d3595365f1fcc8a2a9e61fb40ff1 (diff)
[IMP] Moved source code into dev/ folder.
Signed-off-by: Amlal EL Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'dev/Kernel/FirmwareKit/Handover.hxx')
-rw-r--r--dev/Kernel/FirmwareKit/Handover.hxx101
1 files changed, 101 insertions, 0 deletions
diff --git a/dev/Kernel/FirmwareKit/Handover.hxx b/dev/Kernel/FirmwareKit/Handover.hxx
new file mode 100644
index 00000000..a93ace39
--- /dev/null
+++ b/dev/Kernel/FirmwareKit/Handover.hxx
@@ -0,0 +1,101 @@
+/* -------------------------------------------
+
+ Copyright ZKA Technologies.
+
+------------------------------------------- */
+
+/**
+ * @file Handover.hxx
+ * @author Amlal El Mahrouss (amlalelmahrouss@icloud.com)
+ * @brief The handover boot protocol.
+ * @version 0.3
+ * @date 2024-02-23
+ *
+ * @copyright Copyright (c) 2024, ZKA Technologies
+ *
+ */
+
+#pragma once
+
+#include <NewKit/Defines.hxx>
+
+/* useful macros */
+
+#define kHandoverMagic 0xBADCC
+#define kHandoverVersion 0x113
+
+#define kHandoverMaxCmdLine 8
+
+#define kHandoverStructSz sizeof(HEL::HandoverHeader)
+
+namespace Kernel::HEL
+{
+ /**
+ @brief the kind of executable we're loading.
+*/
+ enum
+ {
+ kTypeKernel = 100,
+ kTypeKernelDriver = 101,
+ kTypeRsrc = 102,
+ kTypeCount = 3,
+ };
+
+ /**
+ @brief The executable architecture.
+*/
+
+ enum
+ {
+ kArchAmd64 = 122,
+ kArchCount = 2,
+ };
+
+ struct HandoverInformationHeader
+ {
+ UInt64 f_Magic;
+ UInt64 f_Version;
+
+ voidPtr f_VirtualStart;
+ SizeT f_VirtualSize;
+ voidPtr f_PhysicalStart;
+
+ WideChar f_FirmwareVendorName[32];
+ SizeT f_FirmwareVendorLen;
+
+ struct
+ {
+ VoidPtr f_SmBios;
+ VoidPtr f_VendorPtr;
+ } f_HardwareTables;
+
+ struct
+ {
+ UIntPtr f_The;
+ SizeT f_Size;
+ UInt32 f_Width;
+ UInt32 f_Height;
+ UInt32 f_PixelFormat;
+ UInt32 f_PixelPerLine;
+ } f_GOP;
+
+ UInt64 f_FirmwareSpecific[8];
+ Char f_CommandLine[255][kHandoverMaxCmdLine];
+ };
+
+ enum
+ {
+ kHandoverSpecificKind,
+ kHandoverSpecificAttrib,
+ kHandoverSpecificMemoryEfi,
+ };
+
+ /// @brief Bootloader main type.
+ typedef void (*BootMainKind)(HandoverInformationHeader* handoverInfo);
+
+ /// @brief Alias of bootloader main type.
+ typedef void (*HandoverProc)(HandoverInformationHeader* handoverInfo);
+} // namespace Kernel::HEL
+
+/// @brief Bootloader global header.
+inline Kernel::HEL::HandoverInformationHeader* kHandoverHeader = nullptr;