dksc(7M)

dks, jag - dksc (SCSI) disk driver

As shipped in IRIX 6.5. First release of IRIX 6.5.

NAME
     dks, jag - dksc (SCSI) disk driver

SYNOPSIS
     /dev/dsk/dks*
     /dev/dsk/jag*
     /dev/rdsk/dks*
     /dev/rdsk/jag*

DESCRIPTION
     There can be up to seven SCSI drives attached per SCSI bus (15 for
     controllers that support wide SCSI), each of which can support a number
     of logical units (luns).  The current limit is eight luns.  Each unit (or
     lun) can have up to 16 partitions in use, three of which (8, 9, and 10)
     are special (see below).

     Disk devices are named according to the following formats:

          /dev/rdsk/dkscontroller-#ddrive-#{spartition-#|vh|vol}
          /dev/rdsk/dkscontroller-#ddrive-#llun-#{spartition-#|vh|vol}
          /dev/dsk/dkscontroller-#ddrive-#spartition-#
          /dev/dsk/dkscontroller-#ddrive-#llun-#spartition-#
          /dev/rdsk/jagcontroller-#ddrive-#{spartition-#|vh|vol}
          /dev/dsk/jagcontroller-#ddrive-#spartition-#

     The rdsk devices use a raw interface to communicate with the disk, while
     the dsk devices use a block interface.  The controller-#, drive-#, and
     lun-# are used to indicate SCSI controller number, target ID, and logical
     unit number, respectively.  spartition-#, vh, and vol indicate a
     partition of the disk.  The vh and vol devices are only in the rdsk
     directory, since they are normally used only for ioctl and raw access.

     The standard partition allocation by Silicon Graphics has root on
     partition 0, swap on partition 1, and (optionally) /usr on partition 6.
     Some systems, such as the Indy, are shipped from the factory with a
     single filesystem on the system disk for ease of administration.  In this
     case, partition 6 is not used.  Partition 7 (when present), normally maps
     the entire usable portion of the disk (excluding the volume header).
     Partition 8 (vh) maps the volume header (see prtvtoc(1M), dvhtool(1M)).
     Partition 10 (vol) maps the entire drive.  Partition 9 is reserved, but
     is not used for disks with the dksc driver.  Devices are not created
     automatically by MAKEDEV for the other partitions, and if used, must be
     created manually, or by modifying MAKEDEV.

     The standard configuration has /dev/root linked to partition 0 of the
     system disk, with /dev/swap linked to partition 1 of the system disk, and
     /dev/usr linked to partition 6 of the system disk.  Systems that do not
     use partition 6 as shipped, instead using just the s0 and s1 partitions,
     still have a link made.  There is no attempt to make the link to the
     device used for the /usr filesystem in the fstab(4) file, if present,
     even if it uses a different device.  Option disks normally use the s7
     partition as a single filesystem, containing the whole usable portion of
     the disk.

