multiboot: Add v1 boot protocol

v1 passes the drive and partition number of the boot volume
instead of using the volume number. The volume number isn't
reliable because the same filesystem might get a different
volume number once the firmware is loaded, which will cause
the firmware to use the wrong root volume and fail to locate
the correct .rockbox directory.

Using drive and partition numbers avoids this issue because
drive numbering is fixed and determined by the target.

Change-Id: I7e68b892d9424a1f686197a6122e139b438e5f7e
This commit is contained in:
Aidan MacDonald 2022-12-22 20:31:06 +00:00
parent 6ffd42548b
commit dc9d354ed2
6 changed files with 99 additions and 12 deletions

View file

@ -37,7 +37,7 @@
#define BOOT_DATA_MAGIC0 ('r' | 'b' << 8 | 'm' << 16 | 'a' << 24)
#define BOOT_DATA_MAGIC1 ('g' | 'i' << 8 | 'c' << 16 | '!' << 24)
#define BOOT_DATA_VERSION 0
#define BOOT_DATA_VERSION 1
/* maximum size of payload */
#define BOOT_DATA_PAYLOAD_SIZE 4
@ -59,8 +59,10 @@ struct boot_data_t
{
struct
{
uint8_t boot_volume;
uint8_t _boot_volume; /* IGNORED */
uint8_t version;
uint8_t boot_drive;
uint8_t boot_partition;
};
uint8_t payload[BOOT_DATA_PAYLOAD_SIZE];
};