ffdd -- Device Driver

Floppy disk driver

The files /ddeevv/ff* are entries for  the floppy-disk driver ffdd. Each entry is
assigned major device number 4,  is accessed as a block-special device, and
has a corresponding character-special  device entry.  ffdd handles up to four
5.25-inch floppy-disk drives, each in one of several formats.

The least-significant four bits  of an entry's minor device number identify
the type of drive.  The next least-significant two bits identify the drive.

The following  table summarizes the name, minor  device number, sectors per
track, partition  sector size,  characteristics, and addressing  method for
each device entry of floppy-disk drive 0.

_9 _s_e_c_t_o_r_s/_t_r_a_c_k
ffqqaa00   13    9  1440   DSQD   cylinder (3.25 inch -- 720K)
ff99aa00   12    9   720   DSDD   cylinder (5.25 inch -- 360K)

_1_5 _s_e_c_t_o_r_s/_t_r_a_c_k
ffhhaa00   14   15  2400   DSHD   cylinder (5.25 inch -- 1.2MB)

_1_8 _s_e_c_t_o_r_s/_t_r_a_c_k
ffvvaa00   15   18  2880   DSHD   cylinder (3.5 inch -- 1.44MB

Prefixing  an  rr  to a  device  name  given above  gives  the  name of  the
corresponding  character-device entry.   Corresponding  device entries  for
drives 1, 2,  and 3 have minor numbers with  offsets of 16, 32, and 48 from
the minor  numbers given above, and  have 1, 2, or  3 in place of  0 in the
names given above.

For  device entries  whose minor number's  fourth least-significant  bit is
zero  (minor numbers  0 through  7 for  drive 0),  the driver  uses surface
addressing rather than  cylinder addressing.  This means that it increments
tracks before heads when  computing sector addresses and  the first surface
is  used completely  before the  second surface  is accessed.   For devices
whose minor  number's fourth  least significant bit  is 1 (minor  numbers 8
through 15 for drive 0), the driver uses cylinder addressing.

For a floppy disk to be  accessible from the COHERENT system, a device file
must  be present  in directory  /ddeevv with the  appropriate type,  major and
minor device numbers, and permissions.  The command mmkknnoodd creates a special
file for a device.

The  following  table  gives  the  all  floppy-disk devices  that  COHERENT
recognizes, by  minor number.  Note that some  specialized devices skip the
first  cylinder  on the  disk,  to support  some  third-party program  that
requires this feature:

_M_i_n_o_r
_N_u_m_b_e_r         _D_r_i_v_e     _D_i_a_m_e_t_e_r  _D_e_n_s_i_t_y   _C_y_l_i_n_d_e_r_s
0              0         Both      Any       1-39/79
1              0         Both      Any       0-39/79
4              0         5.25''    360KB     1-39
5              0         3.5''     720KB     1-79
6              0         5.25''    1.2MB     1-79
7              0         3.5''     1.44MB    1-79
12             0         5.25''    360KB     0-39
13             0         3.5''     720KB     0-79
14             0         5.25''    1.2MB     0-79
15             0         3.5''     1.44MB    0-79
16             1         Both      Any       1-39/79
17             1         Both      Any       0-39/79
20             1         5.25''    360KB     1-39
21             1         3.5''     720KB     1-79
22             1         5.25''    1.2MB     1-79
23             1         3.5''     1.44MB    1-79
28             1         5.25''    360KB     0-39
29             1         3.5''     720KB     0-79
30             1         5.25''    1.2MB     0-79
31             1         3.5''     1.44MB    0-79

_F_i_l_e_s
<ffddiiooccttll.hh> -- Driver command header file
/ddeevv/ffdd* -- Block-special files
/ddeevv/rrffdd* -- Character special files

_S_e_e _A_l_s_o
ddeevviiccee ddrriivveerrss, ffddffoorrmmaatt, ffllooppppyy ddiisskk, fftt, mmkkffss, mmkknnoodd,

_D_i_a_g_n_o_s_t_i_c_s
The  driver  reports any  error  status received  from  the controller  and
retries  the operation  several times  before  it reports  an error  to the
program that initiated an operation.

_N_o_t_e_s
The floppy-tape driver fftt also works through major-device number 4.

ffdd assumes that  the disk is formatted with eight,  nine, 15, or 18 sectors
of  512 bytes  each per  track,  depending upon  the /ddeevv  entry.  Cylinder
addressing is the norm for COHERENT.

Programs that  use the  raw device interface  must read whole  sectors into
buffers that do not straddle DMA boundaries.
