Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Sep 1996 11:46:09 -0700
From:      David Greenman <dg@root.com>
To:        johnson@charming.nrtc.northrop.com
Cc:        questions@FreeBSD.org
Subject:   Re: Question regarding mmap <--> procfs 
Message-ID:  <199609251846.LAA06778@root.com>
In-Reply-To: Your message of "Wed, 25 Sep 1996 11:28:39 MDT." <9609251828.AA09743@charming.nrtc.northrop.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
>The way I thought I could do this was to use the mmap function in conjunction
>with the procfs file /proc/curproc/mem.  However, at the moment I can't get
>this to work.

   You can't mmap the /proc mem file. It is intended only to be used to read
selective portions of the process address space by using seek/read.

>First question:  Is what I am trying to do supposed to be possible?  (If I
>understand mmap and /proc/curproc/mem, it should be possible in principle.)

   No, not by using procfs.

>Second question:  Is there some other means of manipulating virtual memory
>outside the kernel that I should be using instead of mmap and /proc/curproc/mem?

   Yes, you could create a file that is 8K large and then map the pages in at
different addresses. In the first case you'd just map the whole file, write
your data to it, and then unmap it. Then map the file again, second page first
and first page second.

-DG

David Greenman
Core-team/Principal Architect, The FreeBSD Project



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199609251846.LAA06778>