malloc pages map to user space
Ryan Stone
rysto32 at gmail.com
Thu Mar 22 19:33:55 UTC 2012
On Thu, Mar 22, 2012 at 10:42 AM, Eric Saint-Etienne
<eric.saintetienne at gmail.com> wrote:
> Actually when using kernel_map, the object returned is NULL! However the
> the vm_entry_t it returns seems a valid address, its 'object' field is NULL
> too (that's consistent)
> That's the reason why I didn't find it in any existing 'puclic' map (such as
> kernel_map, buffers_map, kmem_map, exec_map or pipe_map)
>
> But a NULL object isn't good at anything and I'm not sure what to do with
> a vm_entry_t only... Any idea how to insert it in the process map?
If your kernel module creates a device in /dev that implements the
mmap method, then you don't need to worry about mucking around with
vm_maps and objects and whatnot. Your mmap method just needs to be
able to convert offsets into the device into physical memory
addresses, and the vm infrastructure will do the rest for you.
More information about the freebsd-hackers
mailing list