Copyright ã1994 by Christopher Wolf
($Id: IntroSCSI2Kit.rtf,v 0.4 94/12/06 03:38:22 chris Exp $)

SCSI 2 Kit

Introduction

The SCSI 2 Kit is a collection of classes, functions and header files used to provide easy access to SCSI 2 devices.  The SCSI 2 Kit is designed so that SCSI code can be written which will function without modification on either Motorola or Intel hardware despite the architectural differences in the SCSI implementations on those two machines.

SCSI 2 Kit Classes

The SCSI 2 Kit currently provides two classesÐthe SCSI super-class for controlling generic SCSI device functions and the DriveSCSI sub-class for accessing disk-drive specific SCSI functionality.  Additional sub-classes to provide device specific functionality for other device types can easily be added.  For an example of how to use these classes see the source code for the SCSI_Inspector.app which is distributed with this kit as part of the SCSI2_ToolKit.tgz archive.  (A CDSCSI sub-class is currently in progress but is not yet in a useful form.)

SCSI

The SCSI class is used for opening and closing the SCSI driver, selecting a  SCSI device, retrieving error and status information, sending low-level SCSI commands and sending pre-packaged SCSI commands which are implemented by all device types.  The SCSI class also contains several methods designed to make implementing sub-classes easier.

DriveSCSI

The DriveSCSI class is used for finding and issuing pre-packaged commands to disk-type SCSI devices.  This class currently only has a few methods since much of the necessary functionality is contained in the parent SCSI class.  This class serves as an example of how to implement sub-classes of the SCSI class.

SCSI 2 Kit Functions

The SCSI 2 Kit provides six functions designed to simplify dealing with the byte ordering differences that exist between the Intel and Motorola architecture which are often encountered when writing low-level SCSI device code.   The functions allow reading and writing of big-endian values (assumed by the SCSI standard) in an architecture independent manner.  Programs which use these functions to read and write multi-byte values used in SCSI control structures will work without modification on both the little-endian Intel and big-endian Motorola architecture.  

SCSI 2 Kit Headers

The SCSI 2 Kit also provides a header file "scsi2reg.h" which defines many important structures and constants used when dealing with the SCSI 2 standard.  The definitions in this file supercede the definitions in the <bsd/dev/scsireg.h> header file and the <bsd/dev/scsireg.h> file should NOT be included in any programs which make use of the SCS2 Kit.

Note: multi-byte big-endian integer structure elements defined in "scsi2reg.h" are flagged with the suffix _BExx and must be accessed with the functions provided by SCSI 2 Kit in order to ensure architectural independence of your code.