Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!mips!cs.uoregon.edu!greylady.uoregon.edu!brent From: brent@greylady.uoregon.edu (Brent Baker) Newsgroups: comp.sys.sgi Subject: VME user-level device driver Message-ID: <1990Oct5.001111.21349@cs.uoregon.edu> Date: 5 Oct 90 00:11:11 GMT Sender: news@cs.uoregon.edu (Netnews Owner) Reply-To: brent@greylady.uoregon.edu (Brent Baker) Distribution: na Organization: University of Oregon Chemistry Stores Lines: 46 I'm trying to write my first user-level VME device driver. Our phone support doesn't cover this, so I'm throwing myself at the mercy of the court, er, net. The code looks like this... I've added the following line to /usr/sysgen/master.d/mem {NBPP, 0xbd00b000, }, we have another driver that uses a page at 0xbd00a000 so I just took the next page. I've also tried using a page at 0xbd100000, because that is the other address the manual reccommends fo VME-bus 16 bit addressing. And of course I run lboot and then reboot and all that jazz to invoke the new version of mem. My call to open and mmap is: Fd = open("/dev/mmem", O_RDWR); Addr = mmap(0, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, Fd, 0xbd00b000); And indeed I get back a value. This is running of a PI-20, and the address is always 0x600000. When I try to read from the device via: value = (unsigned char)(*(Addr + x)); where x is 0 to 503, (the range our device places values in) it always crashes. I've used the cast (unsigned short) as well. The error I get in the console window is: Bus Error: Parity Error Bits: 0x0: physaddr: 0x9E34 (or 0x9D18 sometimes) I've used dbx and it always crashes on the lbu instruction (load byte unsigned) that loads from the address Addr (plus whatever) into a register. If you have any suggestions you can respond to this posting, or send it to: brent@chemiris.uoregon.edu. Thanks. -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ... he could never understand the sense of a contest in which the two adversaries have agreed upon the rules. "One Hundred Years of Solitude" -- Gabriel Garcia Marquez