[Top][All Lists]

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

Re: [mtools] dir_len and FAT12

From: Alain Knaff
Subject: Re: [mtools] dir_len and FAT12
Date: Mon, 30 Dec 2002 09:00:31 +0100
User-agent: KMail/1.4.3

On Monday 30 December 2002 04:02, Mark Pulford wrote:
> Hi,
> I'm using mformat to create a FAT12 floppy image for a simple OS I'm
> writing and I'd like to keep the root directory down to 1 sector.
> I've noticed that calc_fs_parameters() overrides the -r option for
> known floppy geometries & FAT12.
> Is there a reason for preventing single sector root directories on
> floppies? Does anything other than 14 sectors cause compatibility
> issues?
> All of the documentation I've seen suggests that I should be able to
> change dir_len freely, but I'd like to know if I'm getting myself into
> trouble if I force it to use only a single sector ;).
> Regards,
> Mark
> _______________________________________________
> mtools mailing list
> address@hidden

The reason for this behavior is that very old DOS versions didn't
support any geometry description in the boot sector. The boot sector
only contained the boot program, but no filesystem information.

Instead the the OS figured out filesystem layout from the so-called
"media descriptor" byte in the FAT. This is the first byte of the FAT,
and it was used as a lookup index into a table of "known" geometries.

The following values were supported:

Media Desc           Sectors Heads Cyls root_len clus_size fat_len
0xfc                 9       1     40   4        1         2
0xfd                 9       2     40   7        2         2
0xfe                 8       1     40   4        1         2
0xff                 8       2     40   7        2         2

Other values (0xf0, 0xf8, 0xf9) meant that geometry is specified in
the boot sector.

This means that if one of the "old Dos" compatible geometries is used,
Root directory length, cluster size and fat length are essentially
hardwired, and cannot be changed. An easy workaround is to avoid using
such geometries. In one of the next patches, this behaviour will be
changed in such a way that mtools simply uses the "new Dos" convention
if an incompatible root_dir_len has been specified.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]