summaryrefslogtreecommitdiffhomepage
path: root/dev/kernel/FirmwareKit/GPT.h
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2025-03-23 19:13:48 +0100
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2025-03-23 19:15:17 +0100
commita13e1c0911c0627184bc38f18c7fdda64447b3ad (patch)
tree073a62c09bf216e85a3f310376640fa1805147f9 /dev/kernel/FirmwareKit/GPT.h
parent149fa096eb306d03686b3b67e813cf1a78e08cd0 (diff)
meta(kernel): Reworked repository's filesystem structure.
Removing useless parts of the project too. Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev/kernel/FirmwareKit/GPT.h')
-rw-r--r--dev/kernel/FirmwareKit/GPT.h57
1 files changed, 57 insertions, 0 deletions
diff --git a/dev/kernel/FirmwareKit/GPT.h b/dev/kernel/FirmwareKit/GPT.h
new file mode 100644
index 00000000..91838bc7
--- /dev/null
+++ b/dev/kernel/FirmwareKit/GPT.h
@@ -0,0 +1,57 @@
+/* -------------------------------------------
+
+ Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved.
+
+------------------------------------------- */
+
+#pragma once
+
+#include <NewKit/Defines.h>
+#include <FirmwareKit/EFI/EFI.h>
+
+#define kSectorSizeGPT (512U)
+
+namespace NeOS
+{
+ struct GPT_GUID;
+ struct GPT_PARTITION_TABLE;
+ struct GPT_PARTITION_ENTRY;
+
+ /// @brief GPT GUID structure.
+ typedef struct GPT_GUID
+ {
+ NeOS::UInt32 Data1;
+ NeOS::UInt16 Data2;
+ NeOS::UInt16 Data3;
+ NeOS::UInt8 Data4[8];
+ } GPT_GUID;
+
+ struct PACKED GPT_PARTITION_TABLE final
+ {
+ Char PartitionName[8];
+ UInt32 Revision;
+ UInt32 HeaderSize;
+ UInt32 ChecksumCRC32;
+ UInt32 Reserved1;
+ UInt64 LBAHeader;
+ UInt64 LBAAltHeader;
+ UInt64 FirstGPTEntry;
+ UInt64 LastGPTEntry;
+ GPT_GUID Guid;
+ UInt64 StartingLBA;
+ UInt32 NumPartitionEntries;
+ UInt32 SizeOfEntries;
+ UInt32 CRC32PartEntry;
+ UInt8 Reserved2[kSectorSizeGPT];
+ };
+
+ struct PACKED GPT_PARTITION_ENTRY
+ {
+ GPT_GUID PartitionTypeGUID;
+ GPT_GUID UniquePartitionGUID;
+ UInt64 StartLBA;
+ UInt64 EndLBA;
+ UInt64 Attributes;
+ UInt8 Name[72];
+ };
+} // namespace NeOS