Apple II
Technical Notes
_____________________________________________________________________________
                                                  Developer Technical Support


GS/OS
#6:    Drivers and GS/OS Direct Page

Revised by:    Dave Lyons                                           July 1989
Written by:    Matt Deatherage                                     March 1989

This Technical Note corrects an error in the preliminary GS/OS documentation 
and provides an alternate suggestion for developers who are writing GS/OS 
drivers.
Changes since March 1989:  Added information about setting the D register 
before making system service calls and documented that the GS/OS direct page 
is now guaranteed to remain the same between Driver_StartUp and 
Driver_ShutDown calls.
_____________________________________________________________________________

Preliminary GS/OS documentation, including the beta draft of GS/OS Reference, 
Volume 2, incorrectly states that locations $5A through $5F are available for 
device drivers, and that locations $66 through $6B are shared by device 
drivers and supervisory drivers (and may be corrupted by either a driver or 
supervisory driver call).

This is not correct.  The locations in question are used by GS/OS; destroying 
these locations can cause system failure and media corruption.

Drivers which require direct page space of their own should request it from 
the Memory Manager when they are started.  Upon receiving a call, a driver can 
save the value of the D register (containing the GS/OS direct page) and switch 
to its own direct page.  The driver may keep the value of its direct page 
inside the driver itself; no space on GS/OS direct page is available for this 
purpose.  The driver must restore the D register to point to the GS/OS direct 
page before returning from the call, and it should also dispose of its direct 
page space when it shuts down.

The driver must also set the D register to point to the GS/OS direct page 
before making any system service call other than SET_SPEED and 
DYN_SLOT_ARBITER.

Note:  The location of the GS/OS direct page is guaranteed to 
       remain the same between Driver_StartUp and Driver_ShutDown calls.


Further Reference
_____________________________________________________________________________
    o    GS/OS Reference, Volume 2