Specifications

Developer Technical Support May 1990
Apple IIGS
#69: The Ins and Outs of Slot Arbitration 7 of 7
There are certain applications with more specialized needs, such as high-speed, single character
input or output. In such cases, the Slot Arbiter may be a bottleneck. When a slot is not switched,
the Slot Arbiter returns quickly, but when a slot must be switched, it takes a significant amount
of time. Doubling that significant time for switching in and restoring gives a substantial
overhead for each hardware access, which may be too much for some applications.
Note: It is far better to write a GS/OS driver to deal with hardware than to write a slot-
dependent application to control it. A slot-dependent application must deal with the Slot
Arbiter, and the user must quit the current application to run your application just to
change some aspect of the hardware. Writing a GS/OS driver lets any application, desk
accessory, or CDev control your hardware with regular GS/OS calls.
Problems with Slot-Dependent Tools
Code designed before the Slot Arbiter may have slot-dependencies that cause unexpected
problems when dynamic slot arbitration is fully implemented. This list includes some of the
Apple IIGS System Software. Specifically, the Text Tools and the FWEntry call in the
Miscellaneous Tools present problems with dynamic slot arbitration.
Text Tools
When using the Text Tools to specify a device for input, output, or error, the value specified (a
four-byte parameter) is assumed to be a slot number if it is in the range 0-7. The Text Tools
were not designed to use Slot Arbiter-style slot numbers, and this causes a compatibility
problem.
The Text Tools were modified in System Software 5.0 to recognize Slot Arbiter-style slot
numbers where possible. The trick is that it’s not possible as often as we’d like. External slots
are specified by using slot numbers 9 through 15; if such a slot number is used as input to a Text
Tools call, the appropriate Slot Arbiter call is made and that external slot is used if it can be
made available. However, internal port numbers are in the range 1-7—the same range used by
the old Text Tools to indicate which of two peripherals was switched in for a particular slot. The
Text Tools cannot assume that you are requesting an internal slot when using a slot number
between one and seven.
For example, your old application might do a seven-slot search and find a parallel printer card in
slot 1 (where the Control Panel setting for that slot is “Your Card”). If the Text Tools assumed
all slot numbers in the range one through seven meant internal ports, your application would
actually access the internal port 1 firmware every time it tried to access the parallel card it found
in slot 1; this problem occurs since old applications don’t know and don’t care about internal or
external slots.
The Text Tools may be used to access any external slot (if available), but they may only be used
to access internal ports that are set to internal in the Control Panel. The Text Tools slot numbers
zero through seven always match the Control Panel settings.