VME user-level device driver

Brent Baker brent at greylady.uoregon.edu
Fri Oct 5 10:11:11 AEST 1990


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 at 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



More information about the Comp.sys.sgi mailing list