Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ fd(7) — UnixWare 2.01

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

format(1M)

ioctl(2)






       fd(7)                                                          fd(7)


       NAME
             fd - floppy disk driver

       DESCRIPTION
             The floppy disk driver provides access to floppy disk drives
             as both block and character devices.  Floppy disks must be
             formatted before their use [see format(1M)].  Both 5.25- and
             3.5-inch floppy disk formats are supported.  The driver
             controls up to two floppy disk drives.  The minor device
             number specifies the drive number, the format of the floppy
             disk and the partition number.

          Files
             /dev/dsk/f0, /dev/rdsk/f0, ...
             /dev/dsk/f0t, /dev/rdsk/f0t, ...
             /dev/dsk/f05h, /dev/rdsk/f05h, ...
             /dev/dsk/f05ht, /dev/rdsk/f05ht, ...
             /dev/dsk/f05q, /dev/rdsk/f05q, ...
             /dev/dsk/f05qt, /dev/rdsk/f05qt, ...
             /dev/dsk/f05d16, /dev/rdsk/f05d16, ...
             /dev/dsk/f05d16t, /dev/rdsk/f05d16t, ...
             /dev/dsk/f05d9, /dev/rdsk/f05d9, ...
             /dev/dsk/f05d9t, /dev/rdsk/f05d9t, ...
             /dev/dsk/f0fd8, /dev/rdsk/f05d8, ...
             /dev/dsk/f05d8t, /dev/rdsk/f05d8t, ...
             /dev/dsk/f05d4, /dev/rdsk/f05d4, ...
             /dev/dsk/f05d4t, /dev/rdsk/f05d4t, ...
             /dev/dsk/f03e, /dev/rdsk/f03e, ...
             /dev/dsk/f03et, /dev/rdsk/f03et, ...
             /dev/dsk/f03h, /dev/rdsk/f03h, ...
             /dev/dsk/f03ht, /dev/rdsk/f03ht, ...
             /dev/dsk/f03m, /dev/rdsk/f03m, ...
             /dev/dsk/f03mt, /dev/rdsk/f03mt, ...
             /dev/dsk/f03n, /dev/rdsk/f03n, ...
             /dev/dsk/f03nt, /dev/rdsk/f03nt, ...
             /dev/dsk/f03d, /dev/rdsk/f03d, ...
             /dev/dsk/f03dt, /dev/rdsk/f03dt, ...

          Diagnostics
             To minimize errors when using floppy disks, the driver
             attempts to assure that the floppy disk is installed when
             needed, and that the operations requested have been completed
             before the device close is completed.  In particular, the
             drive is checked for the presence of a floppy disk each time a
             read/write request is made to the drive.  If this is not true
             (either the floppy disk is not physically present or the door


                           Copyright 1994 Novell, Inc.               Page 1













      fd(7)                                                          fd(7)


            is open), the driver retries the request continually, at
            five-second intervals.  The message:
                  FD(n): floppy disk not present - please insert

            appears after each attempt (the n represents the drive
            number).

            The INTR and QUIT signals are honored in this case, so that
            the process accessing the floppy disk drive in question will
            receive these signals (unless, of course, the process itself
            is ignoring them).  In particular, if the floppy disk is
            removed prematurely, or not inserted soon enough, no data is
            lost, provided the correct floppy disk is inserted in the
            drive when the message to do so is displayed.

            If the above message does appear, do the following: Use idtune
            to set FD_DOOR_SENSE to 0.  Unload the floppy driver by
            entering modadmin -U fd.  Rebuild the floppy driver by
            entering idbuild -M fd.  Reload the floppy driver by entering
            modadmin -l fd.  Then, retry the floppy access.

            The driver will retry failed transfers up to ten times.  If
            the request still has not succeeded, the driver will display
            an appropriate message.  Errors from the floppy disk
            controller, other than the above, are displayed as follows:
                 FD  drv n, blk b: drive error message
                 FD controller controller error message

            The first message occurs on an error after a transfer has
            begun, where n is the drive where the error occurred, and b is
            the block number that is being read or written.  The drive
            error message is one of the following messages:

                  Missing data address mark
                        The floppy disk may not be formatted properly.

                  Cylinder marked bad
                        The accessed cylinder has been marked bad by the
                        formatter.

                  Seek error (wrong cylinder)
                        The drive positioned itself at the wrong cylinder
                        when attempting to set up for the requested
                        transfer.




                          Copyright 1994 Novell, Inc.               Page 2













       fd(7)                                                          fd(7)


                   Uncorrectable data read error
                         A CRC error was detected when attempting to read
                         the requested block from the drive.

                   Sector marked bad
                         The accessed sector has been marked bad by the
                         formatter.

                   Missing header address mark
                         The floppy disk may not be formatted properly.

                   Write protected
                         A write was attempted to a floppy disk that is
                         currently write-protected.

                   Sector not found
                         The floppy disk may not be formatted properly.

                   Data overrun
                         The system could not keep up with the requested
                         transfer of data.  (This error should not occur.)

                   Header read error
                         The floppy disk may not be formatted properly.

                   Illegal sector specified
                         The driver is confused about the format of the
                         floppy disk that has been inserted.  (This error
                         should not occur.)

             The second message occurs when there is a controller error
             during the setup for, or actual transfer of, a block.  The
             controller error message is one of the following messages:

                   command timeout
                         The controller failed to complete the requested
                         command in a reasonable length of time.

                   status timeout
                         The controller failed to return its status after a
                         command was completed.

                   busy  During an attempt to access the controller, a
                         timeout occurred.




                           Copyright 1994 Novell, Inc.               Page 3













      fd(7)                                                          fd(7)


      USAGE
            Floppy disk device file names (which correspond to a specific
            major and minor device) use the following format:
            /dev/{r}dsk/f{0,1}{5h,5q,5d16,5d9,5d8,5d4,3e,3h,3m,3n,3d}{t,u}

            where r indicates a raw (character) interface to the floppy
            disk, rdsk selects the raw device interface and dsk selects
            the block device interface.  0 or 1 selects the drive to be
            accessed: f0 selects floppy drive 0, while f1 selects drive 1.
            The following list describes the format to be interacted with:

                  5h    5.25" high density floppy disk (1.2MB)

                  5q    5.25" quad density floppy disk (720KB)

                  5d16  5.25" double density floppy disk, 16 sectors per
                        track (320KB)

                  5d9   5.25" double density floppy disk, 9 sectors per
                        track (360KB)

                  5d8   5.25" double density floppy disk, 8 sectors per
                        track (320KB)

                  5d4   5.25" double density floppy disk, 4 sectors per
                        track (320KB)

                  3e    3.5" extra high density floppy disk (2.88MB)

                  3h    3.5" high density floppy disk (1.44MB)

                  3d    3.5" double density floppy disk (720KB)

            Format specification is mandatory when opening the device for
            formatting.  However, when accessing a floppy disk for other
            operations (read and write), the format specification field
            can be omitted.  In this case, the floppy disk driver will
            automatically determine the format previously established on
            the floppy disk and then perform the requested operation (for
            example, cpio -itv</dev/rsdk/f1).

            The last parameter, t or u, selects the partition to be
            accessed.  t represents the whole floppy disk.  Without t or u
            specified, the whole floppy disk except cylinder 0 will be
            selected.  u represents the whole floppy disk except track 0
            of cylinder 0 and applies only to the 5d8 type of floppy.


                          Copyright 1994 Novell, Inc.               Page 4













       fd(7)                                                          fd(7)


             Besides the device file naming convention described above,
             some of the formats have alias names that correlate to
             previous releases.  The following list describes the formats
             that have an alias:
                   format      alias
                   5h          q15d
                   5d8         d8d
                   5d9         d9d

             For example, the device file /dev/rdsk/f0q15dt is equivalent
             to /dev/rdsk/f05ht.

          ioctl Calls
             Following are the ioctl calls specific to the fd(7) driver:

             V_GETPARMS
                   This call is used to get information about the current
                   drive configuration.  The argument to the ioctl is the
                   address of one of the following structures, defined in
                   sys/vtoc.h, which will be filled in by the ioctl:
                   struct disk_parms {
                       char    dp_type;    /* Disk type (see below) */
                       unchar  dp_heads;   /* Number of heads */
                       ushort  dp_cyls;    /* Number of cylinders */
                       unchar  dp_sectors; /* Number of sectors/track */
                       ushort  dp_secsiz;  /* Number of bytes/sector */
                                   /* for this partition: */
                       ushort  dp_ptag;    /* Partition tag (not used) */
                       ushort  dp_pflag;   /* Partition flag (not used) */
                       ushort  dp_pstartsec;   /* Starting sector number */
                       ushort  dp_pnumsec; /* Number of sectors */
                   }
                   /* Disk types */
                   #define DPT_WINI    1   /* Winchester disk */
                   #define DPT_FLOPPY  2   /* Floppy */
                   #define DPT_OTHER   3   /* Other type of disk */
                   #define DPT_NOTDISK 0   /* Not a disk device */

                   For the floppy driver, the disk type will always be
                   DPT_FLOPPY.  The unused fields in the disk_parms
                   structure are only applicable to hard disks; however,
                   returning the same structure from both the hard disk
                   driver and the floppy disk driver allows programs to be
                   written that can understand either one.




                           Copyright 1994 Novell, Inc.               Page 5













      fd(7)                                                          fd(7)


            V_FORMAT
                  This call is used to format tracks on a floppy disk.
                  The argument passed to the ioctl is the address of one
                  of the following structures, defined in sys/vtoc.h,
                  containing the starting track, number of tracks, and
                  interleave factor:
                  union io_arg {
                      struct {
                          ushort  start_trk;  /* first track */
                          ushort  num_trks;   /* number of tracks
                                      to format */
                          ushort  intlv;      /* interleave factor */
                      } ia_fmt;
                  }

                  Formatting will start at the given track and will
                  continue so that the given number of tracks are
                  formatted, using the given interleave factor.

                  Note that the file descriptor must refer to the
                  character (raw) special device for the desired drive,
                  and the file must have been opened in exclusive mode
                  (that is, O_EXCL).

      REFERENCES
            format(1M), ioctl(2)






















                          Copyright 1994 Novell, Inc.               Page 6








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