From owner-freebsd-questions Wed Sep 25 11:46:25 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id LAA11230 for questions-outgoing; Wed, 25 Sep 1996 11:46:25 -0700 (PDT) Received: from root.com (implode.root.com [198.145.90.17]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id LAA11205 for ; Wed, 25 Sep 1996 11:46:23 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by root.com (8.7.5/8.6.5) with SMTP id LAA06778; Wed, 25 Sep 1996 11:46:09 -0700 (PDT) Message-Id: <199609251846.LAA06778@root.com> X-Authentication-Warning: implode.root.com: Host localhost [127.0.0.1] didn't use HELO protocol To: johnson@charming.nrtc.northrop.com cc: questions@FreeBSD.org Subject: Re: Question regarding mmap <--> procfs In-reply-to: Your message of "Wed, 25 Sep 1996 11:28:39 MDT." <9609251828.AA09743@charming.nrtc.northrop.com> From: David Greenman Reply-To: dg@root.com Date: Wed, 25 Sep 1996 11:46:09 -0700 Sender: owner-questions@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk >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