Looking through the wiki page, it's a bit confusing. To be honest, I'd suggest looking at the
wikipedia article on the subject. Indeed, also reference
fatgen103.
I've personally never been to the FAT page on the OSDev wiki and managed to implement a FAT32 driver.
To get the LBA (sector number) of a cluster, I use
Code:
this->FirstUsableCluster + cluster * this->SectorsPerCluster - (2 * this->SectorsPerCluster)
where
Code:
this->FirstUsableCluster = this->partition->GetStartLBA() + this->ReservedSectors + (this->NumberOfFATs * this->FATSectorSize);
This is for FAT32. So given a cluster number of a directory, use use the above formula to calculate which sector it starts at. TBH I don't know what the wiki article is trying to do, it might be FAT12/16 specific.