Document No. E00143R0

INT 13 command: SCSI Pass Through

Proposal

8/25/2000

To: T13 Membership

From: Ron Roberts, Adaptec Corp.

Subject: EDD 3.0 comment

Referencing the EDD specification, Rev 3.0 Feb 18, 2000 section 6.11, the Send Packet Command is defined. This command is adequate for implementing the SCSI pass through commands. This proposal describes a common method for issuing CDBs to a SCSI device. This allows a mechanism to issue any command to a SCSI device through the Adaptec SCSI BIOS.

There are two possibilities when the SCSI BIOS is not available: 1. The user may choose to disable BIOS in SCSISelect. 2.The the BIOS will not be install if there is attached INT 13 device found.

INT 13 command: SCSI Pass Through

Functional Specification (Rev 0.3)

5

Sau Kuen Eng

7/57/2000

Adaptec Inc., 2000

Adaptec Revision History

Date / Revision Number / Description
4/12/00 / 0.1 / Initial version.
6/13/00 / 0.2 / Added a variable for timeout. Changed sanity check to return number of SCSI channels in DX. Added function 2, SCSI channel information request. Added function 3, pass thru to SCSI channel/target/lun.
7/5/00 / 0.3 / Add a bit to indicate 32-bit linear addressing versa real mode segment offset

1.0 Introduction
It is the intention of this document to describe a common method for issuing CDBs to a SCSI device. This allows a mechanism to issue any command to a SCSI device through the Adaptec SCSI BIOS.

NOTE: There are two possibilities that the SCSI BIOS is not available: The first possibility is that user may choose to disable BIOS in SCSISelect. The next possibility is BIOS will not be install if there is attached INT 13 device found.

2.0 Reference documents

BIOS Enhanced Disk Drive Service (EDD) Specification Rev 3, Feb 18,2000

3.0 Overview Model

Referencing the EDD specification, section 6.11, the Send Packet Command is defined. The command is adequate for implementing the SCSI pass through commands.

3.1 SCSI Pass Through Sanity Check
The intent of the sanity check is to save time debugging and building the formatted packet data structure. A SCSI Pass Through Sanity Check is performed by a system or option ROM in the following manner.

AH = 50h

AL = 00h

CX = 55AAh

DL = Valid drive number supported by SCSI BIOS

On return if NOT supported:

Carry flag SET

AH = 01 (Invalid command)

CX=55AAh

On return if supported:

Carry flag CLEAR

AH = 0

CX = AA55h

SI = # of SCSI channels the BIOS supports

BX = SCSI BIOS code segment

3.2 SCSI Pass Through INT 13 devices.

AH = 50h

AL = 01h

DL = Drive number supported by SCSI BIOS (i.e. 80h, INT 13h controlled 1st drive,... )

ES:BX = Request packet buffer

Table 1 – Request packet

Offset / Length (bytes) / Description
0 / 2 / S=53h P=50h (5053h SCSI CDB signature)
2 / 1 / CDB length (e.g. 6, 10 or 12)
3 / 1 / Data Direction: bit 0 = 0 Read from device,
bit 0 = 1 Write to device
bit 7 = 0 Real mode seg:off addressing
bit 7 = 1 32-bit linear addressing
4 / 4 / Data transfer length
8 / 4 / Data buffer - segment:offset
12 / 1 / Host Adapter status
13 / 1 / Target status
14 / 1 / Sense data length
15 / 2 / Timeout value (18 units per second)
17 / 1 / Unused
18 / 12 / CDB
30 / N / Sense allocation area

3.3 SCSI Pass Through SCSI channels information
AH = 50h

AL = 02h

DL = Valid drive number supported by SCSI BIOS

ES:BX = SCSI channels information buffer

Table 2 – SCSI channels information

Offset / Length (bytes) / Description
0 / 2 / Buffer length (including buffer length)
2 / 2 / PCI address (Bus:Device:Function)
4 / 2 / Vendor ID
6 / 2 / Device ID
8 / 2 / Subsystem ID
10 / 8 / Hardware name
18 / 2 / # of SCSI targets attached
20 / 2 / PCI address for next channel
.. / ..

3.4 SCSI Pass Through SCSI targets

AH = 50h

AL = 03h

CL bit 0-3 = Target #

CL bit 6-4 = LUN #

CL bit 7 = reserved

CH = Channel # (zero based)

DL = Valid drive number supported by SCSI BIOS

ES:BX = Request packet buffer

3.5 BIOS Command Return Codes

Any INT13h request, upon completion, return control to the requestor with a return code set in the carry flag and a status code placed in AH.

CF= 0 Command completed with no error

CF= 1 Error

Table 2 – AH Status

AH (hex)Definition

00 No error

07Parameter Failure

80 Timeout

AADevice not ready

BBUndefined Failure

FFSense operation failed

The Target and Host Status tables are not required for the implementation of the SCSI Pass Through, however, vendor implementations that choose to implement a Target and/or Host Status shall follow the format outlined in Tables 3 and 4.

Table 3 – Target Status

Target Status (hex)Definition

00 No error

02Check condition

04Condition met

08 Target busy

10Intermediate command good

14 Intermediate condition met

18Reservation conflict

Table 4 – Host Status

Host status (hex) Definition

00 No error

04Command aborted by caller

05 Command aborted by HBA

11 Selection timeout

12 Data overrun/underrun error

13 Unexpected bus free

14 Target bus phase sequence error

1BAuto request sense failed

20 HBA hardware error

21 Target didn't respond to ATN(reset)

22 SCSI bus reset by HBA

23 SCSI bus reset by other device