Commands such as tar(C), cpio(C), and dd(C) can be used to write to and read from floppy disks, taking the appropriate special device file as an argument. For instance, tar tvf /dev/fd0 tabulates (lists) the contents of the floppy disk in drive 0 (zero).
To increase the chance of being able to read from a damaged disk, the tunable parameter maxretry is provided in /etc/conf/pack.d/fd/space.c. The larger the value of maxretry, the more times the driver will reattempt a failed I/O operation. The default value of maxretry is 4. To change this value, edit space.c with a text editor and relink the kernel using link_unix(ADM) or idbuild(ADM).
See the table ``Floppy disk formats'' for the meaning of
the various format strings. Device names
determine the particular drive and media configuration.
The character special or ``raw'' devices
(/dev/rfd) allow direct, unbuffered reading
from or writing to a floppy disk.
where r indicates a raw (character) interface to the disk, rdsk selects the raw device interface and dsk selects the block device interface. The number # selects the drive; 0, 1 and so on.
The optional final parameter t allows the whole disk to be accessed (that is, from the first byte of sector 1, track 0, side 0). If t is not specified, the whole disk except cylinder 0 will be selected.
Note that XENIX device names always imply the presence of the t; that is, access the whole disk.
The following table describes the possible XENIX and UNIX system floppy disk formats:
Floppy disk formats
|135ds9||3d||3.5" double density (720KB)|
|135ds36||3e||3.5" extra density (2.88MB)|
|135ds21||-||3.5" higher density (1.6MB)|
|135ds18||3h||3.5" high density (1.44MB)|
|135ds15||3m||3.5" mid density (1.2MB)|
|48ss8||d8||5.25" single sided double density, 8 sectors per track (160KB)|
|48ss9||d9||5.25" single sided double density, 9 sectors per track (180KB)|
|48ds8||5d9||5.25" double sided double density, 8 sectors per track (320KB)|
|48ds9||5d16||5.25" double sided double density, 9 sectors per track (360KB)|
|96ds9||3d||5.25" double sided high density (720KB)|
|96ds15||5h||5.25" double sided high density (1.2MB)|
However, when accessing a floppy disk for other
operations (read and write), the autosense nodes
/dev/[r]dsk/finstall, and /dev/[r]dsk/finstall1)
can be used.
In this case, the floppy disk driver will automatically
determine (autosense) the format previously established on the
disk and then perform the requested operation. For example:
cpio -itv < /dev/rdsk/finstall
If you use the /dev/[r]dsk/f#[t] node (by default, linked to /dev/[r]dsk/f#5h[t]), the operation may fail if more than 1.2MB of data are transferred.
Besides the device file naming convention described above, some of the formats have alias names that correlate to previous releases. The following list describes the formats that have an alias:
The minor device bit representation scheme for floppy disk drives is shown in the table below. Using this table, you can construct the minor device number of any allowable floppy disk configuration. For example, the minor device number would be 61 for a double sided, 135 tracks per inch, 18 sector floppy disk drive, connected as unit 1 (/dev/[r]dsk/f13ht). The corresponding bit representation would be ``00111101''.
The mknod command can be used to create special device files; see mknod(C) for more information.
Floppy disk drive minor device bit representation
|-||-||-||-||-||-||X||X||Disk drive number|
|-||-||0||0||0||0||-||-||48tpi, 9 sector, ss|
|-||-||0||0||0||1||-||-||48tpi, 9 sector, ds|
|-||-||0||0||1||0||-||-||48tpi, 8 sector, ss|
|-||-||0||0||1||1||-||-||48tpi, 8 sector, ds|
|-||-||1||0||0||1||-||-||135tpi, 9 sector, ds|
|-||-||1||0||0||1||-||-||96tpi, 9 sector, ds|
|-||-||1||0||1||1||-||-||135tpi, 36 sector, ds|
|-||-||1||1||0||0||-||-||135tpi, 15 sector, ds|
|-||-||1||1||0||1||-||-||96tpi, 15 sector, ds|
|-||-||1||1||1||1||-||-||135tpi, 18 sector, ds|
|-||-||0||1||0||0||-||-||135tpi, 21 sector, ds|
|0||-||-||-||-||-||-||-||Access whole disk (t)|
|1||-||-||-||-||-||-||-||Skip first cylinder|
NOTICE: floppy: Switch from disk dev major/minor1 to major/minor2The system allows both root and boot floppies to be mounted at the same time (on /dev/root and /dev/install), although only one disk may be present in the drive at a time. This message is intended to serve as a reminder to swap the disks.
WARNING: floppy: 5.25 inch diskette Adapter/A not installedThis message is output by the driver for the PS/2 5.25-inch disk Adapter/A if the adapter is not found.
WARNING: floppy: CMOS indicates no diskette drives installed WARNING: floppy: CMOS indicates diskette drive n not presentThe configuration memory is invalid; run the DOS SETUP disk that came with your machine.
WARNING: floppy: Disk is write protected in fdn dev major/minorRemove the write protect tag from the disk.
WARNING: floppy: fdn being formattedThe drive is presently formatting a disk.
WARNING: floppy: Handshake error for cmd 0xm on fdn dev major/minorA handshaking error occurred while reading from or writing to the disk.
WARNING: floppy: I/O after close of fdn dev major/minorAn I/O request was detected after the drive was closed. The data transfer is not performed.
WARNING: floppy: Insert disk or close floppy n doorA disk has not been inserted in the drive or the drive door has not been closed. Also check for damage to the drive mechanism or the disk.
WARNING: floppy: Unknown fdn dev major/minor media format format WARNING: floppy: Cannot determine fdn dev major/minor media formatThe minor number of the special device file does not correspond to a known media format. Check that the device file minor number corresponds to the intended device according to the minor device bit representation described earlier on this page.
WARNING: floppy: Set Mid Density FailedDriver was unable to set a 3-mode drive to mid-density mode. The device may not be a 15 sectors per track device, or it may not support mid-density mode.
WARNING: floppy: Set Normal Density FailedDriver was unable to reset a 3-mode drive to normal mode. The device may have already been in normal, rather than middensity, mode; or, there may be a problem with the hardware.
WARNNG floppy: FDC command errorThe floppy drive controller did not successfully receive an entire multibyte command, or an I/O operation on the drive controller did not complete cleanly. The driver resets the floppy drive controller.
This may occur when another program tries to directly access the FDC at the same time as the floppy driver.
WARNING: floppy: FDC result phase error WARNING: floppy: FDC timeout error WARNING: floppy: FDC couldn't read resultThe driver cannot successfully determine the status of the floppy drive controller. As described above, this may occur when another program tries to directly access the FDC at the same time as the floppy driver. The driver resets the controller.
It is not possible to format a 1.44MB high density disk as 720KB in a 3-mode drive (720KB, 1.2MB, and 1.44MB).
Support for 2.88MB and 1.2MB disks depends on drive and controller type. Almost all floppy disk controllers can write to a 2.88MB disk drive, but very few controllers can access a 3.5" 1.2MB disk even if they control a dual speed (3-mode) drive; this is due to incompatible controller chipsets.
Formatting a 1.2MB 3.5" disk in a 3-mode drive at the same time as a disk in a non-3-mode drive may take a long time and the density-select light on the latter drive will indicate an incorrect density. This is due to the way that the floppy driver selects density modes.
When accessing the character special floppy devices, the buffer must begin on a word boundary.
The count in a read(S), write(S), or lseek(S) call to a character special floppy device must be a multiple of 1KB.
Use error-free floppy disks for best results on reading and writing. Note that no bad blocking is performed on floppy disks. If a bad sector is found in the middle of a transfer, the transfer fails.
UNIX system devices:
/usr/include/sys/floppy.h definitions of floppy structures and ioctls