Messages in this thread | | | From | "Kendall Bennett" <> | Date | Wed, 15 Jul 1998 11:03:32 -0800 | Subject | Re: mmap_dma() for user space code? |
| |
Hi Alan,
> > tasks, I have also come across the problem of trying to figure out > > how to allocate a chunk of physically contiguous, page-locked memory > > that can be used for PCI bus master DMA operations. This is not for > > getting the BIOS to work, but rather for getting our 2D and 3D > > acceleration code working under Linux. > > You need to allocate it kernel side, and map it via a device into user > space. The bttv driver in 2.1.x does this. In your case I suspect you are > talking about implementing a /dev/dmamem device in effect.
I guess now I have to show that I am Linux Kernel Naive (I am an expert at 32-bit DOS programming and Win32/VxD programming but not Linux ;-( ). Exactly how would a /dev/dmamem device work? Is this something that I can create with an open("/dev/dmamem") command and then simply make ioctl() calls to it? I have never implemented such as device, so is there sample code for a small device that would get me started?
> > If not, what do we need to do in order to get it implemented? I would > > really like to see this system call become a standard feature of 2.2 > > so that our code can work out of the box with Linux 2.2 systems. > > There is some test code from one of the SuSE people put for portable 2.0 > and 2.2 code I'd write a simple /dev/dmamem device. Its small, its generic > and it maybe something folks like the X people can use one day too.
The one thing is that I would like to try and use something that makes it into a release kernel source tree, such that people wishing to use our software will be able to use a kernel from a standard distribution and not have to compile a patched kernel (or compile a kernel at all!).
> The only downside is its non swappable memory so the app needs to be > polite about it and have some size constraints on usage.
Well we can ensure that the calling code is SUID root so that it is trusted, and in our case are not likely to allocate more than say two 32Kb or 64Kb blocks of memory for DMA (we use two DMA buffers for ping-pong double buffering for maximum 3D performance).
Regards,
+--------------------------------------------------------------------------+ | SciTech Software - Building Truly Plug'n'Play Software! | +--------------------------------------------------------------------------+ | Kendall Bennett | Email: KendallB@scitechsoft.com | | Director of Engineering | Phone: (530) 894 8400 | | SciTech Software, Inc. | Fax : (530) 894 9069 | | 505 Wall Street | ftp : ftp.scitechsoft.com | | Chico, CA 95928, USA | www : http://www.scitechsoft.com | +--------------------------------------------------------------------------+
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html
| |