                                               Proposal for Plug and Play SCSI
                                                                 Specification

                                                                  Version 0.95
                                                              October 14, 1993

















Copyright 1993 by Adaptec, Digital Equipment Corporation, Future Domain, 
Maxtor, Microsoft, and NCR Corporation.


Permission is granted to copy and distribute this document for purpose of 
review, comment, and development of SCSI PnP products.


POINTS OF CONTACT:

Vince Bastiani      EMAIL      71053.3431@compuserve.com
Adaptec             FAX            408-957-7145

Jeff Epstein        EMAIL      jeffe@fdc.mhs.compuserve.com
Future Domain       FAX            714-253-0913

John Lohmeyer       EMAIL       john.lohmeyer@ftcollinsco.ncr.com
NCR                 FAX            719-597-8225

Larry Lamers        EMAIL      larry_lamers@maxtor.com
Maxtor              FAX            408-432-3833

Steve Timm          EMAIL      stevetim@microsoft.com
Microsoft           FAX            408-936-7329

Plug and Play Forum -  login to compuserve, enter 'go plugplay', leave 
messages in SCSI/IDE section.

SCSI BBS            719-574-0424
SCSI Reflector      scsi@wichitaks.ncr.com


TABLE OF CONTENTS  {Page Numbers not accurate for ASCII version}
1.      Scope                                          7
2.      Reference  documents                           7
3.      Glossary and Abbreviations                     7
3.1.      Glossary                                     7
3.2.      Abbreviations                                8
4.      Conformance                                    8
5.      Hardware                                       8
5.1.      Connectors                                   8
5.2.      Cables                                       8
5.3.      Terminator requirements                      8
5.4.      SCSI ID assignment                           9
5.4.1.      Automatic SCSI ID assignment               9
5.4.2.      Default SCSI ID's                          9
5.4.3.      SCAM ID assignment algorithm               10
6.      System configurations                          10
6.1.      Internal configuration                       10
6.2.      External configuration                       11
6.3.      Mixed configuration                          11
7.      Software                                       11
7.1.      Geometry translation                         11
7.2.      Drive number assignment                      11
7.3.      READ CAPACITY command                        12
7.4.      INQUIRY command                              12
7.5.      Synchronous negotiation                      12
7.6.      Virtual DMA services (VDS)                   12
7.7.      Device driver architecture                   12
7.8.      Software configuration                       12
APPENDIX A - CHS mapping                               13
APPENDIX B - CD-ROM SCSI command profile               15
APPENDIX C - Checklist of compliance requirements      16


LIST OF TABLES
Table 1 -  Legacy SCSI device ID assignment            9
Table 2 - As shipped SCSI ID assignment                10
Table D-1 - CD-ROM SCSI commands                       15

LIST OF FIGURES
Figure 1 - Internal configuration                      10
Figure 2 - External configuration                      11
Figure 3 - Mixed configuration                         11


Foreword

The Plug and Play SCSI effort was undertaken as an extension to Plug and Play 
ISA.  Microsoft encouraged host adapter manufacturers to participate in this 
effort to develop an easy to use SCSI environment in the personal computer 
marketplace.

SCSI offers a cost-effective, high-performance interface for storage devices 
and permits attachment of external devices such as CD-ROMs, scanners, and 
printers.

PnP SCSI is a profile, not a standard.  It references the SCSI-2 standard and 
portions of the draft SCSI-3 standards.  PnP SCSI selects specific options and 
features from these documents.

If there is sufficient interest, this specification will be submitted to an 
accredited standards committee for processing as a technical report.  

Companies which contributed to developing the initial draft specification 
include:  Adaptec, Digital Equipment Corporation, Future Domain, Maxtor, 
Microsoft, and NCR Corporation.

Introduction

SCSI is designed to accommodate a broad range of applications and performance 
levels.  This results in multiple choices for such items as connectors, 
cables, termination, etc.  These choices can lead to incompatibilities.  This 
specification defines a profile for  personal computing environments that 
eases the integration task and promotes compatibility of conforming devices.  
PnP SCSI systems are easier to configure because the configuration choices are 
simplified.  Adding a PnP SCSI device to a PnP SCSI system requires no special 
skills or knowledge.

