FL8272(7) RISC/os Reference Manual FL8272(7)
NAME
fl8272 - Intel 8272 floppy disk controller interface
DESCRIPTION
The 8272 (or compatible) floppy disk driver consists of a
RISC/os interface layer and a 8272 controller interface
layer. The RISC/os interface layer supports Unix level
open, close, read, write (as raw and block device), and
ioctl while the 8272 controller interface layer allows
direct access to the 8272 controller.
The standard device names begin with ``fd0t'' followed by a
2 digit drive type number and then a letter a-h for parti-
tions 0-7 respectively. Type 0 should be used for double
sided double density (80 cylinders, 9 512 bytes sectors per
track) and type 1 should be used for double sided high den-
sity disk (80 cylinders, 18 512 bytes sectors per track).
The partitions currently used are:
a (the volume header)
c (the user partition)
vol (the entire volume)
The lower 4 bits of the minor device number of the floppy
device determines the partition number while the upper 4
bits determines the disk type. Currently 6 different floppy
disk types are supported and they are (from 0 to 5)
double density double sided .7M (80 cyl, 9 sec/track),
high density double sided 1.4M (80 cyl, 18 sec/track),
single density double sided 0.4M (80 cyl, 5 sec/track),
double density single sided .3M (80 cyl, 9 sec/track),
high density single sided .7M (80 cyl, 18 sec/track),
single density single sided .2M (80 cyl, 5 sec/track).
The block files access the floppy disk via the system's nor-
mal buffering mechanism. The raw device provides direct
transmission between the disk and the user's read or write
buffer. The block device names are contained in the direc-
tory /dev/floppy and the character device names are con-
tained in the directory /dev/rfloppy.
In raw I/O, buffers should be page aligned for best perfor-
mance and I/O counts should be a multiple of 512 bytes (a
disk sector). Likewise seek calls should specify a multiple
of 512 bytes.
Volume headers are created by by the format program flfo.
For example,
flfo -vf /dev/rfloppy/fd0t01vol
Printed 11/19/92 Page 1
FL8272(7) RISC/os Reference Manual FL8272(7)
IOCTL
The 8272 floppy disk driver supports ioctl commands FLIOC-
MODSNS (mode sense), FLIOCMODSLCT (mode select), FLIOCFORMAT
(format disk), FLIOCLOWLEVEL (dispatch 8272 controller
level commands), FLIOCSETXFERRATE (set transfer rate),
FLIOCSETFIFODEPTH (set fifo depth), and
FLIOCSETNRETRIES (set number of retries). These constants
are defined in flio.h.
FLIOCMODSNS and FLIOCMODSLCT
arg in the ioctl call should be a pointer to an
io_arg structure as defined in flio.h. In case of
mode sense, the current hardware parameters as
defined in the flop_msel structure in scsi.h will
be written to the user address specified by
memaddr in io_arg. In case of mode select, the
flop_msel structure pointed to by memaddr will be
used to set up the floppy controller.
FLIOCFORMAT
The driver will format the entire disk using the
interleave factor as defined in the unsigned long
structure pointed to by memaddr in io_arg.
FLIOCLOWLEVEL
arg should point to the fl_io structure as defined
in flio.h. This ioctl command allows user process
to access the 8272 floppy disk controller
directly. 8272 commands are passed to the con-
troller via the cmd field. If there is any data
transfer for that command, data and dlen must be
set. rlen must be set to the corresponding value
for the command. The driver does little sanity
checking for each low level command and only super
user is allowed to use this low level interface.
Currently only the following 8272 commands are
supported: SEEK, READ ID, READ DATA, WRITE
SPECIFY, CONFIGURE, MOTOR ON/OFF, RELATIVE SEEK,
SENSE DRIVE, FORMAT TRACK, NOOP, READ and READ
TRACK. Implied seek is always turned on and there
is an implied SENSE INTR STATUS phase for SEEK,
RELATIVE SEEK and RECALIBRATE commands so the
result length should be set to 2 in such cases.
There is 4 seconds delay for the SENSE DRIVE com-
mand and a 20 seconds timeout for most commands.
The result bytes will be filled with 0xff and
errno will be set to EIO on command timeout.
For more details about the controller commands,
please read the 8272 or 82072 technical manual
from Intel Corporation.
Page 2 Printed 11/19/92
FL8272(7) RISC/os Reference Manual FL8272(7)
FLIOCSETXFERRATE
arg should point to a long integer which will be
masked with 0x1f and written to the data select
register of the 8272 controller after a software
reset. The default value for double density disk
is 0x1a and 0 for high density disk.
FLIOCSETFIFODEPTH
There is no dma between the CPU and the 8272 con-
troller. The 8272 controller has a 16 bytes
internal fifo and it can take values between 0 to
15. The change will take effect on the next mode
select or the next open.
FLIOCSETNRETRIES
arg should contain the desired number of retries
on read/write errors. The default is 16. If arg
is greater than 16, the ioctl will fail and errno
is set to EINVAL.
FILES
/dev/floppy/fd0t0[0-1][a-h]
/dev/rfloppy/fd0t0[0-1][a-h]
/dev/rfloppy/fd0t0[0-1]vol
SEE ALSO
flfo(7)
Printed 11/19/92 Page 3