Re: Mapping user buffers to kernel space
Re: Mapping user buffers to kernel space
- Subject: Re: Mapping user buffers to kernel space
- From: Joe van Tunen <email@hidden>
- Date: Fri, 23 Apr 2010 14:35:38 -0700
- Thread-topic: Mapping user buffers to kernel space
> From: Andrew Gallatin <email@hidden>
> Date: Fri, 23 Apr 2010 16:15:53 -0400
>
> Joe van Tunen wrote:
>>> From: Ken Hornstein <email@hidden>
>
>>> - I know about the IOMemoryDescriptor calls, but from what I can see the
>>> way they work is that you have to allocate the buffer using them and
>>> then give that buffer to userspace. I don't see how to use
>>> IOMemoryDescriptor on a struct uio.
>>>
>>> --Ken
>>
>> You¹re user space code can tell your kext about a user space block of
>> memory (make your own user space memory descriptor type) and the kext
>> can map it into kernel address space.
>>
>> Joe
>
> You can also make memory descriptor using a uio:
> md = IOMemoryDescriptor::withOptions(iov, io_cnt, 0, task
> kIOMemoryTypeUIO | otheroptions )
>
> Drew
Right. My code is old. KIOMemoryTypeUIO was added back in Mac OS X 10.4 and
since the oldest Macs capable of running Mac OS X can run 10.4, there's
little reason to code for less than that.
Joe
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden