disk: Support GUID Partition Tables (GPT)

Notes:

 * Currently limited to 32-bit sector addresses due to internal Rockbox
   APIs. So this means a practical limit of 2TiB per drive.
 * Only 'General Data' GPT partition type is recognised, as that's
   what SD cards seem to use for exFAT/FAT32.

Note that _booting_ off GPT-partitioned drive will require rebuilding
the various rockbox bootloaders, and even then there may be platform
limitations that preclude this.

Change-Id: Ibfaae1960adcb1e81976d4b60dd596c6d16318e4
This commit is contained in:
Solomon Peachy 2023-05-19 08:56:49 -04:00
parent 8fbd44a3d3
commit 5dc0e4e0bc
2 changed files with 132 additions and 10 deletions

View file

@ -35,6 +35,9 @@ struct partinfo
#define PARTITION_TYPE_FAT32_LBA 0x0c
#define PARTITION_TYPE_FAT16 0x06
#define PARTITION_TYPE_OS2_HIDDEN_C_DRIVE 0x84
#define PARTITION_TYPE_GPT_GUARD 0xee
#define MAX_PARTITIONS_PER_DRIVE 4 /* Needs to be at least 4 */
bool disk_init(IF_MD_NONVOID(int drive));
bool disk_partinfo(int partition, struct partinfo *info);