MyWebUniversity.com Home Page
 



OpenSolaris man pages main menu


Ioctl Requests                                           fdio(7I)



NAME
     fdio - floppy disk control operations

SYNOPSIS
     #include 


DESCRIPTION
     The  Solaris  floppy  driver  supports  a  set  of  ioctl(2)
     requests  for  getting  and setting the floppy drive charac-
     teristics. Basic to these  ioctl() requests are the  defini-
     tions in .

IOCTLS
     The following ioctl() requests are available on the  Solaris
     floppy driver.

     FDEFGEOCHAR    x86 based systems:  This ioctl() forces  the
                     floppy  driver  to  restore the diskette and
                     drive characteristics and geometry, and par-
                     tition  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 cohe-
                     sion.



     Note: For x86 based systems,  use  FDGCDETECTED  (which  is
     available   only   on   x86   based   systems)   instead  of
     FDGCHISTORY.

       /*
        * Used by FDGETCHANGE, returned state of the sense disk change bit.
        */
       #define FDGCHISTORY  0x01     /* disk has changed since insertion or
                                         last FDGETCHANGE call */
       #define FDGCURENT  0x02     /* if set, indicates drive has floppy,
       >                                 otherwise, drive is empty */
       #define FDGCURWPROT 0x10     /* current state of write protect */
       #define FDGCDETECTED 0x20     /* previous state of DISK CHANGE */


     FDIOGCHAR    The argument is a pointer to an fdchar  struc-
                  ture  (described  below). This ioctl() gets the
                  characteristics of the floppy diskette from the
                  floppy controller.




SunOS 5.11         Last change: 26 April 2001                   1






