From owner-freebsd-hackers@FreeBSD.ORG Mon Jun 20 02:49:04 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 64F6516A41C for ; Mon, 20 Jun 2005 02:49:04 +0000 (GMT) (envelope-from french.linuxian@gmail.com) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.201]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2B73C43D4C for ; Mon, 20 Jun 2005 02:49:03 +0000 (GMT) (envelope-from french.linuxian@gmail.com) Received: by zproxy.gmail.com with SMTP id 12so367923nzp for ; Sun, 19 Jun 2005 19:49:03 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=q74k7bYonRDL/FZwGblm1Foc/Fi6GtWuh/OWwMfiDn8nf7sjGiXEb0RiMahYQRlCN0lQQRHDpt50s7Fp3e4y5jtPtstlJ94BMaLCIVcESTEG9LlCK82YSlALCt11M74ejd1GwgAnesC5BCqQ4SaUuaUAWKdsz4igT9v2RekrDRg= Received: by 10.36.158.4 with SMTP id g4mr96296nze; Sun, 19 Jun 2005 19:49:03 -0700 (PDT) Received: by 10.36.57.3 with HTTP; Sun, 19 Jun 2005 19:49:03 -0700 (PDT) Message-ID: <3727392705061919494ea7e0ad@mail.gmail.com> Date: Sun, 19 Jun 2005 22:49:03 -0400 From: Aziz Kezzou To: Andrey Simonenko In-Reply-To: <20050614120706.GA539@pm514-9.comsys.ntu-kpi.kiev.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <37273927050614012154fdb80b@mail.gmail.com> <20050614120706.GA539@pm514-9.comsys.ntu-kpi.kiev.ua> Cc: freebsd-hackers Subject: Re: FreeBSD Memory Management questions ? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Aziz Kezzou List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jun 2005 02:49:04 -0000 > On Tue, Jun 14, 2005 at 04:21:41AM -0400, Aziz Kezzou wrote: > > > > 1 - Right now to access the memory address space of a user process > > from kernel mode, I only have to set, on x86 systems, the register CR3 > > to the right value. How can I do that on other architectures ? is > > there an architecture-independant way of doing that ? >=20 > Addition to the previous answer. It is also possible to temporally > map several pages of user memory into the kernel address space. > Check pmap_qenter(9) and see physio -> vmapbuf, for example, how to > use it. Another method, it is possible to COW a single user page and > then use it in the kernel, but with this method an user process will > not see any modification in this page made by the kernel and vice > versa. Check socow_setup -> vm_page_cowsetup, for example, how to > use it. Very interesting ! Right now I am using the fact that the kernel address space is maped on i386 machines into the user address space. So when I am executing a system call I can access kernel memory. I am wondering if there is an architecture-independant way of doing that ? (Notice that I need not only read kernel memory but also free it. e.g, mbufs ) or at least could you tell me if that's possible on other architectures ? Thanks for your help, -aziz