embpart/mbr/mbr.h

25 lines
754 B
C

#ifndef EMBPART_MBR_H
#define EMBPART_MBR_H
#include <stdint.h>
// partition entry
typedef struct {
uint8_t status; // partition status
uint8_t chsa_fa[3]; // CHS address of first absolute sector in partition
uint8_t part_type; // partition type
uint8_t chsa_la[3]; // CHS address of last absolute sector in partition
uint32_t lba_fa; // LBA of first absolute sector
uint32_t sector_count; // number of sectors the partition includes
} __attribute__((packed)) PartEntry;
/**
* Get pointer to partition table
* @param mbr_sec pointer to the sector containing the MBR, MUST BE DWORD ALIGNED
* @return pointer to first partition entry
*/
const PartEntry * mbr_get_partitions(const uint8_t * mbr_sec);
#endif //EMBPART_MBR_H