All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Fernandez-Vizarra Bonet <rodrigofv@jazzfree.com>
To: "linux-mm@kvack.org" <linux-mm@kvack.org>
Subject: Memory management question
Date: Sun, 26 Mar 2000 14:06:49 +0200	[thread overview]
Message-ID: <38DDFD59.D000C569@jazzfree.com> (raw)

Hi,

I'm developing a linux module and I'm having some trouble with the
memory management in Linux.

Basically, what I want to do is to reserve some physical pages from the
kernel when I install the module (insmod module.o), and when a process
requests them (with mmap), I want to map that pages in the process
virtual memory area.

That's what I'm doing now.
1.- In the kernel I get some physical pages with get_free_page or with
__get_free_page.
2.- I create a device entry en /dev/ called pmm with
module_register_chrdev() with my own version of mmap.
3.- This mmap function uses the function remap_page_range() to map one
of the physical pages into the calling process virtual memory. Of course
the calling process must explicitly call mmap on the new device created
before.
4.- In the kernel space I store some information in that pages.
5.- In the user space process I mmap the device and read from it, but I
can not get the information that I stored there :-(


It's not working, and I can't understand why. When the process makes an
mmap on the device it doesn't complain, but the resulting mapping is not
correct, because I can't access the information that is contained in the
physical page.

If any of you can help me It would be apreciated,

thank you very much in advantage.

Best regards,
Rodrigo

-- 
Rodrigo Fernandez-Vizarra Bonet
    e-mail: rodrigofv@jazzfree.com

You still can avoid the GATES of hell, USE LINUX !!!
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/

             reply	other threads:[~2000-03-26 13:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-03-26 12:06 Rodrigo Fernandez-Vizarra Bonet [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-07-20 13:10 Memoy Management Márcio Oliveira
2005-07-20 13:24 ` Arjan van de Ven
2005-07-20 14:23   ` Memory Management Márcio Oliveira
2005-07-20 17:03     ` Memory Management Question Márcio Oliveira

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=38DDFD59.D000C569@jazzfree.com \
    --to=rodrigofv@jazzfree.com \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.