SCSI Driver

The SCSI Driver is an open software interface (API) for accessing any peripheraldevice, not just SCSI devices. SATA drives for optical media like DVDs and BDs also use the SCSI command set. For other hardware interfaces, e.g. IDE or USB, SCSI commands can be emulated, just as HDDRIVER does for IDE and SATA hard drives. All in all, SCSI Drivers can be used to send any SCSI command to almost any interface.
The source code for the software on this page is available on GitHub.

HDDRIVER's usage of SCSI Drivers

Internally HDDRIVER consists of two driver layers: The SCSI Driver and the actual hard disk driver. The latter accesses devices exclusively via the SCSI Driver. This allows any device interface to be seamlessly integrated. The SCSI Driver can be one of HDDRIVER's built-in SCSI Drivers (for ACSI/SCSI/IDE/ATAPI/SATA), a third-party SCSI Driver, e.g. for USB, or a combination. If a SCSI Driver for bus 0 (ACSI), 1 (SCSI) or 2 (IDE) already exists when HDDRIVER is lauched, HDDRIVER automatically uses the existing SCSI Driver instead of its own to access this bus.
A Milan with PCI SCSI card provides a good example: For SCSI accesses HDDRIVER uses the Milan's PCI SCSI Driver, which is already available when HDDRIVER is launched. For IDE accesses HDDRIVER uses its own SCSI Driver for Milan IDE/ATAPI/SATA. With MagiCMac, MagicPC, Hatari and ARAnyM it is similar, provided that HDDRIVER is launched after the SCSI Driver for the respective platform/hardware.

Standard SCSI Driver Interface

HDDRIVER fully supports the current version 1.01 of the SCSI Driver interface. The documentation is available in ST GUIDE format and includes C and Modula-2 bindings.

Download SCSI Driver Documentation SCSI Driver documentation

A small weakness of the SCSI Driver interface is the limitation to LUNs 0-7 (SCSI sub-units) per device, although SCSI (but not ACSI) allows 32 LUNs. Thanks to a backward compatible extension for the SCSI Driver interface, all 32 SCSI LUNs can be used with HDDRIVER's SCSI Driver. More than 8 LUNs are supported by SCSI2Pi, for example.

Target Interface

HDDRIVER is the only driver that supports the SCSI Driver target interface: A TT or Falcon are detected as SCSI devices by other computers (including non-Ataris) and can execute standardized or self-defined SCSI commands.

SCSI Target Interface
The screenshot shows the device check of a TT, with a Falcon on the same bus. The TT (SCSI ID 7) is running HDDRIVER 11.06, the Falcon (SCSI ID 6) is running HDDRIVER 11.05. Both computers "see" each other, and one can execute SCSI commands sent by the other.

Sample code in C for implementing custom SCSI commands is provided on GitHub. For the target interface to function correctly, any software that accesses SCSI peripherals must do so via the SCSI Driver interface.

In the HDDRUTIL settings you can configure whether HDDRIVER shall be installed with or without target interface support. Without target support (the standard interface remains available) HDDRIVER uses about 3 KiB less RAM.

Implementations

Fully functional SCSI Drivers are available for the following hardware interfaces and emulators:

Interface/Emulator Software Package Author
Atari ACSI/SCSI/IDE HDDRIVER
CBHD/SCSIDRV.PRG
Uwe Seimet
Claus Brod, Steffen Engel
Atari ATAPI/SATA HDDRIVER Uwe Seimet
Milan IDE/ATAPI/SATA HDDRIVER Uwe Seimet
Milan SCSI Milan PCI SCSI Driver Michael Schwingen
MagiCMac MM_SCSI.PRG Steffen Engel, Thomas Tempelmann
MagiCPC SCSIDRIV.DLL Steffen Engel
Hatari (Linux SCSI/IDE/ATAPI/SATA/USB) NF_SCSI, see below Uwe Seimet
ARAnyM (Linux SCSI/IDE/ATAPI/SATA/USB) NF_SCSI, see below Uwe Seimet, Thorsten Otto

There are also other, possibly incomplete implementations with unknown status (e.g. for USB), which are not listed here. Unfortunately, the Firebee SCSI Driver has known bugs and therefore cannot be used by HDDRIVER and HDDRUTIL.
When implementing a new SCSI Driver, it is recommended to not only read the SCSI Driver specification but additionally the official SCSI standards. Information on the SCSI Driver interface is also provided in some of my papers for the German ST Computer magazine.

SCSI Driver for Hatari and ARAnyM

Download NF_SCSI SCSI Driver NF_SCSI 1.21

With Linux, this SCSI Driver allows direct access to mass storage devices. The webpage on emulators provides further information.

SCSI Driver Monitor

Download SCSI_MON SCSI Driver Monitor 1.50

SCSI_MON logs SCSI Driver calls, which helps to analyze errors or when implementing a new SCSI Driver. SCSI_MON also helps in understanding the SCSI and SATA software protocols.

SCSI Driver and Firmware Testsuite

Download SCSI Driver and Firmware Testsuite SCSI Driver and Firmware Testsuite 3.00

This archive contains several tools for testing SCSI firmware/emulations (especially SCSI-2 and newer) and some SCSI Driver functions, also for SCSI Drivers that support IDE/SATA drives or USB devices. The compatibility with SCSI-2 is tested, not the compatibility with HDDRIVER. The latter results from SCSI-2 compatibility. The testsuite furthermore displays a set of device properties.
The example logfile shows the data of devices that pass all tests: An IBM DDRS-39130 hard drive, a hard drive emulated by SCSI2Pi, a streamer emulated by SCSI2Pi and the target interface of HDDRIVER.

Example Logfile Example logfile