From d7ac08e402b155fadf030ea3723bc6e12f77739d Mon Sep 17 00:00:00 2001 From: GutPuncher Date: Sat, 25 Nov 2023 04:48:35 -0500 Subject: [PATCH] Create prototype code in GPT.ZC --- src/Home/GPT.ZC | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/src/Home/GPT.ZC b/src/Home/GPT.ZC index e13a7cce..2c8d97f9 100644 --- a/src/Home/GPT.ZC +++ b/src/Home/GPT.ZC @@ -19,7 +19,24 @@ GPT HEADER STRUCTURE: 4 size of single partition entry (usually 0x80 or 128) 4 crc32 of partition entires array in little endian ?? reserved, zeroes to the end of the block +*/ +class GPTHeader +{ + U8 signature, + revnum_headsize, + crc32head_reszero, + lba_copy_current, + lba_copy_backup, + lba_usable_first, + lba_usable_last; + U16 disk_guid; + U8 lba_start_partitions, + entrynum_singlesize, + crc32entries_reszero; +}; + +/* GPT PARTITIONS ENTRIES STRUCTURE: 16 partition Type GUID mixed endian 16 unique partition GUID mixed endian @@ -28,6 +45,19 @@ GPT PARTITIONS ENTRIES STRUCTURE: 8 attribute flags 72 partition name 36 UTF-16LE code units +*/ + +class GPTPartitionHeader +{ + U16 guid_type, + guid_unique; + U8 lba_first, + lba_last, + attr_flags; + U8 name[72]; +}; +/* + GPT Partition attributes: (bit, details) 0 platform required by computer @@ -38,5 +68,7 @@ GPT Partition attributes: **/ - +#define GPT_PARTf_REQ 0 +#define GPT_PARTf_EFI 1 +#define GPT_PARTf_LEGACY 2