fd(7) Miscellaneous Information Manual fd(7)
NAME
fd - Floppy disk interface
SYNOPSIS
controller fdi0 at * vector fdintr
device disk fd0 at fdi0 drive 0
device disk fd1 at fdi0 drive 1
DESCRIPTION
The fd device driver and fdi controller make up the interface to %%CorpNameShort's integrated Floppy Disk Interface (FDI).
If the minor number is less than 64, the driver select number is indicated by bits 4 and 5, and the partition by bits 0 through 3. If the
minor number is one of 64, 65, 66, or 67, the drive select number is indicated by bits 0 and 1, and disk partitions are disabled. In the
latter case, the entire surface of the media is treated as one large partition, and attempts to change the partition table fail. The major
number is 14 for both the block interface and the raw (character) interface.
Legacy Device Names
Refer to System Administration for an explanation of device naming.
The legacy device names have the format rfd0, which indicates the raw device interface, or fd0p, which indicates the block interface and
where p indicates the partition using the characters a through h. If you do not specify a partition with the block interface, partitioning
is disabled. Default file protection for /dev/fd0 is 666.
Current Device Special File Names
The current device special file names are /dev/disk/floppy, /dev/disk/floppy0c, and /dev/disk/floppy0a. The raw current device special
file names are /dev/rdisk/floppy, /dev/rdisk/floppy0c, and /dev/rdisk/floppy0a. These device names are created automatically by dsfmgr
when the system starts up.
Interface
The block interface is restricted to 512-byte, disk-sector aligned accesses. Reads or writes that attempt to start at the middle of a sec-
tor actually start at the beginning of the sector.
There is no sector-boundary limitation if you use the raw interface.
The driver protects the process that opens the floppy disk device from an accidental media change by preventing access to the device if the
media is removed and then reinserted. To access the drive after the media has been changed, either you must close and then reopen the
device, or you must issue a DEVIOCGET or FDIOTPRRST ioctl. You can use the fddisk command with the -new option to issue the FDIOTPRRST
ioctl.
When a floppy disk device is first opened after changing media, a delay occurs while the partition table is read from the media if the
device is not of type rfd0 or /dev/rdisk/floppy0. If the device is opened with FNDELAY, partition table reading may be delayed until the
first actual read or write request.
If you access media containing non-UFS data, the data on the media may appear to be a valid partition table. In this case, the user will
probably not be able to access the media. To work around the problem, use the rfd0 device.
Partitions a and c begin at physical sector 0 and occupy the entire disk. All other partitions also begin at physical sector 0, but are of
zero (0) length. You can change partition sizes by using the disklabel command.
The currently supported floppy disk drive is the RX26. The supported media types in the RX26 are the 350DD of size 737280 (1440 sectors),
350HD of size 1474560 (2880 sectors), and 350ED of size 2949120 (5760 sectors), as shown in the following partition layouts for the media
types:
RX26, Double Density:
disk start length
dsk?a 0 1440
dsk?b 0 0
dsk?c 0 1440
dsk?d 0 0
dsk?e 0 0
dsk?f 0 0
dsk?g 0 0
dsk?h 0 0
RX26, High Density:
disk start length
dsk?a 0 2880
dsk?b 0 0
dsk?c 0 2880
dsk?d 0 0
dsk?e 0 0
dsk?f 0 0
dsk?g 0 0
dsk?h 0 0
RX26, Extra Density:
disk start length
dsk?a 0 5760
dsk?b 0 0
dsk?c 0 5760
dsk?d 0 0
dsk?e 0 0
dsk?f 0 0
dsk?g 0 0
dsk?h 0 0
Ioctl Support
Several special ioctls are defined for use with the fd device driver. Use of these requires that /usr/include/sys/ioctl.h and
/sys/io/fd/mips/fdi.h are included. See the fdi.h file for reference purposes.
FDIOSENSE returns information about the current state of the drive via the structure fd_sense. All elements of this structure are initial-
ized by this call. See comments in fdi.h for use of each element.
FDIOGETMTYP returns information about the media currently in the drive via the structure fd_mt. All elements of this structure are ini-
tialized by this call. See comments in fdi.h for use of each element.
FDIOFMTDSK, FDIOFFBSETUP, FDIOFFBNEXT, and FDIOFMTTRK are used for disk formatting. Data is passed to and from these calls via certain
elements of a structure of type fd_fmt_spec. See comments in fdi.h for use of each element. FDIOFMTDSK causes the entire disk to be for-
matted. FDIOFMTTRK causes a specified track to be formatted. The combination of FDIOFFBSETUP and FDIOFFBNEXT cause the entire disk to be
formatted, a little at a time, allowing the calling process to display an updated status line indicating the progress of the format.
FDIOTPRRST causes the driver to ignore the fact that the media might have just been removed and reinserted. Status information is returned
via a fd_sense structure, just as with the FDIOSENSE call.
FDIOSEEK allows the user to specify the position of the next single-sector access (and only the next access) in any of several formats.
These formats include logical-sector-number format, physical-sector-number format, and cylinder-head-sector format. These formats are
specified in a structure of type fd_seek. See comments in fdi.h for use of each element.
FDIOMKCHS and FDIOMKPSN are used to translate between cylinder-head-sector sector specification and physical-sector-number sector specifi-
cation. Data is passed to and from these calls via certain elements of a structure of type fd_chs_psn. See comments in fdi.h for use of
each element.
The calls DEVIOCGET, DEVGETGEOM, DIOCGETPT, DIOCDGTPT, and DIOCSETPT are also supported and perform in their expected manner. A call to
DEVIOCGET also has the effect of calling FDIOTPRRST.
FILES
RELATED INFORMATION
Commands: disklabel(8),dsfmgr(8), mtools(1), dxmtools(1) fddisk(8), MAKEDEV(8), uerf(8) delim off
fd(7)