ASPI Developer Common Questions and Answers Q. What is ASPI? A. "ASPI" stands for Advanced SCSI Programming Interface. It is an Adaptec- developed interface specification for sending commands to SCSI host adapters. The interface provides an abstraction layer that insulates the programmer from considerations of the particular host adapter used. With ASPI, software drivers can be broken into two components: the low- level ASPI manager, which is OS and hardware dependent, and the ASPI module. The ASPI manager accepts ASPI commands and performs the steps necessary to send the SCSI command to the target. For example, although the Adaptec AHA-152x and AHA-274x host adapters have very different hardware, the ASPI interface to these boards is the same. (Obviously, Adaptec's code that implements the ASPI interface, e.g., ASPI2DOS.SYS, for each board is quite different.) The ASPI Module is tailored to the command set of a particular peripheral, such as CD-ROM. Although an ASPI-based CD-ROM driver would have to handle the differences between different CD-ROM drives, it would not have to handle host adapter differences. Q. What tools does Adaptec provide for ASPI developers? A. Adaptec has developed an ASPI Software Developer's Kit, with the ASPI specification for DOS, Windows, OS/2, and Netware. The kit includes source code for DOS, Windows, and OS/2, which allows new developers to "hit the ground running" on ASPI development. For more information on the ASPI SDK, see the summary file on the BBS: ASPI Developer file library, filename ASPI_DEV.TXT. The ASPI interface specifications are available on the Adaptec BBS, (408)-945-7727, in the ASPI Developer file library. Q. What compilers are compatible with the ASPI SDK? A. The C sample source code in the kit was compiled using Microsoft C v6.0. The assembler code was compiled using MASM 5.1 (Microsoft assembler). There is no reason why other assemblers or C compilers couldn't be used with minor modifications. (There are certain limitations on compilers for OS/2 device drivers. See the OS/2 section below.) Q. Does a high-level library exist for ASPI calls or SCSI commands, like C or Visual Basic? A. Adaptec does not produce such a library. The sample code in the SDK for Windows is in C, so that code should be easy to modify for your needs. Q. Does ASPI support Re-entry? If so, what is the maximum number of commands that I can queue up? A. Yes, ASPI does support re-entry. Up to 255 commands may be queued. ASPI will return from a request immediately, as the request is queued for execution in the ASPI manager. There is also support for multi-threaded I/O. Q. Does ASPI support tag queuing? Or Asynchronous Event Notification (AEN)? A. No. Q. The SCSI specification supports 6, 10, and 12 byte CDBs. What does ASPI support? A. ASPI will support any length CDB. There is a field in the SRB to specify the length of the CDB. Q. Are SCSI resets allowed through ASPI? A. No. Bus device resets are available through ASPI, but not SCSI bus resets. Bus resets are the responsibility of the ASPI manager and the Host Adapter. ASPI does not support bus resets due to the danger of disrupting other processes that may be active on other peripherals. Q. Does the SendASPI Command function with command code SC_ABORT_SRB actually send a SCSI ABORT message to the target device? A. Not immediately. The ASPI manager clears the SRB internally, returns to the caller, and then waits until the target reconnects to send the ABORT message. To force an abort on the device, some tape vendors send the SC_ABORT_SRB, wait until it completes, and then send a bus-device reset to clear the device of the outstanding command. Q. If I am trying to print a large file to a SCSI printer, is it possible to send a single CDB and have ASPI wait for all the additional data without sending an additional CDB? A. No, neither SCSI nor ASPI are designed to operate in this manner. You should send multiple CDBs to the printer as the data is available. Q. How do I transfer large amounts of data to maximize performance, amounts larger than 64k? A. You can create a buffer up to the size of total space available. You will know when you reach this size when you receive the "Buffer_Too_Big" error. Then, break your data transfer into the appropriate size chunks. Create and fill your buffer, transfer the data and issue the appropriate CDB (command descriptor block), then loop and do it again until all data is sent. ASPI does not support sending just data without a CDB. DOS Q. Is it possible that I could use ASPI to transfer data from a scanner into extended memory? A. Not in ASPI for DOS. You could do double-buffering, though. Read 16K into your DOS buffer, move into extended memory, etc. If you are writing a Windows application, then you can use ASPI for Windows which will work with extended memory. ASPI for DOS is designed for "Real Mode" operation. In real mode, the maximum address that can be generated is 1 MB + 64 KB. The ASPI driver does not switch CPU mode. You can use memory management software or BIOS Service (INT 15h, ah=87h) to achieve this goal. Windows Q. What is VDS? A. VDS stands for Virtual DMA Services. It is a standard created by Microsoft, developed so that bus master devices can obtain the physical address of memory. In protected mode, using virtual memory, the virtual address (what the application uses) is usually different from the physical address of the memory. VDS eliminates the need for double buffering, thus increasing overall system performance. All of Adaptec's ASPI managers support VDS. OS/2 Q. If I am developing a device diver for OS/2, should I program to ASPI? And if yes, how? A. If you are familiar with the ASPI interface and have done development with ASPI before, you probably would want to develop to the ASPI specification for OS/2. Also, if you are starting with an OS/2 project but know you will be doing development under DOS/Windows/Netware eventually, you may want to dive into ASPI. Otherwise, it makes much more sense to program directly to the .ADD interface supported by IBM's OS/2 2.0 and above. You can get information on this SCSI interface from IBM/Boca Raton directly. If you choose to program to ASPI, you use the ASPI for OS/2 portion of the ASPI specification, and Adaptec provides and "ASPI-to-ADD" translation layer during execution from our side (i.e. from the host adapter software manager side). Q. Can I use any compiler for developing OS/2 device drivers? A. No. Your compiler must be capable of producing 16-bit code, (e.g., Microsoft C 6.0). Q. Can a DOS program access ASPI from inside an OS/2 DOS box? A. It can with Virtual ASPI for OS/2, a virtual device driver that passes requests down to OS2ASPI.DMD. The beta for this is available on the Adaptec BBS: file library OS/2, filename VASPBETA.EXE. Miscellaneous Q. Does Adaptec have a developer program? A. Yes. If you would like information on our developer program (Adaptec Compatibility Advantage Program), please call 800-934-2766 and request the ACAP - Developer Information pack. You may also request the "ACAP Program Application" from an interactive fax system at (408)-957-7150. Q. Does Adaptec have information on the SCSI commands supported by different SCSI devices (tape, WORM, CD-ROM)? A. No. 90% of your ASPI programming work is dependent on your understanding of the SCSI commands supported by your particular device and the SCSI specification in general. It is crucial that you secure documentation on this support from your device manufacturer directly. Also, you will need a copy of the SCSI specification that gives information about the CDBs (command descriptor blocks) which correspond with each SCSI command, among other important information. You can get a copy of the specification for SCSI-1, CCS, and SCSI-2 from the following: American National Standards Institute 1430 Broadway NY, NY 10018 or Global Engineering Documents 3130 S. Harbor Blvd., Ste 330 Santa Ana, CA 92704 Phone: 800-854-7179 or 714-979-8135 Q. What does I need to do if I want to write a peripheral device driver for UNIX? A. If you are doing development under UNIX, you do not need the ASPI developer's kit. Each UNIX vendor provides its own SCSI device driver programming methodology. You should call your UNIX vendor directly for SCSI device driver information, rather than Adaptec. Literature Adaptec Literature Hotline (800)-934-2766 or (510)-732-3829 Adaptec Interactive Fax Server (408)-957-7150 Europe: Adaptec Brussels 32-26781911 (voice) or 32-26602836 (fax) File revised 9/2/94