#define PACKED __attribute__ ( packed ) #define GUID(a) #define TYPE_EMPTY "00000000-0000-0000-0000-000000000000" #define TYPE_SYSTEM "C12A7328-F81F-11D2-BA4B-00A0C93EC93B" typedef PACKED struct { uint8_t d[16]; } guid; typedef PACKED struct { guid type; guid label; uint64_t start; uint64_t end; uint64_t flags; #define FLAG_SYSTEM 1 uint8_t name[72]; } GPT_entry; typedef PACKED struct { typedef PACKED struct { uint8_t boot_code[440]; uint8_t uid[4]; uint8_t reserved[2]; MBR_entry entry[4]; uint8_t signature[2]; } } MBR;