Re: How to do a mmap ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



http://www.xml.com/ldd/chapter/book/ch13.html

HTH
Kedar.
On Wed, 2003-02-05 at 05:50, Jerome de Vivie wrote:
> 
> I'm currently writting a module. I use a file from kernelspace. Instead
> of using "f_op" read/write calls, i would like to mmap this file into
> the kernel memory and use it as a contiguous space.
> 
> I've try to do it by calling "do_mmap", but when i access the memory
> from another process inside an "ioctl", i get an Oops with a
> "segmentation fault". The address returned doesn't seem to be in good
> segment for my module. 
> 
> I would like to have a valid address of the begining of the mmaped file
> plus a "length", and being able to use this space when the module is
> requested from processes. I also want to be able to remap this space if
> the file grows. I don't know which functions or kernel structures i
> should use.  Could you help me a bit ? 
> 
> 
> Kind regards,
> 
> j.
> 
> PS: CC added to me are welcome.
> 
> -- 
> Jérôme de Vivie
> --
> Kernelnewbies: Help each other learn about the Linux kernel.
> Archive:       http://mail.nl.linux.org/kernelnewbies/
> FAQ:           http://kernelnewbies.org/faq/
> 


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux