lkml.org 
[lkml]   [2003]   [Feb]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: mmap inside kernel memory.
Rik van Riel wrote:
>
> On Sun, 9 Feb 2003, Jerome de Vivie wrote:
>
> > "mmap" seems to be design for mapping file or device inside a process
> > memory. Is it possible to map a file into the kernel virtual memory ?
>
> In theory yes (using vmalloc space), but you really don't want to.

Yes, it's very tricky ! I have (naïvly) try this:

vaddr=vmalloc(len);
do_mmap(file ,kvaddr ,len ,PROT_READ|PROT_WRITE ,MAP_FIXED|MAP_PRIVATE
,0);

Here, do_mmap check if the addresse match inside current process and
return me -ENOMEM. Are there others functions which i could use to
associate this file and a vmalloc'ed space ?


j.

--
Jérôme de Vivie
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:33    [W:1.389 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site