[comp.sys.mac.programmer] how do i start a device driver from an INIT?

ssw@cica.cica.indiana.edu (Steve Wallace) (09/11/90)

I want to start a device driver from an INIT( or an application).  I 
created a 
simple device driver, for testing, loaded it into the resource file of 
an 
application.  The application then called the device driver with the 
OpenDriver 
command using the device driver name preceeded by '.'.  I receive the 
error -37 
(bdNameErr). What am I doing wrong? 

Thanks,
Charles McClary
cmcclary@silver.ucs.indiana.edu

oster@well.sf.ca.us (David Phillip Oster) (09/13/90)

In article <4959@cica.cica.indiana.edu> ssw@cica.cica.indiana.edu (Steve Wallace) writes:
_>I want to start a device driver from an INIT( or an application).  I
_>created a simple device driver, for testing, loaded it into the
_>resource file of an application.  The application then called the
_>device driver with the OpenDriver command using the device driver name
_>preceeded by '.'.  I receive the error -37 (bdNameErr). What am I doing
_>wrong?


1.) The name of the device driver should already start with a '.'. You
call OpenDriver with the name, as a pascal string, exactly as it stands.

2.) You'll need to renumber your driver to a free slot in the unit 
table. See the tech note on doing this.

3.) If you don't DetachResource() your driver, it will be deallocated
when your INIT or Application returns. If it is still receiving interrupts
after its been deallocated, the machine will crash.

4.) If your driver allocates big buffers, you may need a sysz resource
to make the system expand the system heap before trying to run your
driver.
-- 
-- David Phillip Oster - Note new signature. Old one has gone Bye Bye.
-- oster@well.sf.ca.us = {backbone}!well!oster