Read/write at absolute memory address on Sys V/3.2 6386 UNIX

John Plocher plocher%sally at Sun.COM
Fri Apr 28 12:04:38 AEST 1989


+---- In <304 at cbnewsh.ATT.COM> maurice.r.baker writes:
| 	Within the confines of System V/3.2 UNIX on an AT&T 6386E, I need
| to read from and write to a particular range of memory locations......to
| be specific, 0xC6000 to 0xC63FF (they are actually on a Matrox graphics  
| board).
| 	Short of writing a device driver which gets linked into the kernel
| and runs in privileged mode, is there any other way of doing the job?  Spe-
+----

In general, what you MUST do if you want any speed at all out of it, is
to write a device driver which maps the physical Matrox memory into a
shared memory segment and provides an ioctl() to let the user program find
out what the shm key is.

If you do it any other way, you incur the cost of a system call for EVERY
access to the board :-(

This requires knowledge of how the system keeps regions and how the
shared memory scheme is implemented - both very non-trivial if you don't
have the Unix sources handy.

Sorry, I can't provide any example code because of non-disclosure agreements.

We did this same thing at Microport with SystemV/286, and I'm doing it
here at Sun with the X11/NeWS ports to V/386 :-)

   -John Plocher



More information about the Comp.unix.questions mailing list