[comp.sys.amiga] Strange problem with device driver

sbower@lehi3b15.CSEE.Lehigh.EDU (Steve Bower) (02/04/88)

Okay, guys, I'm having this really strange problem with a device
driver I'm writing.  I have the basic open/close/expunge/etc. code in
place (though it doesn't do much yet), and so far as I can tell from
the example code I've seen, everything should be just fine.  However,
when I have a test program try to OpenDevice() my device, I get a
guru.  The cause?  Well, you know how you're supposed to provide a
list of addresses for your functions that's terminated by a -1
longword?  It's kind of jumping to that -1 longword.  I have
determined that none of my code is being called (with ROMWack), and I
have tried looking at everything I could think of.  To no avail.
Anybody have any ideas?

System configuration:  Amiga 1000, 512K Ram, df0: and df1:.  Using
Lattice 4.0 (actually the assembler thereof).

State of machine at crash:

PC: pointing to that -1 longword
D0: size of my device structure         A0: same number as D1
D1: some number, also in A0             A1: ptr to function table
D2: -2 L                                A2: some number
D3: FA8                                 A3: 5DE2
D4: 1 L                                 A4: ptr to part-made dev. struct.
D5: 3E                                  A5: 5D4A (ptr to ramlib.library)
D6: some number                         A6: ExecBase
D7: 0                                   A7: (sp)

These numbers were gathered over several crashes...

Interesting points:
  The number in D1 and A0 is ODD.
  A7 points to just after a JSR (A1) in ROM, in the middle of some
code that seems to conditionally call the MakeLibrary function.
  
Any ideas?  I've already pulled enough hair out about this one!! :-)

****** NOTE: the return address on this won't work!  Catch me at 
sbower@lehi3b15.uucp...

		Thanks,
		  Steve.