whats the difference between 0xFF8 - 0xFFF in FAT12

If you are new to OS Development, plan on spending some time here first before going into the other forums.

Moderator:Moderators

Post Reply
Master
Posts:5
Joined:Wed May 26, 2010 5:08 pm
Location:Babol
Contact:
whats the difference between 0xFF8 - 0xFFF in FAT12

Post by Master » Fri Jun 25, 2010 6:36 am

hello all , as you see in FAT12 , it says 0xFF8 - 0xFFF are used to indicate the Last cluster in file, my question is ,
why do we have this range for specifying the end of file!!?
and why cant we use those last addresses for our clusters ?
we could easily use 0xFFF as the indicator (or vice versa), then having this said ,the 0xff8 is in vein and thus completely useless ! :shock:
i would be very thankful if anyone help me get this ,
thank you in advance
Last edited by Master on Sat Jun 26, 2010 3:49 pm, edited 1 time in total.
Regards
Seyyed Hossein Hasan Pour Matikolaee
ustmb.ir

Master
Posts:5
Joined:Wed May 26, 2010 5:08 pm
Location:Babol
Contact:

Re: whats the difference between 0xFF8 - 0xFFF in FAT12

Post by Master » Fri Jun 25, 2010 10:36 am

could it be that because 0xFF8-0xFFF equals 4088-4095 which exceeds the number of actual clusters usable in Fat12 structure ?
i mean because starting from 0xFF8 means the cluster you are looking for doesn't exist , ( or you have passed the boundary which specifies the last usable cluster in FAT12)
(cluster counts is 4078(0xfee) under windows, and 4084(0xff4) under linux)
we have 0x000 to 0xFFF as the range for our addresses ,and according to below:
FAT12-------------Description
0x000-------------Free Cluster
0x001-------------Reserved value; do not use
*0x002–0xFEF----- Used cluster;value points to next cluster(so this means usable clusters are up to 4078, the rest are for other purposes as you see below)
0xFF0–0xFF6-------Reserved values; do not use
0xFF7---------------Bad sector in cluster or reserved cluster
0xFF8–0xFFF--------Last cluster in file(and what remains is used to specify the end of file , actually it is used to say that you have passed the last usable cluster )


*: this actually says for addressing our clusters we have 0x002 up to 0xFEE choices.
starting from FF0 , we address special cases , up till FF8,
From FF8 to the very end of usable addressing range which is FFF , we use the values to say what you are looking for does not exist , or there are only <FEF number of clusters you could use, now the number you specified is not in that range ,so we use it to say you reached your end of file.



am i right?
Regards
Seyyed Hossein Hasan Pour Matikolaee
ustmb.ir

User avatar
Mike
Site Admin
Posts:465
Joined:Sat Oct 20, 2007 7:58 pm
Contact:

Re: whats the difference between 0xFF8 - 0xFFF in FAT12

Post by Mike » Mon Jun 28, 2010 9:13 pm

Hello,

The FAT specification says that different disk utilities can use different EOC (End Of Clusterchain. ie, end-of-file) markers. While Microsoft uses 0x0fff for FAT12, it can be different. Because the BAD_CLUSTER marker is at 0x0ff7 for FAT12, its recommended to test between 0x0ff8 and 0x0fff as the EOC marker can be any of those values. (Although you might be safe just testing with 0x0fff.)
Lead Programmer for BrokenThorn Entertainment, Co.
Website: http://www.brokenthorn.com
Email: webmaster@brokenthorn.com

Master
Posts:5
Joined:Wed May 26, 2010 5:08 pm
Location:Babol
Contact:

Re: whats the difference between 0xFF8 - 0xFFF in FAT12

Post by Master » Sat Jul 10, 2010 7:15 pm

Mike wrote:Hello,

The FAT specification says that different disk utilities can use different EOC (End Of Clusterchain. ie, end-of-file) markers. While Microsoft uses 0x0fff for FAT12, it can be different. Because the BAD_CLUSTER marker is at 0x0ff7 for FAT12, its recommended to test between 0x0ff8 and 0x0fff as the EOC marker can be any of those values. (Although you might be safe just testing with 0x0fff.)
thank you very much :wink:
Regards
Seyyed Hossein Hasan Pour Matikolaee
ustmb.ir

Hoozim
Posts:34
Joined:Sun Nov 21, 2010 6:40 pm

Re: whats the difference between 0xFF8 - 0xFFF in FAT12

Post by Hoozim » Sun Nov 21, 2010 7:14 pm

It all has to do with horrible planning in the past. Its like having the A20 gate in the keyboard controller.

Post Reply