fdio(7I)
NAME
fdio − floppy disk control operations
SYNOPSIS
#include <sys/fdio.h>
DESCRIPTION
The Solaris floppy driver supports a set of ioctl(2) requests for getting and setting the floppy drive characteristics. Basic to these ioctl() requests are the definitions in <sys/fdio.h>.
IOCTLS
The following ioctl() requests are available only on the Solaris floppy driver.
FDDEFGEOCHAR
x86: This ioctl() forces the floppy driver to restore the diskette and drive characteristics and geometry, and partition information to default values based on the device configuration.
FDGETCHANGE
The argument is a pointer to an int. This ioctl() returns the status of the diskette-changed signal from the floppy interface. The following defines are provided for cohesion.
Note that for x86 systems, FDGC_DETECTED (which is available only on x86) should be used instead of FDGC_HISTORY.
/∗
∗ Used by FDGETCHANGE, returned state of the sense disk change bit.
∗/
#define FDGC_HISTORY0x01/∗ disk has changed since last call ∗/
#define FDGC_CURRENT0x02/∗ current state of disk change ∗/
#define FDGC_CURWPROT0x10/∗ current state of write protect ∗/
#define FDGC_DETECTED0x20/∗ previous state of DISK CHANGE ∗/
FDIOGCHAR The argument is a pointer to an fd_char structure (described below). This ioctl() gets the characteristics of the floppy diskette from the floppy controller.
FDIOSCHAR The argument is a pointer to an fd_char structure (described below). This ioctl() sets the characteristics of the floppy diskette for the floppy controller. Typical values in the fd_char structure for a high density diskette:
fieldvalue
fdc_medium0
fdc_transfer_rate500
fdc_ncyl80
fdc_nhead2
fdc_sec_size512
fdc_secptrack18
fdc_steps-1{ This field doesn’t apply. }
/∗
∗ Floppy characteristics
∗/
struct fd_char {
u_charfdc_medium;/∗ equals 1 if medium type ∗/
intfdc_transfer_rate; /∗ transfer rate ∗/
intfdc_ncyl;/∗ number of cylinders ∗/
intfdc_nhead;/∗ number of heads ∗/
intfdc_sec_size;/∗ sector size ∗/
intfdc_secptrack;/∗ sectors per track ∗/
intfdc_steps;/∗ no. of steps per data track ∗/
};
FDGETDRIVECHAR
The argument to this ioctl() is a pointer to an fd_drive structure (described below). This ioctl() gets the characteristics of the floppy drive from the floppy controller.
FDSETDRIVECHAR
x86: The argument to this ioctl() is a pointer to an fd_drive structure (described below). This ioctl() sets the characteristics of the floppy drive for the floppy controller. Only fdd_steprate, fdd_headsettle, fdd_motoron, and fdd_motoroff are actually used by the floppy disk driver.
/∗
∗ Floppy Drive characteristics
∗/
struct fd_drive {
intfdd_ejectable;/∗ does the drive support eject? ∗/
intfdd_maxsearch;/∗ size of per-unit search table ∗/
intfdd_writeprecomp; /∗ cyl to start write prcompensation ∗/
intfdd_writereduce;/∗ cyl to start recucing write current ∗/
intfdd_stepwidth;/∗ width of step pulse in 1 us units ∗/
intfdd_steprate;/∗ step rate in 100 us units ∗/
intfdd_headsettle;/∗ delay, in 100 us units ∗/
intfdd_headload;/∗ delay, in 100 us units ∗/
intfdd_headunload;/∗ delay, in 100 us units ∗/
intfdd_motoron;/∗ delay, in 100 ms units ∗/
intfdd_motoroff;/∗ delay, in 100 ms units ∗/
intfdd_precomplevel;/∗ bit shift, in nano-secs ∗/
intfdd_pins;/∗ defines meaning of pin 1, 2, 4 and 34 ∗/
intfdd_flags;/∗ TRUE READY, Starting Sector #, & Motor On ∗/
};
FDGETSEARCH
Not available.
FDSETSEARCH
Not available.
FDEJECT SPARC: This ioctl() requests the floppy drive to eject the diskette.
FDIOCMD The argument is a pointer to an fd_cmd structure (described below). This ioctl() allows access to the floppy diskette using the floppy device driver. Only the FDCMD_WRITE, FDCMD_READ, and FDCMD_FORMAT_TR commands are currently available.
struct fd_cmd {
u_shortfdc_cmd;/∗ command to be executed ∗/
intfdc_flags;/∗ execution flags (x86 only) ∗/
daddr_tfdc_blkno;/∗ disk address for command ∗/
intfdc_secnt;/∗ sector count for command ∗/
caddr_tfdc_bufaddr;/∗ user’s buffer address ∗/
u_intfdc_buflen;/∗ size of user’s buffer ∗/
};
/∗
∗ Floppy commands
∗/
#defineFDCMD_WRITE1
#defineFDCMD_READ2
#defineFDCMD_SEEK3
#defineFDCMD_REZERO4
#defineFDCMD_FORMAT_UNIT5
#defineFDCMD_FORMAT_TRACK 6
FDRAW The argument is a pointer to an fd_raw structure (described below). This ioctl() allows direct control of the floppy drive using the floppy controller. Refer to the appropriate floppy-controller data sheet for full details on required command bytes and returned result bytes. The following commands are supported.
/∗
∗ Floppy raw commands
∗/
#define FDRAW_SPECIFY0x03
#define FDRAW_READID0x0a(x86 only)
#define FDRAW_SENSE_DRV0x04
#define FDRAW_REZERO0x07
#define FDRAW_SEEK0x0f
#define FDRAW_SENSE_INT0x08 (x86 only)
#define FDRAW_FORMAT0x0d
#define FDRAW_READTRACK0x02
#define FDRAW_WRCMD0x05
#define FDRAW_RDCMD0x06
#define FDRAW_WRITEDEL0x09
#define FDRAW_READDEL0x0c
/∗
∗ Used by FDRAW
∗/
struct fd_raw {
charfdr_cmd[10];/∗ user-supplied command bytes ∗/
shortfdr_cnum;/∗ number of command bytes ∗/
charfdr_result[10];/∗ controller-supplied result bytes ∗/
shortfdr_nbytes;/∗ number to transfer if read/write command ∗/
char∗fdr_addr;/∗ where to transfer if read/write command ∗/
};
SEE ALSO
ioctl(2), dkio(7I), fd(7D), hdio(7I)
SunOS 5.5/x86 — Last change: 27 Apr 1995