The device driver architecture for OS/2 2.x is structured so that targets controlled by an ADD must be allocated to an individual (DMD). For example, when the system boots, OS2DASD.DMD is usually the first device manager loaded, and it automatically searches for all available hard drives and permanently allocates them for use by the file systems. Other DMDs usually do something similar with targets that they assume should be controlled by them.
The standard method for preventing a DMD from allocating a particular target is through the use of command line switches on the ADD that handles the device. If you are planning to use ASPI to control a device that may be allocated by a DMD that loads before OS2ASPI.DMD, be sure to specify that the device manager in question is not allowed access to it.
BASEDEV=AHA154X.ADD /A:0 /!DM:6
BASEDEV=AHA154X.ADD /A:0 /!SM:6
Currently, only OS2DASD.DMD and OS2SCSI.DMD can be controlled in this manner because they are the only DMDs to be mentioned in IBM's specification for ADDs. For a complete explanation of command line switches supported by the ADD that are provided with OS/2 2.1, search for SCSI in the OS/2 Command Line Reference. Device managers can handle allocations in one of two ways: wait for a device driver to issue an allocation request (OS2SCSI.DMD performs this) or permanently allocate the device during system boot (OS2DASD.DMD and OS2CDROM.DMD perform this function).
Typically, OS2ASPI will not allocate a device until the first execute I/O command is issued. This command allows it to scan for devices and not interfere with them until an application decides to issue a command. However, once this allocation takes place, OS2ASPI will not release the device because it can never be sure when the application is finished with it.
O2ASPI.DMD can be used without any command line switches, but there are usually two situations that can arise that OS2ASPI must address:
The previous two problems can be solved by the use of optional command line switches such as the following:
/ALL - This switch instructs OS2ASPI.DMD to allow commands to be issued to ANY device on the SCSI bus, even those allocated by other managers.
Warning: Commands should be issued to devices under the control of other managers with extreme caution. If you are using the /ALL switch and plan to issue commands to devices that are shared with another manager, try and limit them to non-destructive commands such as Inquiry and Test Unity Ready.
/SHARE - This switch instructs OS2ASPI.DMD to release any target after each command, allowing multiple managers to access a target at different times. Because this requires more commands to be issued to the driver, there will be a slight performance penalty when this switch is used.
Warning: When sharing devices and sending multiple concurrent requests, it is possible that allocation/deallocation of the device will cause a command to be rejected. This switch is best suited for use when you have applications that require different managers, but will not be used simultaneously.
BASEDEV=OS2ASPI.DMD /SHARE BASEDEV=OS2ASPI.DMD /ALL