embpart/mbr/mbr.h
Wiesner András d7a5a49394 - Sequential file reading works
- FAT32 file system driver is defined
- Automount implemented
- Unified file operations implemented
- File listing implemented
2023-11-11 18:03:23 +01:00

27 lines
786 B
C

#ifndef EMBPART_MBR_H
#define EMBPART_MBR_H
#include <stdint.h>
#define MBR_MAX_PARTITIONS (4)
// 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