larry@focsys.UUCP (Larry Williamson) (07/26/88)
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
mikep@ism780c.isc.com (Michael A. Petonic) (07/28/88)
In article <193@focsys.UUCP> larry@focsys.UUCP (Larry Williamson) writes: >How does one get access to a memory buffer that is hard wired to a >physical memory location outside of the normal system memory? > [...] >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. > >I am using Bell Tech's Unix system V/386. > >Thanks, > Larry Since Bell Tech's UNIX system V/386 is close to our's (INTERACTIVE's 386/ix (see various articles describing the ancestry)), I looked in our ``Writing 386/ix Device Drivers'' book and it mentions the macros ``phystokv()'' and ``kvtophys()'' which map between physical addresses and kernel virtual addresses. They are defined in <sys/immu.h>. This should be relevant to Bell Tech's system. -MikeP -------- Michael A. Petonic (213) 453-8649 x3247 INTERACTIVE Systems Corporation "My opinions in no way influence 2401 Colorado Blvd. the price of tea in China." Santa Monica, CA. 90404 {sdcrdcf|attunix|microsoft|sfmin}!ism780c!mikep