Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!ames!amdcad!sun!imagen!atari!portal!portal!cup.portal.com!ts From: ts@cup.portal.com (Tim W Smith) Newsgroups: comp.sys.mac.programmer Subject: Re: DRVRs and installing them Message-ID: <27753@cup.portal.com> Date: 10 Mar 90 05:08:20 GMT References: <32641@shemp.CS.UCLA.EDU> Distribution: usa Organization: The Portal System (TM) Lines: 55 Some things to watch out for: 1. Searching to find an empty slot is sort of OK, but be careful. What if you pick slot N, and then an INIT that runs after your's wants to load a driver that needs slot N? TOPS tries to work around this by examining all resources of type 'DRVR' in currently open resource files and avoiding the appropriate unit table slots. This is fine as long as everyone who requires that there driver be in a certain unit table slot installs their driver in the System file. You could try using entries used for NuBus slot drivers. When a driver for a NuBus slot is opened, the Slot Manager picks the first available entry above 63. So nothing should break if you've taken one of these yourself. I don't remember offhand if the Unit Table contains these entries on non-NuBus Macs, however. 2. If you are implementing your driver in some high level language, you might be in for a surprise. The driver will probably has some resource that contains the global data for that driver. The glue code that the development system provides for you will contain code to load that resource when the driver is first opened. There is a good chance that it will try to load the resource by number. For example, THINK C does this. When I write drivers for NuBus cards in THINK C, I have to patch the glue code to look for the resource by name rather than ID, and then add a name to the resource. I wish Symantec would fix this. 3. Be sure to load the driver into the System heap! There is a small Application heap at INIT time, and if you forget to make sure the driver goes into the System heap, you will get a crash when Finder starts. 4. OpenDeskAcc ( or however it is spelled ), is probably not what you want. Open is what you want. Tim Smith ps: if you do decide to search for an open slot in the Unit Table, remember that 32 to 39 are reserved for SCSI devices. Some drivers for SCSI devices are rather picky about getting the right entry. pps: and anyone who writes a driver for a SCSI device, please put your driver in the right Unit Table slot. It can make a difference if you want to be compatible with other SCSI drivers that have to do weird things.