FAT Troubles

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
User avatar
mark3094
Member
Member
Posts: 164
Joined: Mon Feb 14, 2011 10:32 pm
Location: Australia
Contact:

Re: FAT Troubles

Post by mark3094 »

mark3094 wrote:Is this formula still relevant?
FYI, I have confirmed that it is the same formula for dealing with entries in the FAT.

Thank you all
egos
Member
Member
Posts: 612
Joined: Fri Nov 16, 2007 1:59 pm

Re: FAT Troubles

Post by egos »

mark3094 wrote:Just want to check, is this the same formula that I should use when I get the next cluster in the chain from the FAT?
For FAT16 next cluster number is held in the word at FAT1Pos+2*ClusterNumber, where 2 is a FAT cell size. To get next cluster number for FAT12 you should use a specific algorithm.
What's the best way to check for EOF?
Firstly you should use filesize field. But don't forget that if filesize value is not zero you should check the cluster number before reading the cluster: 1<ClusterNumber<xFF6h (minimal support), or 1<ClusterNumber<ClusterCount+2 (advanced support). Additionally you can check last cluster cell for EOF mark (>xFF7h). To control the size of the directories you should use LastDirEntry mark and EOF mark while the size is less than 2 mb.
If you have seen bad English in my words, tell me what's wrong, please.
Post Reply