Ioctl Requests                                           fdio(7I)



     FDIOSCHAR    The argument is a pointer to an fdchar  struc-
                  ture  (described  below). This ioctl() sets the
                  characteristics of the floppy diskette for  the
                  floppy   controller.   Typical  values  in  the
                  fdchar structure for a high density diskette:

                    field value
                    fdcmedium     0
                    fdctransferrate   500
                    fdcncyl  80
                    fdcnhead 2
                    fdcsecsize   512
                    fdcsecptrack  18
                    fdcsteps -1   { This field doesn't apply. }



       /*
        * Floppy characteristics
        */
       struct fdchar {
        uchart fdcmedium;     /* equals 1 if floppy is medium density format */
        int fdctransferrate;  /* transfer rate */
        int fdcncyl;           /* number of cylinders */
        int fdcnhead;          /* number of heads */
        int fdcsecsize;       /* sector size */
        int fdcsecptrack;      /* sectors per track */
        int fdcsteps;          /* no. of steps per data track */
       };


     FDGETDRIVECHAR    The argument to this ioctl() is a  pointer
                       to   an   fddrive   structure  (described
                       below). This ioctl() gets the characteris-
                       tics  of  the floppy drive from the floppy
                       controller.


     FDSETDRIVECHAR    x86 based systems:  The argument  to  this
                       ioctl() is a pointer to an fddrive struc-
                       ture (described below). This ioctl()  sets
                       the  characteristics  of  the floppy drive
                       for   the    floppy    controller.    Only
                       fddsteprate, fddheadsettle, fddmotoron,
                       and fddmotoroff are actually used by  the
                       floppy disk driver.


       /*
        * Floppy Drive characteristics
        */
       struct fddrive {



SunOS 5.11         Last change: 26 April 2001                   2






Ioctl Requests                                           fdio(7I)



            int  fddejectable;    /* does the drive support eject? */
            int  fddmaxsearch;    /* size of per-unit search table */
            int  fddwriteprecomp; /* cyl to start write precompensation */
            int  fddwritereduce;  /* cyl to start recucing write current */
            int  fddstepwidth;    /* width of step pulse in 1 us units */
            int  fddsteprate;     /* step rate in 100 us units */
            int  fddheadsettle;   /* delay, in 100 us units */
            int  fddheadload;     /* delay, in 100 us units */
            int  fddheadunload;   /* delay, in 100 us units */
            int  fddmotoron;      /* delay, in 100 ms units */
            int  fddmotoroff;     /* delay, in 100 ms units */
            int  fddprecomplevel; /* bit shift, in nano-secs */
            int  fddpins;         /* defines meaning of pin 1, 2, 4 and 34 */
            int  fddflags;        /* 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 fdcmd struc-
                    ture  (described  below). This ioctl() allows
                    access  to  the  floppy  diskette  using  the
                    floppy  device driver.  Only the FDCMDWRITE,
                    FDCMDREAD, and  FDCMDFORMATRACK  commands
                    are currently available.


       struct fdcmd {
            ushortt fdccmd;      /* command to be executed */
            int      fdcflags;    /* execution flags (x86 only) */
            daddrt  fdcblkno;    /* disk address for command */
            int      fdcsecnt;    /* sector count for command */
            caddrt  fdcbufaddr;  /* user's buffer address */
            uintt   fdcbuflen;   /* size of user's buffer */
       };



     Please note that the fdcbuflen field is  currently  unused.
     The  fdcsecnt field is used to calculate the transfer size,
     and the buffer is assumed to be large enough to  accommodate
     the transfer.

       {



SunOS 5.11         Last change: 26 April 2001                   3






Ioctl Requests                                           fdio(7I)



       /*
       * Floppy commands
        */
       #define   FDCMDWRITE    1
       #define   FDCMDREAD     2
       #define   FDCMDSEK     3
       #define   FDCMDREZERO   4
       #define   FDCMDFORMATUNIT   5
       #define   FDCMDFORMATRACK  6
       };


     FDRAW    The argument is a pointer to  an  fdraw  structure
              (described  below).     This  ioctl() allows direct
              control of the floppy drive using the  floppy  con-
              troller. Refer to the appropriate floppy-controller
              data sheet for full  details  on  required  command
              bytes and returned result bytes. The following com-
              mands are supported.


       /*
       * Floppy raw commands
       */
       #define FDRAWSPECIFY    0x03
       #define FDRAWREADID     0x0a (x86 only)
       #define FDRAWSENSEDRV  0x04
       #define FDRAWREZERO     0x07
       #define FDRAWSEK  0x0f
       #define FDRAWSENSEINT  0x08 (x86 only)
       #define FDRAWFORMAT     0x0d
       #define FDRAWREADTRACK  0x02
       #define FDRAWRCMD 0x05
       #define FDRAWRDCMD 0x06
       #define FDRAWRITEDEL   0x09
       #define FDRAWREADEL   0x0c



     Please note that when using   FDRAWSEK  or   FDRAWREZERO,
     the  driver  automatically issues a  FDRAWSENSEINT command
     to  clear  the  interrupt  from  the   FDRAWSEK   or   the
     FDRAWREZERO.  The  result  bytes returned by these commands
     are the results from the  FDRAWSENSEINT  command.   Please
     see  the  floppy-controller  data  sheet for more details on
     FDRAWSENSEINT.

       /*
        * Used by FDRAW
        */
       struct    fdraw {
        char     fdrcmd[10];     /* user-supplied command bytes */



SunOS 5.11         Last change: 26 April 2001                   4






Ioctl Requests                                           fdio(7I)



        short    fdrcnum;        /* number of command bytes */
        char     fdrresult[10];  /* controller-supplied result bytes */
        ushortt fdrnbytes;      /* number to transfer if read/write command */
        char     *fdraddr;       /* where to transfer if read/write command */
       };


SEE ALSO
     ioctl(2), dkio(7I), fd(7D), hdio(7I)














































SunOS 5.11         Last change: 26 April 2001                   5



OpenSolaris man pages main menu

Contact us      |       About us      |       Term of use      |       Copyright © 2000-2010 MyWebUniversity.com ™