16 uint16_t sectorPerCluster = *(uint8_t*)(bpb+2);
17 uint16_t reservedSector = *(uint16_t*)(bpb+3);
18 uint16_t numberOfFAT = *(uint8_t*)(bpb + 5);
19 uint16_t sectorPerFAT = *(uint8_t*)(bpb + 11);
20 uint16_t hiddenSector = *(uint8_t*)(bpb + 17);
21 uint16_t dataBlockBase = hiddenSector + reservedSector
22 + numberOfFAT * sectorPerFAT
24 uint16_t rootSectorNth = dataBlockBase + 2 * sectorPerCluster;
27 uint16_t FATTableNth = hiddenSector + reservedSector + 1;
39 for (int16_t i = 0; i < 3; ++i) {
44 uint16_t kernelSectorNth = dataBlockBase + (cluster * sectorPerCluster);
45 for (int16_t j = 0; j < numOfSectors; ++j) {
47 cluster = *FATRootItem;
48 FATRootItem = FAT_table + cluster;
49 kernelSectorNth = dataBlockBase + (cluster * sectorPerCluster);
static void loadLogicSector(uint16_t lgsector, uint16_t addr, uint16_t num)
uint16_t DBRkernelLoader()
static int16_t __fs_strcmp(const char *s1, const char *s2)
uint32_t filesize
in bytes
#define ROOT_AREA_ADDRESS
#define FAT_TABLE_ADDRESS
all the macro needed by FAT inner implementation
#define filesize2sectors(X)