How to attach to physical memory

Larry Williamson larry at focsys.UUCP
Tue Jul 26 05:07:27 AEST 1988


How does one get access to a memory buffer that is hard wired to a
physical memory location outside of the normal system memory?

I have a video frame grabber that uses an onboard 1Meg buffer.  This
buffer is available to the system the 10meg address boundry (ie, at
0xa00000).  This is well passed the 2.5Meg of system ram that is in the
system. 

I must write a driver that will give a user process access to this
memory. 

I expect to provide two device entry points, /dev/vidreg & /dev/vidmem
for the video registers and memory respectively that are on the board. 
When a user wants access to some of the video information, they would
lseek() on /dev/vidmem to the location of interest and then read() the
data. When they want to get a new frame from the camera, they would
ioctl() on /dev/vidreg to set the appropriate command bits.

If I use this technique, I must tell my driver to use a physical memory
buffer, but I do not understand how to tell my driver to read from
physical address 0xa00000. 

As an alternative, I would consider mounting the 1 meg of memory as a
shared memory segment that the user process would attach and simply use
like a 1 meg buffer in their own space. This is a good idea for efficiency,
but it might be more difficult to restrict access at critical times.

But in this case, I don't know how to tell the system to mount the
physical memory as a shared memory segment (In uport V/AT, I'd just use
/etc/shmcreate)

I am using Bell Tech's Unix system V/386.

I have poured through the book "Writing a Unix Device Driver" by Janet
Egan and Thomas Teixeira.  And although this book is a gold mine of
information, it does not seem to address my problem (or more likely, I
have not figured out what it is that they are saying!). 

Any help would be appreciated.

Thanks,
   Larry



-- 
Larry Williamson                      Focus Automation Systems
UUCP: watmath!focsys!larry    608 Weber St. N, Waterloo, Ontario N2V 1K4
                                          +1 519 746 4918



More information about the Comp.unix.microport mailing list