summaryrefslogtreecommitdiffhomepage
path: root/dev
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-12-08 18:33:49 +0100
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-12-08 18:33:49 +0100
commit4bd2cebaa624a5a246316dc469723af80f1f3d01 (patch)
tree1565c8a8bada13bf9aa52b4de5651aafc8cf1be4 /dev
parente0948f4b9b12723871564be41f782a3ad9ef6546 (diff)
IMP: GPT.h: Add Partition table and partition table entry.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev')
-rw-r--r--dev/ZKAKit/FirmwareKit/GPT.h38
1 files changed, 36 insertions, 2 deletions
diff --git a/dev/ZKAKit/FirmwareKit/GPT.h b/dev/ZKAKit/FirmwareKit/GPT.h
index f1b74248..173031f1 100644
--- a/dev/ZKAKit/FirmwareKit/GPT.h
+++ b/dev/ZKAKit/FirmwareKit/GPT.h
@@ -9,5 +9,39 @@
#include <NewKit/Defines.h>
#include <FirmwareKit/EFI/EFI.h>
-typedef EfiGUID GPT_GUID_PARTITION_STRUCT;
-struct GPT_MASTER_PARTITON_STRUCT; \ No newline at end of file
+#define kSectorSizeGPT 512
+
+namespace Kernel
+{
+ typedef EfiGUID GPT_GUID;
+ struct GPT_PARTITION_TABLE;
+
+ 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 Kernel