ADC Home > Reference Library > Technical Notes > Legacy Documents > Hardware & Drivers >
Important: This document is part of the Legacy section of the ADC Reference Library. This information should not be used for new development.
Current information on this Reference Library topic can be found here:
|
Apple-defined sResource sRsrcHWDevID entryDate Written: 6/25/92 Last reviewed: 6/14/93 In Apple's technical reference Designing Cards and Drivers for the Macintosh Family, 2nd edition (Chapter 8, page 123), the functional sResource entry called sRsrcHWDevId is discussed. The book says that this entry is necessary for hardware devices. Please explain the purpose of this entry in the Declaration ROM functional sResource. Do I generate this ID number or does Developer Support generate this number? ___ You generate this sRsrcHWDevId number. However, the hardware device ID is optional, not necessary. Why might you want to use it? You might want a hardware device ID if you had multiple hardware devices (and it's totally up to you to define what a "hardware device" is) on a card and wanted certain sResources to be affiliated with certain hardware devices. As an example, let's say your card had three hardware devices and six sResources. If, say, you wanted two sResources to be affiliated with each "hardware device", you could number the devices (maybe from 1 to 3) and have the sResources tagged with the affiliated hardware devices. To be truthful though, this is another feature of the Slot Manager (when the Slot Manager was designed, no one really knew how developers would want to use it, so it was made very, very flexible), and, as far as we know, no one uses this feature. How to tell if Slot Manager is implementedDate Written: 10/22/91 Last reviewed: 6/14/93 How do you tell whether the Slot Manager is implemented? ___ The best way is to just check for the existence of one of the Slot Manager traps. You should be able to check the implementation of Trap $A06E and if it is there, then the Slot Manager will be there. Below is a piece of code which does this check:
Checking for sRsrcInfoDate Written: 9/24/91 Last reviewed: 8/5/92 Is there a way from Pascal to check availability of traps like SRsrcInfo (which is not really a trap but a selector). On a Macintosh Plus, the trap SlotManager (A06E) is available but the debugger says the call sRsrcInfo was stopped is not available. ___ Use NGetTrapAddress, as in the following example:
Code in the Compatibility Guidelines chapter of Inside Macintosh Volume VI shows this in more detail, and is more robust. Detecting a NuBus or PDS card in the Macintosh IIsi slotDate Written: 1/16/90 Last reviewed: 6/14/93 Why does a call to gestaltNuBusConnectors return zero slots when there actually is a NuBus card or a PDS (Processor Direct Slot) card in the Macintosh IIsi slot? ___ A call to gestaltNuBusConnectors returns zero slots because there's no way to determine if there's a NuBus card or a PDS card in the Macintosh IIsi slot. Gestalt can't assume that there's always a NuBus or PDS slot, so it just says there's no slot. However, Apple recommends that you always use the Slot Manager instead of Gestalt to search for cards, after first checking to see that the Slot Manager trap is implemented. The Slot Manager will safely do all the necessary work for you whether a card with a valid declaration ROM is installed or not, and you can search for the card using a variety of criteria.This technique will allow you to locate NuBus cards, but has the added benefit of being able to find PDS cards that contain declaration ROMs. The Macintosh SE/30, IIfx, and LC have the Slot Manager and PDS slots. It's safe to assume the Slot Manager will be resident in all future machines that have either NuBus or PDS slot capability. Downloadables
|
|