PnP SCSI simplifies termination by making proper termination a side effect of 
cabling the system.  Terminators are not included in SCSI peripheral devices; 
thus the confusion over the presence of a terminator and the possibility of 
excessive terminators are eliminated.

PnP SCSI eliminates the problem of setting unique SCSI IDs through use of an 
automatic ID assignment protocol called SCAM.  Legacy SCSI devices are 
permitted to coexist with newer SCAM devices by using an ID assignment 
convention for the peripheral device class.

PnP SCSI specifies the SCSI 50-position high-density shielded connector for 
all external connectors and requires that the cables meet the SPI draft 
standard.  This eliminates the confusion that  previously existed with the 
multiplicity of connector and cable choices.

Command set profiles are under consideration for inclusion PnP SCSI.  An 
example for CD-ROM devices is included in annex B.

This specification is part of the PnP family and is designed to facilitate 
usage of Small Computer System Interface (SCSI) on personal computing 
products. This document is an open, public specification supplementing 
existing SCSI specifications. This specification is platform and operating 
system independent.

Products conforming to the requirements herein are termed PnP SCSI.


1.      Scope

This specification defines requirements for building Plug and Play SCSI host 
adapters, cables, and peripheral devices by establishing a profile for 
personal computing applications.  This common profile simplifies integration 
and configuration of SCSI systems. This specification is a profile of the 
SCSI-2 standard and the SCSI-3 Parallel Interface (SPI) draft standard. 

2.      Reference  documents

Common Access Method Transport and SCSI Interface Module [X3.232-199x]
Small Computer System Interface - 2 [X3.131-199x]
SCSI-3 Parallel Interface [X3T9.2/855D]
      The above documents are available from:
            Global Engineering Documents
            15 Inverness Way East
            Englewood, CO 80112-5704
            Phone: (800) 854-7179  Outside USA and Canada: (303) 792-2181
            FAX: (303) 792- 2192

SCSI Configured AutoMagically [X3T9.2/93-109r5]
      The above document is available from the SCSI BBS 719-574-0424

Advanced SCSI Programming Interface 
      The above document is available from the Adaptec BBS 408-945-7727.

Mini-Port Driver Developer Kit
INT 13 Extensions
ISA Plug and Play
Virtual DMA Services
      The above documents are available from Microsoft at 1-800-227-4679.

In addition, several of the documents are available in the Plug and Play forum 
on CompuServe.

3.      Glossary and Abbreviations

3.1.      Glossary

Host - A personal computer system that contains a host adapter and zero or 
more SCSI peripheral devices.

Host adapter - either an embedded or add-in SCSI device that acts as an 
initiator.

Legacy SCSI device - an SCSI device implemented prior to this specification 
that does not conform to PnP SCSI.

SCSI peripheral device - an SCSI device other than a host adapter that does 
not include an enclosure, power supply, or external connector.

Peripheral subsystem - an enclosure that contains one or more SCSI peripheral 
devices.

Internal terminator - the terminator that exists within the host that 
terminates the internal  end of the SCSI bus.

External terminator - the terminator that exists on the last peripheral 
subsystem that terminates the external end of the SCSI bus.

Exit-point terminator - an electronically switchable terminator that exists at 
the 50-pin high-density connector on hosts that support both internal SCSI 
peripheral devices and external peripheral subsystems.

3.2.      Abbreviations

ASPI - Advanced SCSI Programming Interface
CAM - Common Access Method
ISA - Industry Standard Architecture
PnP - Plug and Play
SCAM - SCSI Configured AutoMagically
SCSI - either SCSI-2 or SCSI-3.
SPI - SCSI-3 Parallel Interface
VDS - Virtual DMA Services

4.      Conformance

Products are required to meet all applicable sections of this specification to 
claim conformance with PnP SCSI.  Host adapters that use an ISA bus are 
required to comply with PnP ISA.

