[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] illegal root directory len?



Hello!

> > Under TOS such an error is simply ignored.
> 
> How's that possible? With a dir_entries of 0, the root directory and the

The calculation is done in another way.

> I'd rather say the formula
> 
> xbpb->rdlen = (WPEEK_INTEL (fbs->dir_entries) * 32L) / xbpb->recsiz;
> 
> is wrong, as it yields 0 if the partition has less directory entries
> than necessary to fill one record. This can easily happen if - for
> example - you have 16k records and only 256 root directory entries
> (which is the default in HDDRUTIL, IIRC).
> 
> Thus, the formula should rather read:
> 
> xbpb->rdlen = (WPEEK_INTEL (fbs->dir_entries) * 32L +  xbpb-recsiz - 1) /
> 	      xbpb->recsiz;
> 
> The same is found in the Microsoft FAT Whitepaper, btw.

Then let's fix it ...


Tschuess
   ...Frank

--
ATARI FALCON 040 // MILAN 060
-----------------------------------------
http://www.cs.uni-magdeburg.de/~fnaumann/
e-Mail: fnaumann@freemint.de