WRITING A DRIVER
5-2
5
Return from the SCSI firmware to the driver is done through the vector
supplied in the packet. The VERSAdos driver uses vector $4E (offset $138),
and tape driver uses vector $4D (offset $134). These vectors must be initialized
to point to a driver routine which handles the return. Refer to the Interface
Rules for the SCSI Firmware section in this chapter for details on the return.
The SCSI firmware can accept six commands (average) per peripheral device.
A busy error may be returned if too many commands are received for a device
depending on the firmware current activities. Until one command has been
completed, or abnormally terminated, no other command may be dispatched
to the firmware. Commands to any other device may be issued after a "wait
for interrupt (open)" ($02) intermediate status, or final status is returned from
the SCSI firmware to the driver. For more information, refer to the Interface
Rules for the SCSI Firmware section in this chapter.
Figure 5-1. SCSI Disk Driver Interface to VERSAdos
Figure 5-2. SCSI Disk Driver
Building the Packet
Chapter 2 provides the details necessary to build the command packet. After
the packet has been built, it needs to be passed to the SCSI firmware.
Passing Commands to the SCSI Firmware
Passing control from the driver to the SCSI firmware can be done by jumping
directly to the firmware from the driver. The return from the firmware back
to the driver is through the vector supplied within the packet. Because the
SCSI firmware can only accept six commands (average) for each device, you
may need to do internal queuing if more commands need to be sent to a
particular device.
Interface Rules for the SCSI Firmware
SCSI firmware may be called by single or multiple callers.
A single caller to the SCSI firmware is a driver or a server that provides a
single return path from the firmware. In other words, a single SCSI return
routine handles the status codes that the firmware passes. This definition does
not imply that only one return routine is used for interpreting status