From 5dc0e4e0bc8011918b58baf0d8b03a3840a7b213 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Fri, 19 May 2023 08:56:49 -0400 Subject: 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 --- firmware/export/disk.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'firmware/export/disk.h') diff --git a/firmware/export/disk.h b/firmware/export/disk.h index c66028fe45..e465552fdc 100644 --- a/firmware/export/disk.h +++ b/firmware/export/disk.h @@ -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); -- cgit v1.2.3