From 4bd2cebaa624a5a246316dc469723af80f1f3d01 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Sun, 8 Dec 2024 18:33:49 +0100 Subject: IMP: GPT.h: Add Partition table and partition table entry. Signed-off-by: Amlal El Mahrouss --- dev/ZKAKit/FirmwareKit/GPT.h | 38 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) (limited to 'dev') 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 #include -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 -- cgit v1.2.3