Thread (2 messages) 2 messages, 2 authors, 2013-12-26

how to use mmap() on a disk file to get a kernel address?

From: Yu Bi <hidden>
Date: 2013-12-26 07:42:10

Hi,
   I try to mmap a file in a linux kernel module. I have tried to use the
function do_mmap_pgoff. But the address returned is memory virtual address
in current process' user space, i.e., below the kernel boundary. Instead, I
want to map the file in the kernel space and get the kernel virtual address
of the mapped region. Is there any kernel API in Linux support this
operation? Or I have to reimplement a kernel mmap version ?
  But reimplement a kernel version mmap() is  not easy I guess. Do you have
any idea?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20131226/2b3aa5bc/attachment.html 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help