An exemption to section 6.3 requiring automatic switching of exit-point 
termination is allowed until July 1, 1994.  In this case the exit-point 
termination must be configurable via software utility.

5.      Hardware

This PnP SCSI specification is intended for use with single-ended SCSI 
devices.  All PnP SCSI devices are required to use drivers and receivers which 
meet the specifications defined in single-ended alternative of the SCSI-3 
Parallel Interface.

All PnP SCSI devices are required to implement SCSI Bus parity as defined in 
the SCSI-2 standard.

5.1.      Connectors

All hosts and SCSI peripheral subsystems are required to use the 50-position 
high-density shielded connector for external connections.  See the SCSI-2 
standard (section 5.3.2.1, shielded connector alternative 1 - A cable).

5.2.      Cables

All cables used in PnP SCSI system must meet the cable specifications defined 
in clause 6 (SCSI bus cables) of the SCSI-3 Parallel Interface draft standard.

5.3.      Terminator requirements

This section defines the requirements of the terminator and terminator power.  
Section 10 defines the location of terminators in system configurations.

All terminators in PnP SCSI systems shall conform to the terminator 
requirements in the SCSI-3 Parallel Interface document over the TERMPWR 
voltage range of 4.0-5.25 Vdc.  Such terminators are often referred to as 
alternative 2, regulated, or active terminators.

The host and the peripheral sub-system should provide terminator power 
(TERMPWR) to the SCSI bus.  All terminators must be powered from the TERMPWR 
line(s) in the SCSI bus.

Note - Exceptions may be necessary for  battery operated devices and PCMCIA 
PC-Cards.

Devices providing TERMPWR must provide a positive-temperature-coefficient 
device to limit the maximum amount of current sourced instead of a fuse.  Such 
a device opens the circuit when excessive current is drawn and closes the 
circuit when the device cools.

Only terminators may draw power from TERMPWR.

5.4.      SCSI ID assignment

Each device on the SCSI bus requires a unique SCSI identifier or ID.  ID 
conflicts, indeterminate switch settings and location of ID switches on the 
devices complicate the process of configuring the SCSI bus. An automated SCSI 
ID assignment technique is the ideal solution to the problem of users 
inadvertently assigning multiple devices to a single ID.

5.4.1.      Automatic SCSI ID assignment

The X3T9.2 committee has voted to include a protocol, SCSI Configured 
AutoMagically (SCAM), into the SCSI-3 Parallel Interface draft standard to 
automatically assign device ID's.  All PnP SCSI devices are required to 
conform to level 1 of this document and level 2 conformance is recommended.

The SCAM protocol is designed so that legacy devices can be detected and used.  
If more than one legacy device is present, the user must ensure that they do 
not have SCSI ID conflicts.  Devices that support SCAM function correctly in 
legacy systems.

5.4.2.      Default SCSI ID's

PnP SCSI devices implementing SCAM are compatible with legacy devices.  To 
minimize the risk of ID conflicts between legacy devices, ID assignment by 
convention is recommended for different classes of devices as shown in Table 
1.

     Table 1 -  Legacy SCSI device ID assignment
        +---------------------------------------+
        | SCSI ID | Legacy SCSI Device          |
        |---------+-----------------------------|
        |    7    | Host Adapter                |
        |    6    | External Disk Drive         |
        |    5    |                             |
        |    4    | Tape or R/W Optical         |
        |    3    | CD-ROM                      |
        |    2    | Scanner/Printer             |
        |    1    | Docking Station Disk Drive  |
        |    0    | Internal Disk Drive         |
        +---------------------------------------+

It is also important for SCAM devices to have a default ID setting in case 
they are used on a SCSI bus that does not use a SCAM master host adapter.  
Therefore, default IDs listed in table 2 are required settings for all PnP 
SCSI devices as shipped from the factory.

     Table 2 - As shipped SCSI ID assignment

        +---------------------------------------+
        | SCSI ID | PnP SCSI Default ID         |
        |---------+-----------------------------|
        |    7    | Host Adapter                |
        |    6    | Disk Drive                  |
        |    5    |                             |
        |    4    | Tape or R/W Optical         |
        |    3    | CD-ROM                      |
        |    2    | Scanner/Printer             |
        |    1    |                             |
        |    0    |                             |
        +---------------------------------------+

 
5.4.3.      SCAM ID assignment algorithm

SCAM masters should assign the same SCSI ID to SCAM devices as previously 
assigned to the SCAM device to ensure consistent ID assignment.  If the SCAM 
master is unable to maintain a non-volatile device table or there has been no 
previous ID assignment, then the following algorithm should be used:

The SCAM master shall assign the SCAM device its requested default ID (from 
the second byte of the type code) if it is not already assigned.  If the 
requested ID is assigned, then the SCAM master shall assign the next lower 
available SCSI ID.  If no lower SCSI IDs are available, the SCAM master shall 
assign the highest available SCSI ID.

6.      System configurations

Plug and Play requirements exist for three possible configurations:

a) Internal configuration - all SCSI peripheral devices are internal to the 
                            host enclosure.
b) External configuration - all SCSI peripheral devices are external to the 
                            host enclosure.
c) Mixed configuration - a combination of internal and external SCSI 
                         peripheral devices.

PnP SCSI peripheral devices shall not terminate the SCSI bus.

PnP SCSI peripheral subsystems attached to the SCSI bus shall be terminated by 
plugging an external terminator into the only open connector on the last 
peripheral subsystem on the bus.

6.1.      Internal configuration

An example of an internal configuration using an add-in SCSI host adapter is 
shown in figure 1.  The host adapter and internal terminator supply the 
necessary termination.  The internal terminator should be as close as possible 
to the last SCSI peripheral device; the distance in the figure is exaggerated 
for clarity.


             {Figure not included in ASCII version of this file}

                      Figure 1 - Internal configuration

The internal SCSI bus is routed as necessary within the PC, complying to the 
rules in SPI, to one or more SCSI devices.  The end of the internal SCSI bus 
ends with a shielded 50-position high-density SCSI device connector as defined 
in SPI.  At or near this 50-position connector, there must be a switchable 
terminator, which is enabled if there are no external peripheral subsystems.

Keyed connectors are required on the host adapter or motherboard and the 
cables to ensure that the cable is plugged in correctly (not reversed or 
shifted).  Systems with backplane SCSI buses are required to meet the 
electrical requirements of the SCSI-3 Parallel Interface document, 
particularly with respect to characteristic impedance.

6.2.      External configuration

An example of an external configuration using an add-in SCSI host adapter is 
shown in figure 2.  The internal and external terminator supply the necessary 
termination.

             {Figure not included in ASCII version of this file}

                      Figure 2 - External configuration

External PnP SCSI peripherals are required to provide two 50-position high-
density shielded connectors on the enclosure.  The SCSI bus internal to the 
enclosure is routed from one external SCSI connector to the SCSI device(s) 
within the enclosure and then to the second external SCSI device connector.

One external terminator must be installed on the last SCSI peripheral 
subsystem.  The user purchases the external terminator when installing the 
first SCSI peripheral subsystem.

6.3.      Mixed configuration

A system that combines internal and external devices on the SCSI bus is shown 
in figure 3.  The exit-point terminator must be disabled whenever an external 
cable is attached.

             {Figure not included in ASCII version of this file}
 
                        Figure 3 - Mixed configuration

The exit-point terminator is automatically enabled or disabled to correctly 
terminate the SCSI bus based on the absence or presence of an attached 
external cable.  This is accomplished through mechanical or electronic 
detection of the attached cable.

Note - A switchable terminator may be employed on a host adapter to serve as 
either the internal terminator (external-only configuration) or the host 
adapter terminator (internal-only configuration). In the mixed configuration, 
this terminator is disabled whenever an external cable is attached.

7.      Software

There are several software issues related to having a plug and play system.  
Some of these are addressed in the subsections that follow.  One that is not 
addressed is command sets for the specific device types.  Appendix B contains 
a CD-ROM command set profile as an illustration of what needs to be done.  
Profiles for other devices are being developed.

7.1.      Geometry translation

Host adapter option ROM's are required to support the logical block addressing 
as defined by the INT 13h BIOS extensions document.  For backward 
compatibility, SCSI option ROM's are required to support the current INT 13h 
functions as well. To determine the geometry for INT 13h function 08h, these 
option ROM's read the partition table from the disk at LBA 0 and if it exists 
as determined by the 55AAh signature at offset 1FEh, use the algorithm given 
in Appendix A to calculate the Cylinder-Head-Sector (CHS) values. If the 
partition table does not exist, SCSI option ROM's may use any algorithm to set 
the CHS values.

7.2.      Drive number assignment

Note - The assignment of drive numbers (80h-87h) and logical drive letters (A-
Z) and the relationship to SCSI IDs is not a completely settled issue.

Hosts are required to assign drive numbers based from the lowest SCSI ID 
upwards.  This preserves a consistency in the logical drive letters assigned 
by the operating system and maintains compatibility with existing installed 
base.

If a direct-access device is encountered during the scan and the maximum 
number of INT 13h drives has not yet been reached, the device is attached to 
INT 13h.

This scheme should also be used with floptical drives, but floptical devices 
are treated as floppy type devices (drive 0-3).

7.3.      READ CAPACITY command

A direct-access device is required to return the actual number of user-
accessible sectors on the drive.  This value does not include the sectors 
reserved for defect mapping.

7.4.      INQUIRY command

All devices are required to return INQUIRY data in a timely manner without 
excessive delays.  This enables a SCSI host to scan the SCSI bus and boot 
without significant delays.

NOTE - Historically, some SCSI devices when first powered up performed 
operations that delayed their response to selection for lengthy mechanical 
actions and device initialization (e.g., rewinding an inserted tape, spinning 
up the medium, etc.).  This behavior is not acceptable in a PnP SCSI 
environment.

7.5.      Synchronous negotiation

The synchronous negotiation protocol is required to be implemented as defined 
in SCSI-2.  If the device only supports asynchronous data transfers it 
responds with a MESSAGE REJECT message and does not hang the SCSI bus.

7.6.      Virtual DMA services (VDS)

PnP SCSI host adapters that support bus-mastering are required to support 
Virtual DMA Services (VDS) in the host adapter option ROM.  VDS solves the 
problem of mapping linear addresses (segment:offset) into physical addresses.  
VDS is not applicable to host adapters that do not use bus-mastering.

7.7.      Device driver architecture

A SCSI host adapter allows a user to hook up various devices (e.g. disk, tape, 
CD-ROM) to a single SCSI host adapter.  As an example, without a "manager" in 
control, the disk driver would fight with the CD-ROM driver for control of the 
one SCSI host adapter.  There are two primary protocols in use today to solve 
this problem.  These are ASPI and CAM. Windows NT and future windows OS's use 
their own SCSI protocol which is referred to as the Miniport interface.  It is 
recommended that vendors of host adapters supply drivers compatible with one 
or more of these layered driver architectures.

7.8.      Software configuration

All PnP host adapter configuration parameters are required to be configurable 
with a software utility.  The PnP ISA specification covers the host parameters 
that are configurable.  SCSI parameters that are configurable are required to 
be software controlled (example: Synchronous Negotiation).


APPENDIX A - CHS mapping

Existing operating systems use a Cylinder-Head-Sector (CHS) mapping for 
"talking" to hard disk drives via INT 13h. These CHS values limit the maximum 
number of blocks on a disk to 1024 * 255 * 63 which is slightly less than 
eight Gigabytes. To overcome this, new operating systems have defined new 
partition table system type values. These values will be used for partition 
entries whose limits exceed the CHS mapping capabilities. 

The two new system types are 0Eh for primary partitions and 0Fh for extended 
partitions meeting the criteria above. These entries will have CHS values of 
0Fh and will use the LBA starting field (offset 08h in the partition entry) 
and the Length field (offset 0Ch) to describe the partition. Access to these 
partitions will be by the INT 13h extensions as defined by Microsoft. The 
following routine is pseudo-code for detecting an existing partition and 
calculating geometry using this information.

Partition table entry format

Offset  Description                     Variable
------  ---------------------------     -------------------------------
 00h    Boot indicator
 01h    Start Head                      StartHead
 02h    Start Sector/Cylinder           StartSector
 03h    Start Cylinder (low 8 bits)     StartCylinder
 04h    System type                     SystemType
 05h    Ending Head                     EndHead
 06h    Ending Sector/Cylinder          EndSector
 07h    Ending Cylinder (low 8 bits)    EndCylinder 
 08h    Starting sector                 StartingSector
 0Ch    Number of sectors in partition  NumSectors

Some other variables                    Description
--------------------------              ---------------------------------
Sectors                                 Sector value for CHS result
Heads                                   Head value for CHS result
Cylinders                               Cylinder value for CHS result
CHS                                     Short for StartHead, StartSector, and 
                                          StartCylinder
capacity                                Value returned from SCSI read capacity


void  GetCHS( void )
{
    ulong  logical_end;
    ushort Sectors;
    ushort Heads;
    ushort Cylinders;


For each drive
    Read Boot sector
    Validate Sector Signature (55AAh)
    Find Partition with largest logical start cylinder
        If no partitions found
            Use your own geometry routine
            exit

    if ((CHS == FF) || (SystemType == 0x0E) || (SystemType == 0x0F))
    {
        /* No Geometry is needed, use INT 13h Extensions */
        exit;
    }
    else 
    {
        Sectors = EndSector;
        Heads = EndHead + 1;
        logical_end = (EndCylinder * Heads * Sectors) +
                      (EndHead * Sectors) + Sectors;

        if (logical_end != StartingSector + NumSectors)
        {
            /* use your own geometry routine */
            exit;
        }

        Cylinders = capacity / (Heads * Sectors);
    }

    /* Now use the calculated Cylinders, Sectors, and Heads values. */
}

APPENDIX B - CD-ROM SCSI command profile

Note that all commands listed in the following table are required.  A 
compliant CD-ROM device must implement all the commands completely.  The SCSI-
2 Status column is purely for reference and not intended to imply that any of 
these commands are optional in this specification. 

          Table D-1 - CD-ROM SCSI commands
    +----------------------------------------------------------+
    |COMMAND NAME                 |Function      |SCSI-2 Status|
    |-----------------------------+--------------+-------------|
    |INQUIRY                      |12            |M            |
    |MODE SELECT (6)              |15            |O            |
    |MODE SENSE (6)               |1A            |O            |
    |PLAY AUDIO (10)              |45            |O            |
    |PLAY AUDIO (12)              |A5            |O            |
    |PLAY AUDIO MSF               |47            |O            |
    |PREVENT/ALLOW MEDIUM REMOVAL |1E            |O            |
    |READ (10)                    |28            |M            |
    |READ CD-ROM CAPACITY         |25            |M            |
    |READ SUB CHANNEL             |42            |O            |
    |READ TOC                     |43            |O            |
    |RELEASE                      |17            |M            |
    |REQUEST SENSE                |03            |M            |
    |RESERVE                      |16            |M            |
    |REZERO UNIT                  |01            |O            |
    |SEEK (10)                    |2B            |O            |
    |SEND DIAGNOSTIC              |1D            |M            |
    |START STOP UNIT              |1B            |O            |
    |TEST UNIT READY              |00            |M            |
    +----------------------------------------------------------+

SCSI-2 Status Codes
      M = SCSI-2 mandatory command
      O = SCSI-2 optional command


APPENDIX C - Checklist of compliance requirements

Host
      tbd

Peripheral subsystem
      tbd

Proposal for Plug and Play SCSI Specification      {PAGE|19}
