|
This Technical Note discusses the need for Macintosh device drivers to
implement _PBClose .
Updated: [June 01 1990]
|
Introduction
You may get the idea when implementing device drivers that _PBClose is
superfluous. After all, if you have a resident driver for a NuBus(TM) video
board, the only time your driver is not needed is if the operating system is
going away. It might seem that nothing important can happen after the
operating system goes away, so why bother with _PBClose ? Well, it
turns out a lot can happen, and this Note tells you why it is important to
implement a Close (_PBClose ) routine.
Back to top
Transformations
The problem with your driver not being needed when the operating system is
going away is that there is more than one way for the operating system to go
away. Besides the user choosing Restart or Shutdown from the Special menu, it
is possible for the Macintosh operating system to be transformed into an
entirely new operating system. This is exactly what happens when A/UX starts.
The A/UX Startup application (Sash in the pre-A/UX 2.0 days) attempts to shut
down the Macintosh operating system as much as possible, including closing all
drivers, loading A/UX, and starting it running. It does not perform a
RESET , so if you have not disabled interrupts in your Close
routine, A/UX may get up and running and find itself receiving interrupts for a
board about which it knows nothing--a situation which makes it very unhappy.
In summary, A/UX Startup issues a _PBClose call to your driver, so
your driver must implement a Close routine and it must
accomplish the following (even if you never intend to support your board under A/UX):
- Disable all interrupts for your device.
- Remove your interrupt handler, replacing any changed interrupt vectors.
- Release any private data storage held by your driver.
Back to top
References
Inside Macintosh, Volumes II, IV, & V, The Device Manager
Designing Cards and Drivers for the Macintosh Family, Second Edition
NuBus is a trademark of Texas Instruments.
Back to top
Downloadables
|
Acrobat version of this Note (36K)
|
Download
|
Back to top
|