Print this page
10519 Convert fdio(7I) to mandoc
   1 FDIO(7I)                        Ioctl Requests                        FDIO(7I)
   2 
   3 
   4 
   5 NAME
   6        fdio - floppy disk control operations
   7 
   8 SYNOPSIS
   9        #include <sys/fdio.h>
  10 
  11 
  12 DESCRIPTION
  13        The Solaris floppy driver supports a set of ioctl(2) requests for
  14        getting and setting the floppy drive characteristics. Basic to these
  15        ioctl() requests are the definitions in <sys/fdio.h>.
  16 
  17 IOCTLS
  18        The following ioctl() requests are available on the Solaris floppy
  19        driver.
  20 
  21        FDDEFGEOCHAR
  22                        x86 based systems:  This ioctl() forces the floppy
  23                        driver to restore the diskette and drive
  24                        characteristics and geometry, and partition information
  25                        to default values based on the device configuration.
  26 




  27 
  28        FDGETCHANGE
  29                        The argument is a pointer to an int. This ioctl()
  30                        returns the status of the diskette-changed signal from
  31                        the floppy interface. The following defines are
  32                        provided for cohesion.
  33 
  34 
  35 
  36        Note: For x86 based systems, use FDGC_DETECTED (which is available only
  37        on x86 based systems) instead of FDGC_HISTORY.
  38 
  39          /*
  40           * Used by FDGETCHANGE, returned state of the sense disk change bit.
  41           */
  42          #define FDGC_HISTORY  0x01     /* disk has changed since insertion or
  43                                            last FDGETCHANGE call */
  44          #define FDGC_CURRENT  0x02     /* if set, indicates drive has floppy,
  45          >                              otherwise, drive is empty */




  46          #define FDGC_CURWPROT 0x10     /* current state of write protect */
  47          #define FDGC_DETECTED 0x20     /* previous state of DISK CHANGE */
  48 



  49 
  50        FDIOGCHAR
  51                     The argument is a pointer to an fd_char structure
  52                     (described below). This ioctl() gets the characteristics
  53                     of the floppy diskette from the floppy controller.
  54 
  55 
  56        FDIOSCHAR
  57                     The argument is a pointer to an fd_char structure
  58                     (described below). This ioctl() sets the characteristics
  59                     of the floppy diskette for the floppy controller. Typical
  60                     values in the  fd_char structure for a high density
  61                     diskette:
  62 
  63                       field value
  64                       fdc_medium     0
  65                       fdc_transfer_rate   500
  66                       fdc_ncyl  80
  67                       fdc_nhead 2
  68                       fdc_sec_size   512
  69                       fdc_secptrack  18
  70                       fdc_steps -1   { This field doesn't apply. }
  71 
  72 
  73 
  74          /*
  75           * Floppy characteristics
  76           */
  77          struct fd_char {
  78           uchar_t fdc_medium;     /* equals 1 if floppy is medium density format */
  79           int fdc_transfer_rate;  /* transfer rate */
  80           int fdc_ncyl;           /* number of cylinders */
  81           int fdc_nhead;          /* number of heads */
  82           int fdc_sec_size;       /* sector size */
  83           int fdc_secptrack;      /* sectors per track */
  84           int fdc_steps;          /* no. of steps per data track */
  85          };
  86 




  87 
  88        FDGETDRIVECHAR
  89                          The argument to this ioctl() is a pointer to an
  90                          fd_drive structure (described below). This ioctl()
  91                          gets the characteristics of the floppy drive from the
  92                          floppy controller.
  93 
  94 
  95        FDSETDRIVECHAR
  96                          x86 based systems:  The argument to this ioctl() is a
  97                          pointer to an fd_drive structure (described below).
  98                          This ioctl() sets the characteristics of the floppy
  99                          drive for the floppy controller. Only fdd_steprate,
 100                          fdd_headsettle, fdd_motoron, and fdd_motoroff are
 101                          actually used by the floppy disk driver.
 102 
 103 
 104          /*
 105           * Floppy Drive characteristics
 106           */
 107          struct fd_drive {
 108               int  fdd_ejectable;    /* does the drive support eject? */
 109               int  fdd_maxsearch;    /* size of per-unit search table */
 110               int  fdd_writeprecomp; /* cyl to start write precompensation */
 111               int  fdd_writereduce;  /* cyl to start recucing write current */
 112               int  fdd_stepwidth;    /* width of step pulse in 1 us units */
 113               int  fdd_steprate;     /* step rate in 100 us units */
 114               int  fdd_headsettle;   /* delay, in 100 us units */
 115               int  fdd_headload;     /* delay, in 100 us units */
 116               int  fdd_headunload;   /* delay, in 100 us units */
 117               int  fdd_motoron;      /* delay, in 100 ms units */
 118               int  fdd_motoroff;     /* delay, in 100 ms units */
 119               int  fdd_precomplevel; /* bit shift, in nano-secs */
 120               int  fdd_pins;         /* defines meaning of pin 1, 2, 4 and 34 */
 121               int  fdd_flags;        /* TRUE READY, Starting Sector #, & Motor On */
 122          };
 123 

 124 
 125        FDGETSEARCH
 126                       Not available.
 127 


 128 
 129        FDSETSEARCH
 130                       Not available.



 131 
 132 
 133        FDEJECT
 134                       SPARC:  This ioctl() requests the floppy drive to eject
 135                       the diskette.
 136 
 137 
 138        FDIOCMD
 139                       The argument is a pointer to an fd_cmd structure
 140                       (described below). This ioctl() allows access to the
 141                       floppy diskette using the floppy device driver.  Only
 142                       the FDCMD_WRITE, FDCMD_READ, and FDCMD_FORMAT_TRACK
 143                       commands are currently available.
 144 
 145 
 146          struct fd_cmd {
 147               ushort_t fdc_cmd;      /* command to be executed */
 148               int      fdc_flags;    /* execution flags (x86 only) */
 149               daddr_t  fdc_blkno;    /* disk address for command */
 150               int      fdc_secnt;    /* sector count for command */
 151               caddr_t  fdc_bufaddr;  /* user's buffer address */
 152               uint_t   fdc_buflen;   /* size of user's buffer */
 153          };
 154 



 155 
 156 
 157        Please note that the fdc_buflen field is currently unused. The
 158        fdc_secnt field is used to calculate the transfer size, and the buffer
 159        is assumed to be large enough to accommodate the transfer.
 160 
 161          {
 162          /*
 163          * Floppy commands
 164           */
 165          #define   FDCMD_WRITE    1
 166          #define   FDCMD_READ     2
 167          #define   FDCMD_SEEK     3
 168          #define   FDCMD_REZERO   4
 169          #define   FDCMD_FORMAT_UNIT   5
 170          #define   FDCMD_FORMAT_TRACK  6
 171          };
 172 





 173 
 174        FDRAW
 175                 The argument is a pointer to an fd_raw structure (described
 176                 below).  This ioctl() allows direct control of the floppy
 177                 drive using the floppy controller. Refer to the appropriate
 178                 floppy-controller data sheet for full details on required
 179                 command bytes and returned result bytes. The following
 180                 commands are supported.
 181 
 182 
 183          /*
 184          * Floppy raw commands
 185          */
 186          #define FDRAW_SPECIFY    0x03
 187          #define FDRAW_READID     0x0a (x86 only)
 188          #define FDRAW_SENSE_DRV  0x04
 189          #define FDRAW_REZERO     0x07
 190          #define FDRAW_SEEK  0x0f
 191          #define FDRAW_SENSE_INT  0x08 (x86 only)
 192          #define FDRAW_FORMAT     0x0d
 193          #define FDRAW_READTRACK  0x02
 194          #define FDRAW_WRCMD 0x05
 195          #define FDRAW_RDCMD 0x06
 196          #define FDRAW_WRITEDEL   0x09
 197          #define FDRAW_READDEL   0x0c
 198 
 199 
 200 
 201        Please note that when using  FDRAW_SEEK or  FDRAW_REZERO, the driver
 202        automatically issues a  FDRAW_SENSE_INT command to clear the interrupt
 203        from the  FDRAW_SEEK or the  FDRAW_REZERO. The result bytes returned by
 204        these commands are the results from the FDRAW_SENSE_INT command.
 205        Please see the floppy-controller data sheet for more details on
 206        FDRAW_SENSE_INT.
 207 
 208          /*
 209           * Used by FDRAW
 210           */
 211          struct    fd_raw {
 212           char     fdr_cmd[10];     /* user-supplied command bytes */
 213           short    fdr_cnum;        /* number of command bytes */
 214           char     fdr_result[10];  /* controller-supplied result bytes */
 215           ushort_t fdr_nbytes;      /* number to transfer if read/write command */
 216           char     *fdr_addr;       /* where to transfer if read/write command */
 217          };
 218 
 219 
 220 SEE ALSO
 221        ioctl(2), dkio(7I), fd(7D), hdio(7I)
 222 
 223 
 224 
 225                                 April 26, 2001                        FDIO(7I)
   1 FDIO(7I)                        Ioctl Requests                        FDIO(7I)
   2 


   3 NAME
   4      fdio - floppy disk control operations
   5 
   6 SYNOPSIS
   7      #include <sys/fdio.h>
   8 

   9 DESCRIPTION
  10      The Solaris floppy driver supports a set of ioctl(2) requests for getting
  11      and setting the floppy drive characteristics.  Basic to these ioctl(2)
  12      requests are the definitions in <sys/fdio.h>.
  13 
  14 IOCTLS
  15      The following ioctl(2) requests are available on the Solaris floppy
  16      driver.
  17 
  18      FDDEFGEOCHAR  x86 based systems:  This ioctl(2) forces the floppy driver
  19                    to restore the diskette and drive characteristics and
  20                    geometry, and partition information to default values based
  21                    on the device configuration.

  22 
  23      FDGETCHANGE   The argument is a pointer to an int.  This ioctl(2) returns
  24                    the status of the diskette-changed signal from the floppy
  25                    interface.  The following defines are provided for
  26                    cohesion.
  27 








  28      Note: For x86 based systems, use FDGC_DETECTED (which is available only
  29      on x86 based systems) instead of FDGC_HISTORY.
  30 
  31        /*
  32         * Used by FDGETCHANGE, returned state of the sense disk change bit.
  33         */
  34        #define FDGC_HISTORY  0x01       /*
  35                                          * disk has changed since insertion or
  36                                          * last FDGETCHANGE call
  37                                          */
  38        #define FDGC_CURRENT  0x02       /*
  39                                          * if set, indicates drive has floppy,
  40                                          * otherwise, drive is empty
  41                                          */
  42        #define FDGC_CURWPROT 0x10       /* current state of write protect */
  43        #define FDGC_DETECTED 0x20       /* previous state of DISK CHANGE */
  44 
  45      FDIOGCHAR  The argument is a pointer to an fd_char structure (described
  46                 below).  This ioctl(2) gets the characteristics of the floppy
  47                 diskette from the floppy controller.
  48 
  49      FDIOSCHAR  The argument is a pointer to an fd_char structure (described
  50                 below).  This ioctl(2) sets the characteristics of the floppy
  51                 diskette for the floppy controller.  Typical values in the
  52                 fd_char structure for a high density diskette:
  53 
  54                 Field                 Value








  55                 fdc_medium            0
  56                 fdc_transfer_rate     500
  57                 fdc_ncyl              80
  58                 fdc_nhead             2
  59                 fdc_sec_size          512
  60                 fdc_secptrack         18
  61                 fdc_steps             -1       { This field doesn't apply. }
  62 


  63        /*
  64         * Floppy characteristics
  65         */
  66        struct fd_char {
  67         uchar_t fdc_medium;    /* equals 1 if floppy is medium density format */
  68         int fdc_transfer_rate; /* transfer rate */
  69         int fdc_ncyl;          /* number of cylinders */
  70         int fdc_nhead;         /* number of heads */
  71         int fdc_sec_size;      /* sector size */
  72         int fdc_secptrack;     /* sectors per track */
  73         int fdc_steps;         /* no. of steps per data track */
  74        };
  75 
  76      FDGETDRIVECHAR  The argument to this ioctl(2) is a pointer to an fd_drive
  77                      structure (described below).  This ioctl(2) gets the
  78                      characteristics of the floppy drive from the floppy
  79                      controller.
  80 
  81      FDSETDRIVECHAR  x86 based systems:  The argument to this ioctl(2) is a
  82                      pointer to an fd_drive structure (described below).  This
  83                      ioctl(2) sets the characteristics of the floppy drive for
  84                      the floppy controller.  Only fdd_steprate,








  85                      fdd_headsettle, fdd_motoron, and fdd_motoroff are
  86                      actually used by the floppy disk driver.
  87 

  88        /*
  89         * Floppy Drive characteristics
  90         */
  91        struct fd_drive {
  92            int fdd_ejectable;    /* does the drive support eject? */
  93            int fdd_maxsearch;    /* size of per-unit search table */
  94            int fdd_writeprecomp; /* cyl to start write precompensation */
  95            int fdd_writereduce;  /* cyl to start recucing write current */
  96            int fdd_stepwidth;    /* width of step pulse in 1 us units */
  97            int fdd_steprate;     /* step rate in 100 us units */
  98            int fdd_headsettle;   /* delay, in 100 us units */
  99            int fdd_headload;     /* delay, in 100 us units */
 100            int fdd_headunload;   /* delay, in 100 us units */
 101            int fdd_motoron;      /* delay, in 100 ms units */
 102            int fdd_motoroff;     /* delay, in 100 ms units */
 103            int fdd_precomplevel; /* bit shift, in nano-secs */
 104            int fdd_pins;         /* defines meaning of pin 1, 2, 4 and 34 */
 105            int fdd_flags;        /* TRUE READY, Starting Sector #, & Motor On */
 106        };
 107 
 108      FDGETSEARCH  Not available.
 109 
 110      FDSETSEARCH  Not available.

 111 
 112      FDEJECT      SPARC:  This ioctl(2) requests the floppy drive to eject the
 113                   diskette.
 114 
 115      FDIOCMD      The argument is a pointer to an fd_cmd structure (described
 116                   below).  This ioctl(2) allows access to the floppy diskette
 117                   using the floppy device driver.  Only the FDCMD_WRITE,
 118                   FDCMD_READ, and FDCMD_FORMAT_TRACK commands are currently
 119                   available.
 120 














 121        struct fd_cmd {
 122                ushort_t fdc_cmd;      /* command to be executed */
 123                int      fdc_flags;    /* execution flags (x86 only) */
 124                daddr_t  fdc_blkno;    /* disk address for command */
 125                int      fdc_secnt;    /* sector count for command */
 126                caddr_t  fdc_bufaddr;  /* user's buffer address */
 127                uint_t   fdc_buflen;   /* size of user's buffer */
 128        };
 129 
 130      Please note that the fdc_buflen field is currently unused.  The fdc_secnt
 131      field is used to calculate the transfer size, and the buffer is assumed
 132      to be large enough to accommodate the transfer.
 133 






 134        /*
 135         * Floppy commands
 136         */
 137        #define FDCMD_WRITE     1
 138        #define FDCMD_READ      2
 139        #define FDCMD_SEEK      3
 140        #define FDCMD_REZERO    4
 141        #define FDCMD_FORMAT_UNIT       5
 142        #define FDCMD_FORMAT_TRACK      6

 143 
 144      FDRAW  The argument is a pointer to an fd_raw structure (described
 145             below).  This ioctl(2) allows direct control of the floppy drive
 146             using the floppy controller.  Refer to the appropriate floppy-
 147             controller data sheet for full details on required command bytes
 148             and returned result bytes.  The following commands are supported.
 149 









 150        /*
 151         * Floppy raw commands
 152         */
 153        #define FDRAW_SPECIFY   0x03
 154        #define FDRAW_READID    0x0a    (x86 only)
 155        #define FDRAW_SENSE_DRV 0x04
 156        #define FDRAW_REZERO    0x07
 157        #define FDRAW_SEEK      0x0f
 158        #define FDRAW_SENSE_INT 0x08    (x86 only)
 159        #define FDRAW_FORMAT    0x0d
 160        #define FDRAW_READTRACK 0x02
 161        #define FDRAW_WRCMD     0x05
 162        #define FDRAW_RDCMD     0x06
 163        #define FDRAW_WRITEDEL  0x09
 164        #define FDRAW_READDEL   0x0c
 165 


 166      Please note that when using FDRAW_SEEK or FDRAW_REZERO, the driver
 167      automatically issues a FDRAW_SENSE_INT command to clear the interrupt
 168      from the FDRAW_SEEK or the FDRAW_REZERO.  The result bytes returned by
 169      these commands are the results from the DRAW_SENSE_INT command.  Please
 170      see the floppy-controller data sheet for more details on FDRAW_SENSE_INT.

 171 
 172        /*
 173         * Used by FDRAW
 174         */
 175        struct    fd_raw {
 176           char     fdr_cmd[10];   /* user-supplied command bytes */
 177           short    fdr_cnum;      /* number of command bytes */
 178           char     fdr_result[10];  /* controller-supplied result bytes */
 179           ushort_t fdr_nbytes;    /* number to transfer if read/write command */
 180           char     *fdr_addr;     /* where to transfer if read/write command */
 181        };
 182 

 183 SEE ALSO
 184      ioctl(2), fd(7D), dkio(7I), hdio(7I)
 185 
 186 illumos                        October 22, 2017                        illumos