[comp.sys.apple2] GS/OS Device Driver Question

ckirie@csg.UWaterloo.CA (Chris Irie) (07/25/90)

Ahoy one and all...

I have a question regarding GS/OS Device Drivers that maybe someone
out there could answer (please?)

Here's the thing. I have noticed that whenever the GS switches
into PRODOS 8 (or out of it) that a device driver I am writing
gets reloaded into  memory. This is a problem for me because my
driver needs to maintain a certain amount of state information.

So, the question is: How do I keep my driver in memory at all times,
even when I switch into and out of PRODOS 8? 

Or is this the wrong thinking for writing a GS/OS device driver? 
Would it be better to keep the state info in an initialization file?

I'm using the MPW IIGS cross development package, writing for the 
most part in C.

Any thoughts? Thanks for reading...

-- Chris Irie  (ckirie@csg.uwaterloo.ca)

------------------
DISCLAIMER: The above thoughts are my own, and do not necessarily
            represent those of my employer.

dlyons@Apple.COM (David A. Lyons) (07/27/90)

In article <1990Jul25.145501.25289@maytag.waterloo.edu> ckirie@csg.UWaterloo.CA (Chris Irie) writes:
>Ahoy one and all...
>I have a question regarding GS/OS Device Drivers that maybe someone
>out there could answer (please?)
>[...]
>So, the question is: How do I keep my driver in memory at all times,
>even when I switch into and out of PRODOS 8? 

The "restartable" bit is bit 15 of your device_characteristics word.
Set that, and make sure your driver is prepared to be started again
(in other words, watch out for pre-initialized storage locations in
your driver...you can restore them to their initial values at
driver-shutdown time if that's convenient for you), and you're set.
-- 
David A. Lyons, Apple Computer, Inc.      |   DAL Systems
Apple II Developer Technical Support      |   P.O. Box 875
America Online: Dave Lyons                |   Cupertino, CA 95015-0875
GEnie: D.LYONS2 or DAVE.LYONS         CompuServe: 72177,3233
Internet/BITNET:  dlyons@apple.com    UUCP:  ...!ames!apple!dlyons
   
My opinions are my own, not Apple's.

dlyons@Apple.COM (David A. Lyons) (07/28/90)

>In article <1990Jul25.145501.25289@maytag.waterloo.edu> ckirie@csg.UWaterloo.CA (Chris Irie) writes:
>>I have a question regarding GS/OS Device Drivers that maybe someone
>>out there could answer (please?)
>>[...]
>>So, the question is: How do I keep my driver in memory at all times,
>>even when I switch into and out of PRODOS 8? 

I wrote earlier:

DL>The "restartable" bit is bit 15 of your device_characteristics word.
DL>Set that, and make sure your driver is prepared to be started again

Chris wrote me back to say that didn't work.  OOPS!

The correct bit location for a regular device driver's "restartable" bit 
is bit 11, not 15, of the device characteristics.  (It's bit 15 for a
supervisory driver.  My mistake.)
-- 
David A. Lyons, Apple Computer, Inc.      |   DAL Systems
Apple II Developer Technical Support      |   P.O. Box 875
America Online: Dave Lyons                |   Cupertino, CA 95015-0875
GEnie: D.LYONS2 or DAVE.LYONS         CompuServe: 72177,3233
Internet/BITNET:  dlyons@apple.com    UUCP:  ...!ames!apple!dlyons
   
My opinions are my own, not Apple's.