# FAT tools

The unit at [fs/fatt.fs] is a collection of FAT [doc/fs/fat] tools. For now, it
only contains tools to create a new FAT.

## Creating a new FAT

You create a new FAT through "newFAT ( drv -- )". This will fill the drive's
first sector with a proper FAT header considering the drive geometry.

This word takes numerous parameters, too many to pass directly through PS.
Instead, we have a global structbind named "fatops" with the following fields:

secperclus  Sectors per cluster. Default 1.
rsvdsec     Number of sectors of the "reserved" section of the FAT. This is
            where Dusk typically places its kernel and boot payload. This
            includes the first sector, so it's never going to be 0. Default 1.
rootentsec  Size, in sectors, of the root directory entries. Default 16.
secpertrk   These 3 fields are of no consequence to the FAT, but they serve as
numheads    an indicator to whatever is booting the machine of the kind of BIOS
drvnum      geometry it can expect.
            Defaults: 63 16 128, the typical "Hard disk" params.

Before calling newFAT, one should call "fatopts$" to set its fields to default
values and then apply overrides as needed. Then, one can call "newFAT".
