Subject: Re: newfs_msdos
To: Brook Milligan <>
From: Manuel Bouyer <>
List: tech-userlevel
Date: 12/09/1999 21:51:26
On Thu, Dec 09, 1999 at 08:22:19AM -0700, Brook Milligan wrote:
> I am revamping newfs_msdos (and creating a new dumpfs_msdos) to be a
> more general tool for creating FAT filesystems on hard disks as well
> as floppies.  I have need of this for making shared disks (I don't
> trust MS tools to create disks in a way that won't stomp on the
> existing bootblocks) and for creating files containing disk images for
> use with, for example, doscmd.  It seems that there would be broader
> interest in this and I am proposing to replace the current version of
> newfs_msdos with my enhanced tool if there is interest.  Is there?

I used mformat for this, and was even able to crate a DOS bootable partition
this way.

> In any case, I have two design ideas and would appreciate feedback on
> them
> Writing bootsectors for FAT filesystems requires knowledge of a bunch
> of geometry and other parameters describing the disk (or partition).
> I can take these from the command line or from compiled in tables.

Why not from the partition table ?
There isn't any on floopies, but all other removable or fixed media should
have one.
I don't feel like writing a config entry for each different drives I need
to format, especially when the info is already present on the disk.

> However, a more general approach is to take it from a configuration
> file.  My first proposal is to extend the fields supported by
> /etc/floppytab to include the extra information needed.  Is this a
> reasonable approach?  Are there objections?  Better suggestions?
> The bootsectors also, of course, include bootcode in addition to the
> geometry information.  The specific bootcode that is appropriate
> depends on the OS to be booted from the filesystem.  This information
> can also be taken from various sources: compiled in tables or an
> external file containing a bootblock.  However, it might make sense to

Definitively external code.

> create a new file (e.g., /etc/boottab?) containing a set of available
> bootcode; this file could be scanned to pick out the correct one if
> that was included.  Additionally, new bootcode could be added without
> recompiling newfs_msdos.
> What is the best solution here?  Should newfs_msdos just include
> within the binary a table of different bootcodes?  Should there be a
> separate table (where? name?) to which new ones could be added?  Is
> there a problem with distributing a set of binary bootblocks for a
> variety of systems?  (I think not since the same bootblocks are

I think there is one, yes. At last for msdos and NT I would be quite surprised
if there wasn't liscences issues here.

Manuel Bouyer <>