balong-usbload/parts.h

30 lines
634 B
C
Raw Normal View History

2022-07-03 07:49:25 +00:00
// partition descriptor structure
struct ptable_line{
char name[16];
unsigned start;
unsigned lsize;
unsigned length;
2022-07-03 07:49:25 +00:00
unsigned loadaddr;
unsigned entry;
unsigned type;
unsigned nproperty; // partition flags
unsigned count;
};
2022-07-03 07:49:25 +00:00
// pull page structure from partition table
struct ptable_t {
uint8_t head[16];
uint8_t version[16];
uint8_t product[16];
struct ptable_line part[41];
uint8_t tail[32];
};
2022-07-03 07:49:25 +00:00
// header signature table
extern const uint8_t headmagic[16];
uint32_t find_ptable(FILE* ldr);
uint32_t find_ptable_ram(char* buf, uint32_t size);
void show_map(struct ptable_t ptable);