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

Re: [MiNT] illegal root directory len?



Hi!

On Sat, Mar 04, 2000 at 01:00:28PM +0100, Frank Naumann wrote:
> Under TOS such an error is simply ignored.

How's that possible? With a dir_entries of 0, the root directory and the
first data cluster shared the same sector - I don't assume that wouldn't
be noticed when using such a partition ...

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.


Ciao

Thomas


-- 
Thomas Binder (Gryf @ IRCNet)  gryf@hrzpub.tu-darmstadt.de
PGP-key available on request!  binder@rbg.informatik.tu-darmstadt.de

Attachment: pgpgidXlzagJF.pgp
Description: PGP signature