Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!ucsd!ucbvax!van-bc!ubc-cs!alberta!alberta!cpsc.ucalgary.ca!yogi.fhhosp.ab.ca!yogi.fhhosp.ab.ca!news From: edstrom@elmer.hsc.ucalgary.ca (John Edstrom) Newsgroups: comp.os.os9 Subject: more linker problems Message-ID: <1991Jan29.114204.1751@yogi.fhhosp.ab.ca> Date: 29 Jan 91 17:42:03 GMT Organization: Dept. Clinical Neurosciences, U of Calgary, Alberta, Canada Lines: 57 Nntp-Posting-Host: elmer.hsc.ucalgary.ca Hello, all. Its me again. Sorry to bother everybody with this but I have been having a devil of a time with my device driver and can't find any solace in my manuals. The good news is that I think I found the source of my bus error problems. Now all I need to do is to find a way around it. After reading the manual several times more closely I learned that the IOMan and the device driver share the same static storage area. The problem comes from the fact that they don't know what each other are doing. for example, if I use the device storage area to save some data like an input buffer (a la Dibble) it would look like this: vsect inpntr ds.l 1 * points to current position in buffer inbuf ds.b 80 * body of buffer ends and, since the device routines are called with a2 pointing to static storage, they would be used as: lea.l inbuf(a2),a0 * calculate buffer address move.l a0,inptr(a2) * initialize data pointer to buffer head The problem is that IOMan uses the same data section but uses different offsets which are defined in sys.l. Thus, V_PORT is defined as $0 and so is inpntr. So when the IOMan saves the device port address it overwrites my inpntr. I could also have written the above code as: lea.l inbuf(a2),a0 move.l a0,V_PORT(a2) The reason I was getting spurious bus errors from my driver is that the IOMan was either using my data as flags, addresses or something else inappropriate or else my code was interpreting IOMan's data as my own. So, my question is: how do I get my linker to respect IOMan's data sections? I would just declare a heap of junk bytes at the top of my vsect if I could find out how much space the IOMan and SCF filemanager needs to mangle. Is that information available anywhere? I re-read the linker sention of the manual several times and don't see any options that seem to apply either. I get no unresolved variables so I think I'm linking to all of the necessary libraries in the proper order. John Edstrom | edstrom@elmer.hsc.ucalgary.ca -- RM 2104, HSc Building, Div. Neuroscience U. Calgary School of Medicine, 3330 Hospital Drive NW Calgary, Alberta T2N 3Y4 (403) 220 4493 (wk)