From owner-freebsd-hackers@FreeBSD.ORG Mon Jan 22 03:33:32 2007 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7F1BA16A404 for ; Mon, 22 Jan 2007 03:33:32 +0000 (UTC) (envelope-from jdamato@andrew.cmu.edu) Received: from smtp.andrew.cmu.edu (smtp.andrew.cmu.edu [128.2.10.83]) by mx1.freebsd.org (Postfix) with ESMTP id 4C37513C457 for ; Mon, 22 Jan 2007 03:33:32 +0000 (UTC) (envelope-from jdamato@andrew.cmu.edu) Received: from [192.168.2.4] (c-67-171-65-107.hsd1.pa.comcast.net [67.171.65.107]) (user=jdamato mech=PLAIN (0 bits)) by smtp.andrew.cmu.edu (8.13.6/8.13.6) with ESMTP id l0M3XWNd027659 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT); Sun, 21 Jan 2007 22:33:32 -0500 Message-ID: <45B4308B.7050608@andrew.cmu.edu> Date: Sun, 21 Jan 2007 22:33:31 -0500 From: Joe Damato User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.57 on 128.2.10.83 Cc: Alejandro Lince Subject: Creating a "new" virtual address space for a process X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jan 2007 03:33:32 -0000 Hello - This is my first time posting to the list, so please let me know if I should expand on anything I mention here. I am working on the S4OS project for FreeBSD with a couple friends and we are currently trying to understand how to use the VM system in FreeBSD. We have a process, (in this case it happens to be curproc or proc0), and we would like to create a new virtual address space and allocate, say N pages starting at address X. We have been reading the fork() code to try to see how this would work, but got lost in some of the COW stuff. We have some kernel data that needs to be copied out to userland, but we can't seem to figure out how to actually set up that virtual address space. I would attach a code snippet of the code we wrote to accomplish this, but it is literally all guess work, and probably completely wrong. Anyone know how to do this or even where to look to see an example of this happening? Thanks, Joe