IOCTL FUNCTIONS
     As well as normal read and write operations, the driver supports a number
     of special ioctl(2) operations when opened via the character special file
     in /dev/rdsk.  Command values for these are defined in the system include
     file <sys/dkio.h>, with data structures in <sys/dksc.h>.
     These ioctl operations are intended for the use of special-purpose disk
     utilities.  Many of them can have drastic or even fatal effects on disk
     operation if misused; they should be invoked only by the knowledgeable
     and with extreme caution!

     A list of the ioctl commands supported by the dks driver is given below.

     DIOCADDBB
          Adds a block to the badblock list.  The argument is the logical
          block number (not a pointer) on the drive.  For some makes of
          drives, the spared block must be written before the sparing takes
          effect.  Only programs running with superuser permissions can use
          this ioctl.

     DIOCDRIVETYPE
          The first SCSI_DEVICE_NAME_SIZE bytes (currently 28) of the SCSI
          inquiry data for the drive is returned to the caller.  The argument
          is a pointer to a char array of at least this size.  This contains
          vendor and drive specific information such as the drive name and
          model number.  See a SCSI command specification for details on the
          structure of this buffer.

     DIOCFORMAT
          Formats the entire drive.  Any information on the drive is lost.
          The grown defect list (blocks spared with DIOCADDBB) is empty after
          formatting is complete, blocks previously in the grown defect list
          are no longer spared.

     DIOCGETVH
          Reads the disk volume header from the driver into a buffer in the
          calling program.  The argument in the ioctl call must point to a
          buffer of size at least 512 bytes.  The structure of the volume
          header is defined in the include file <sys/dvh.h>.  The
          corresponding call DIOCSETVH sets the drivers idea of the volume
          header; in particular, the drivers idea of the partition sizes and
          offsets is changed.

     DIOCPREVREM
          Issues a PREVENT ALLOW MEDIA REMOVAL command to the opened device.
          The first bit of the arg is or'd into byte 4 of the SCSI command.
          See a SCSI command specification for details on this command.

     DIOCRDEFECTS
          The argument is a pointer to a struct dk_ioctl_data.  The i_addr
          field points to a structure like:
               structure defect_list {
                    struct defect_header defhdr;
                    struct defect_entry defentry[NENTS];
               };

          The i_len field is set to the total length of the structure, which
          must be less than NBPP from <sys/param.h>; at most NENTS defects are
          returned.  The actual number of defects can be determined by
          examining the defhdr.defect_listlen value, which is the number of
          bytes returned.  This must be divided by the size of the applicable
          data structure for the type requested.  The i_page field should be
          set to the bits identifying the badblock reporting type.  These bits
          request the combination of manufacturer's and grown defects; and one
          of bytes from index, physical cyl/head/sec, vendor unique.  The only
          combination that works with all currently supported SCSI disks is
          type cyl/head/sec; and either combined manufacturer's and grown
          defects, or just manufacturer's defects.

     DIOCREADCAPACITY
          The arg is a pointer to an unsigned integer.  The value returned is
          the number of usable sectors on the drive (as read from the drive).

     DIOCSCSIINQ
          The arg is a pointer to a char array at least SCSI_INQUIRY_LEN bytes
          long.  The SCSI inquiry data from the device is copied to this
          buffer.  See a SCSI command specification for details on the
          structure of this buffer.

     DIOCSENSE / DIOCSELECT
          The argument is a pointer to a struct dk_ioctl_data.  This allows
          sending SELECT and SENSE commands to the drive.  See the ANSI SCSI
          specification and individual manufacturer's manuals for allowed page
          numbers and valid values.  Only programs running with superuser
          permissions can use the DIOCSELECT ioctl.

     DIOCSTARTSTOP
          This command issues a SCSI STARTSTOP command to the opened device.
          The first two bits of the arg are or'd into byte 4 of the SCSI
          command.  See a SCSI command specification for details on this
          command.

     DIOCTEST
          issues the SCSI "Send Diagnostic" command to the drive.  The exact
          tests done are manufacturer specific.  The ioctl call returns 0 upon
          success, or sets errno to EIO and returns -1 upon failure.

FILES
     /dev/dsk/dks*
     /dev/rdsk/dks*
     /dev/dsk/jag*
     /dev/rdsk/jag*
     /dev/root
     /dev/usr
     /dev/swap

SEE ALSO
     dvhtool(1M), fx(1M), prtvtoc(1M).

NOTE
     The driver attempts to negotiate synchronous SCSI mode with the drive
     when it is opened.  When supported by the drive, this results in greater
     disk throughput, and better SCSI bus utilization when multiple devices
     are attached to the SCSI bus.  If problems occur because of this (due to
     use of unsupported drives that don't properly handle this negotiation),
     you can disable this negotiation by changing the wd93_syncenable and
     wd93_syncperiod variables in the file /var/sysgen/master.d/wd93 as
     described by the comments in that file, and linking a new kernel with
     lboot(1M).

     Another variable of possible interest in /var/sysgen/master.d/wd93 is
     wd93_enable_disconnect.  If this variable is set to 0, the SCSI host
     adapter is programmed to NOT support device disconnects.  This can be
     useful with devices that don't support disconnect, which might otherwise
     cause SCSI bus timeouts.  It is also useful with devices that purport to
     support disconnect, but which don't work correctly when it is enabled.
     The capability to configure these features is not currently supported for
     the jag controllers.  See the wd95_bus_flags array in
     /var/sysgen/master.d/wd95 for similar capabilities on the wd95 scsi bus.

     The kernel automatically disables the synchronous SCSI mode for systems
     that do not support this feature regardless of what is set in
     wd93_syncenable.