This document describes the hardware parameters relevant to ADFS.


Disc Drives
-----------

Speed stability:
For the purposes of formatting the speed stability of disc drives will be
assumed to be 1.5%.


Formats
-------

ADFS supports 3 formats, D, E and L. Here are the 'perfect' parameters for
these formats:
Format  g1s0    g1s1    g3      ss      spt     im
L       42      42      57      256     16      no
D       32+271  32+0    90      1024    5       no
E       32+271  32+0    90      1024    5       no

g1s0 - gap 1, side 0
g1s1 - gap 1, side 1
g3   - gap 3
ss   - sector size
spt  - sectors per track
im   - index mark


Controllers
-----------

These are the limit parameters for the two floppy controllers ADFS supports:

C       sptL    sptH    tl      th      l2slL   l2slH   fsnL    fsnH
1772    1       240     0       240     7       10      0       255
710     0       255     0       255     7       14      0       255

C       ff              FI              gap3
1772    00-f4, ff       optional        track length
710     00-ff           mandatory       255

C     - controller
sptL  - sectors per track, low
sptH  - sectors per track, high
tl    - track, low
th    - track, high
l2slL - log2 sector length, Low
l2slH - log2 sector length, high
fsnL  - sector number low (formatting)
fsnH  - sector number high (formatting)
ff    - format fill values allowed on all densities
FI    - formatting with ID mark
gap3  - gap3 maximum length (when formatting)


Track layouts
-------------

To clarify the terms, a description of track layout is given.

A track is layed out as follows:

<gap4a><ID><gap1><sector><gap3><sector><gap3><S..  ..r><gap3><Sector><gap4b>

The start of this diagram is where the index pulse occurs, and the end is
where the next index pulse occurs. Due to mechanical variation in speed the
time between the start and end varies, which is why there are gaps - the
gaps 'absorb' the speed variations. So, in words:
gap4a is the gap between the (mechanical) index pulse and the (magnetic)
        index mark.
ID is the index mark.
gap1 is the gap between the index mark and the 1st sector.
sector is a sector.
gap3 is the gap between sectors.
gap4b is the gap between the last sector and the index pulse.

A sector has the following format:

<sector ID><gap2><sector data>

Due to hardware limitations, gap2 is fixed. Each of sector ID and sector
data have a preamble or 00 bytes, a synchronisation patern, an
identification byte (which says what sort of information follows: ID or
Data), and the data itself (ID or data). The reason the data is separated
from the ID is that during sector writing the ID is read to determine which
bit of the disc is currently going under the head, then the drive is
switched to writing, which takes some time, and then a whole section of data
is written (the 00 bytes, sync bytes, ID byte and data). gap2 is there to
accomodate variations in hardware (different spin speeds etc).

Recommended formats:

(These values are extracted from the 1772 data sheet)
Dens    gap1    gap3    ~gap4
FM:     >=16    >=11    >=16
MFM:    >=32    >=24    >=16

Evaluation of 'does it fit' is:
    Low track length - gap1 + gap3 - (secsize + SecOvrhead + gap3)*secs >= min. gap4

If 'no', does min. gap1 and 3 fit?
  If still 'no' return error
  Otherwise divide slack amoungst gaps (incl. gap4)

Does the side/side skew invalidate gap4, if so shorten to min. gap4



