[comp.sys.mac.programmer] LSC Device Driver madness...

moyman@ecn.purdue.edu (James M Moya) (08/29/90)

My device driver is(going to be) an AppleTalk listener. The AppleTalk listener 
code I developed as an application and works very well, solid.  The device
driver opens and runs (it does a SysBeep every couple of seconds for
now...just so I know it's running).  

As a test I try to register the listener on the appletalk within the open()
part of the driver code.  The result is an entry with no name or type being
registered??? 

Now, to use the appletalk code, just NBP for the registration, I must add the 
nAppeTalk Mac library to the project.  Looking at the LSC manual, pg. 80 
titled "Using Libraries in Drivers", it states that you can use libraries in 
drivers as long as the libraries don't reference globals through register A5.  
OK. Then it goes on to say that all LSC libraries but one, MacTraps, use A5 
access their globals through A5. Ok. To get around this they tell you
to make the library use register A4.  Then it says to make a library use 
register A4 you need to "first make a copy of the library.  Then change the 
project type of the library to anything but Application, and recompile and
rebuild the Library"...I tried this and it doesn't work, it fails to
recomile (can't find the objects or something).  It also references
chapter 13 to learn how to build libraries, which I did but found nothing
of use.  So I called Symantec Tech Support and the guy told me that
I didn't need to rebuild the library in order to make it use A4, that it
was done automatically when I build the driver... OK.

The end result is the driver will not do something as basic as registering
a name on the appletalk inside the "open()" driver routine.  It works
fine as an app, nothing as a driver.  The odd thing is that none of
the appletalk calls fail, I end up with:
:@                                       [Net: 56.29 Node:124 Skt:252]

being registered on the appletalk instead of:
moyman:testype*                          [Net: 56.29 Node:124 Skt:252]

At first glance it looks like maybe a Global problem for the variables that
hold the name and type of the appletalk Entity.  I made it so everything
used literals, "\ptestype" for example, in the NBP calls.  I still
got the same result.  I am leaning toward whether the library uses
register A5/A4 or not as being the problem... meaning LSC tech support
told me wrong.

Anybody have any help/comments to get me going in the right direction.
I am stagnating at this point...and hating it.

Mike Moya
Engineering Computer Network
Purdue University