Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ fl(7) — CLIX 3.1r7.6.22

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ioctl(2)

floppypar(4)



  fl(7)                               CLIX                               fl(7)



  NAME

    fl - Floppy disk device driver

  DESCRIPTION

    The fl driver is the floppy disk device driver.  A floppy may be logically
    divided into sections called partitions.  Each partition has a unique
    partition number and modifier number.  A floppy partition header is found
    on the first block of the floppy (see floppypar(4)).  Using the size
    information in this header, fl builds a partition table for the floppy.

    A typical special file to access a floppy with its associated partition is
    as follows, where the partition number is 7 and the modifier number is 3:

    /dev/dsk/flopp7.3

    The format for the minor device for fl follows:

                 _______________________________________________
                |  7 |   6 |   5 |   4 |   3 |   2 |   1 |   0 |
                |______________________|_______________________|
                |                      |                       |
                |       PARTITION      |        MODIFIER       |
                |______________________|_______________________|

    The block special files /dev/dsk/flopp?.? and /dev/dsk/uflopp?.? provide
    buffered access to the floppy.  The kernel buffers floppy data in the
    system buffer cache and uses fl only if data needs to be read or written
    to the floppy.

    The character special files /dev/rdsk/flopp?.? and /dev/rdsk/uflopp?.?
    provide direct access to the floppy.  Data is transferred from the floppy
    directly to user memory.  Transfer requests to floppy character special
    files must be in 512-byte block multiples.

    The ioctl(fildes, request, arg) function can be used with the following
    requests:

    FL_IOCTL_COMMAND
           Send the floppy drive a command where arg is a pointer to a flopio
           structure, as defined in <sys/fl.h>.

    FL_IOCTL_MOTOR
           Turn the floppy drive motor on if arg is nonzero.  Otherwise, turn
           the floppy drive motor off.

    FL_IOCTL_RESET
           Reset the floppy drive.

    FL_IOCTL_DENSITY



  2/94 - Intergraph Corporation                                              1






  fl(7)                               CLIX                               fl(7)



           Set up hardware for high density floppy if arg is nonzero.
           Otherwise, set up the hardware for low density.

    FL_IOCTL_TYPE
           Return the floppy drive type.  The arg parameter contains a nonzero
           value if the driver supports 3.5-inch microfloppies, or a 0 value
           if the driver supports 5.25-inch floppies.

    On failure, errno is set to one of the following values:

    [ENXIO]    The request parameter is not one of the listed commands.

    [EFAULT]   The arg parameter points to an invalid location.

  Formatting a Floppy

    For the character special files, there are two minor device numbers
    reserved for formatting a floppy.  To format a floppy in the high density
    mode, a minor number of 255 must be used.  To format a floppy in the low
    density mode, a minor number of 254 must be used.  The following chart
    shows the sector per track and tracks per side information (a sector is
    512 bytes):
































  2                                              Intergraph Corporation - 2/94






  fl(7)                               CLIX                               fl(7)



                                             Low Density   High Density
                                             ___________   ____________
          5.25-inch floppy   Sectors/track        9             15
                             Tracks/side         40             80

          3.5-inch floppy    Sectors/track        9             18
                             Tracks/side         80             80

    To format a floppy, each track must be formatted.  To format a track, the
    following information is needed for each sector on the track:  cylinder,
    head, sector number, and a code for sector size (2 for 512 byte sectors).
    The  write() function is used to pass this information to the driver.  For
    example, the following statement passes this information to a high density
    5.25-inch floppy disk:

    write(fd, buf, 4 * 15);

    In this example:

    buf = {0, 0, 1, 2, 0, 0, 2, 2, 0, 0, 3, 2, 0, 0, 4, 2,... etc.}

    These buffer values are correct for the first track on the floppy.  The
    sectors are in sequential order on the floppy.

    The lseek() function must be used to move to the next track.  For example,
    the following statement formats the fourth track of a high density 5.25-
    inch floppy disk:

    lseek(fd, 15 * 512 * 3, 0);

    The fourth track is the second cylinder on the second side.  Therefore, in
    the write() call, the cylinder number and head number should both be set
    to 1.

  FILES

    /dev/dsk/floppy       Block special file to access an entire 5.25-inch
                          floppy disk.

    /dev/dsk/ufloppy      Block special file to access an entire 3.5-inch
                          microfloppy.

    /dev/rdsk/floppy      Character special file to access an entire 5.25-inch
                          floppy disk.

    /dev/rdsk/ufloppy     Character special file to access and entire 3.5-inch
                          microfloppy.

    /dev/dsk/flopp?.?     Block special file to access a 5.25-inch floppy disk
                          with its associated partition.




  2/94 - Intergraph Corporation                                              3






  fl(7)                               CLIX                               fl(7)



    /dev/dsk/uflopp?.?    Block special file to access a 3.5-inch microfloppy
                          with its associated partition.

    /dev/rdsk/flopp?.?    Character special file to access a 5.25-inch floppy
                          disk with its associated partition.

    /dev/rdsk/uflopp?.?   Character special file to access a 3.5-inch
                          microfloppy with its associated partition.

  NOTES

    A device file with a partition number of 0 and a modifier number of 0
    always corresponds to the entire floppy as to the /dev/[r]dsk/floppy
    devices.

  RELATED INFORMATION

    Functions:  ioctl(2)

    Files:  floppypar(4)


































  4                                              Intergraph Corporation - 2/94




Typewritten Software • bear@typewritten.org • Edmonds, WA 98026