Re: copy from contiguous kernel memory - better way?
- From: "Ben Voigt [C++ MVP]" <rbv@xxxxxxxxxxxxx>
- Date: Thu, 8 May 2008 10:50:56 -0500
Tim Roberts wrote:
Rich <Rich@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
I started the driver skeleton from the avshws sample, but it's so
far a custom interface.
The capture h/w requires a contiguous destination buffer, but as the
majority of my driver experience is in embedded systems with linear
memory models (vxworks), I'm not sure if a mapped/probe and locked
user buffer counts as a "contiguous" buffer from the h/w's
perspective.
No, it doesn't. They will be contiguous in virtual space, but not in
physical space. If the hardware requires contiguous physical space,
then you must use a common buffer, and that means you must copy.
It should be possible to have zero-copy by mapping the buffer into usermode
directly though. Probably need to create a kernel mapping object and have
the usermode call VirtualAlloc(MEM_RESERVE) and MapViewOfFile. Just make
sure you don't trust the content of memory that can be written from
userspace.
.
- Follow-Ups:
- Re: copy from contiguous kernel memory - better way?
- From: Don Burn
- Re: copy from contiguous kernel memory - better way?
- Prev by Date: Re: Accessing files on FAT32 partition at boot time
- Next by Date: Re: Create a webcam driver and draw into it ?
- Previous by thread: Creating a hidden local port in Vista
- Next by thread: Re: copy from contiguous kernel memory - better way?
- Index(es):
Relevant Pages
|