FD(4,F) AIX Technical Reference FD(4,F)
-------------------------------------------------------------------------------
fd
PURPOSE
Supports the diskette device driver.
SYNOPSIS
#include <sys/devinfo.h>
DESCRIPTION
The fd special file is unique to AIX PS/2. The diskette special file provides
block and character (raw) access to diskettes in the diskette drives, allowing
only one process to have a diskette drive open for writing at a time. Removing
the diskette from the drive with diskette files still open may cause various
I/O system calls to return errors.
The minor device number specifies both the driver number and the format of the
diskette to be read or written. Following are the special file names used to
access the diskette drives containing the specified diskettes (formatted).
Special File Drive Media
/dev/fd0 A 3.5 inch 1.44 Megabyte
/dev/fd1 B 3.5 inch 1.44 Megabyte
/dev/fd0h A 3.5 inch 1.44 Megabyte
/dev/fd1h B 3.5 inch 1.44 Megabyte
/dev/fd0l A 3.5 inch 720 Kilobyte
/dev/fd1l B 3.5 inch 720 Kilobyte
/dev/fd1x External 5.25 inch 360 Kilobyte
/dev/fd3 External 5.25 inch 1.2 Megabyte
The special file names /dev/rfd0, /dev/rfd1, and so on, refer to the character
(raw) interface to the diskette drives.
Warning: Accessing a diskette drive with a special file name that does not
correspond to the format of the inserted media may lead to loss of data.
ioctl Operations
The IOCTYPE type ioctl system call returns the device type DD_DISK, defined in
the sys/devinfo.h header file.
The IOCINFO type ioctl system call returns the following structure, defined in
the sys/devinfo.h header file:
struct devinfo {
char devtype;
char flags;
Processed November 7, 1990 FD(4,F) 1
FD(4,F) AIX Technical Reference FD(4,F)
union {
struct { /* for disks */
short bytpsec; /* bytes per sector */
short secptrk; /* sectors per track */
short trkpcyl; /* tracks per cylinder */
long numblks; /* number of blocks on diskette */
} dk;
... /* for other devices */
} un;
};
/* flags */
#define DF_FIXED 01 /* non-removable */
#define DF_RAND 02 /* random access possible */
#define DF_FAST 04 /* a relative term */
Error Messages
The error messages printed out by the fd driver are of the following form:
fd_err_log: TTTT error on dev (MAJ/MIN), blkno=BBBBB
fd_err_log: status: ST UN S0 S1 S2
Where:
TTTT Is either read or write
MAJ Is the major device number
MIN Is the minor device number
BBBBB Is the disk block (sector) number.
The status bits have the following definitions:
ST (Internal state at time of error):
3 => error occurred during a Recalibrate operation
4 => error occurred during a Seek operation
6 => error occurred during a Read or Write operation
UN (The drive unit number. This number should be 0 for the first drive
and 1 for the second drive).
S0 has the following bit definitions:
c0 Interrupt code mask
00 Normal Termination
Processed November 7, 1990 FD(4,F) 2
FD(4,F) AIX Technical Reference FD(4,F)
40 Abnormal Termination
80 Invalid Command
c0 Ready signal changed
20 Seek command complete
10 Fault signal received from drive
08 Not ready
04 Current state of the head select line
03 Unit select
S1 has the following bit definitions:
80 Attempt to access sector beyond end of cyl
40 Not used
20 CRC error in the ID or data field
10 Host did not service FDC fast enough
08 Not used
04 Specified sector not found
02 Attempt to write a write protected disk
01 Missing address mark
S2 has the following bit definitions:
80 Not used
40 Control mark
20 CRC in the data field
10 Wrong Cylinder
08 Scan command: equal condition satisfied
04 Scan command: sector not found
02 Bad Cylinder
01 Missing Data address mark
Processed November 7, 1990 FD(4,F) 3
FD(4,F) AIX Technical Reference FD(4,F)
FILES
/dev/fd0, /dev/fd1, ...
/dev/rfd0, /dev/rfd1, ...
RELATED INFORMATION
In this book: "ioctlx, ioctl, gtty, stty" and "fs."
Processed November 7, 1990 FD(4,F) 4