Create prototype code in GPT.ZC

This commit is contained in:
GutPuncher 2023-11-25 04:48:35 -05:00
parent f37e16e0c3
commit d7ac08e402
No known key found for this signature in database
GPG key ID: 38CE0A7B6841D1C7

View file

@ -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