Re: DMA to user space

From: Andreas Bombe (andreas.bombe@munich.netsurf.de)
Date: Thu Mar 16 2000 - 22:25:28 EST


On Thu, Mar 16, 2000 at 11:48:17AM -0500, John Wilson wrote:
> On Thu, Mar 16, 2000 at 08:22:38AM -0500, Richard B. Johnson wrote:
> > No. Not a "user-buffer". It may be possible to memory-map something that's
> > DMA..able to user space, but even that's not guaranteed. To have something
> > DMA..able in the ix86 machines, it needs to be:
> >
> > (1) Physical, below 16 Megabytes
> > (2) DATA alignment must be such that a 64k block is not crossed
> > during a DMA transfer. The ix86 machines use a page register
> > to access 64k pages.
> > (3) You need access to the DMA controller which the kernel isn't
> > going to give you, without a fight iopl(3), etc., from user-
> > space.
>
> No no, these requirements are for ISA DMA, not DMA in general. I'm using
> a PCI device, so there are no address restrictions (on x86 anyway, I dunno
> how PCI works on CPUs with >32 addr bits), and it has its own DMA paging
> registers so it doesn't require a contiguous buffer either. The buffer
> just has to be locked in place, which sounds like mlock() would be my friend.
>
> Also, my driver is a real driver, it doesn't run in user space. I just want
> it to be able to set the device up so that the DMA buffer (*only*) is in
> user space, and let 'er rip.

You're looking for kiobufs. They're in 2.3, not in 2.2 but available
as a patch for 2.2.

-- 
          Andreas E. Bombe <andreas.bombe@munich.netsurf.de>
http://home.pages.de/~andreas.bombe/                DSA key 0x04880A44

- 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.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Mar 23 2000 - 21:00:20 EST