From owner-freebsd-arm@FreeBSD.ORG Thu May 21 20:58:21 2009 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF32A1065670 for ; Thu, 21 May 2009 20:58:21 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 8D9DD8FC0C for ; Thu, 21 May 2009 20:58:21 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id n4LKtfbx082858; Thu, 21 May 2009 14:55:41 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Thu, 21 May 2009 14:55:52 -0600 (MDT) Message-Id: <20090521.145552.410235390.imp@bsdimp.com> To: gballet@gmail.com From: "M. Warner Losh" In-Reply-To: References: X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-arm@freebsd.org Subject: Re: LMA != VMA when compiling a kernel X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2009 20:58:22 -0000 In message: Guillaume Ballet writes: : I am still working on a port of FreeBSD to the beagleboard, and am : currently working on enabling the VM. So far, I have loaded the kernel : at phys_addr = virt_addr = 0x80000000, because that is where the RAM : is. However, when enabling the VM, I would like the kernel virtual : addresses to start with 0xC0000000 as they do on most other platform. This isn't a bad idea... : Hence, I have been trying to set the ELF file sections' VMAs to : something starting with 0xC and the LMAs to something starting with : 0x8. It turns out that just setting KERNPHYSADDR and KERNVIRTADDR is : not enough >.< If found a way to do this by chaning the script linker : and adding AT after each section declaration, and it works fine. But : it's tedious, hacky and lots of hardcoded values only work with my : platform. Want to share? : Googling for ideas, I found that there has been some discussion about : it barely a year ago. Yet, it doesn't seem to have yielded any : tangible result. Would someone have addressed the progress in the mean : time? : : I guess another way to look at it would be to work it around by also : porting a full-fledged loader(8). A task which I have delayed to until : I get a booting kernel - maybe not the wisest move :) Still, I'm : curious about the possibility of specifying distinct LMAs and VMAs for : the kernel executable. Its already there, but requires a lot of code in the primary boot loader to call back into to do things like loading files and doing network I/O. Also, while a secondary boot loader makes sense in the higher end booting environment where you have lots of storage (say an SD or CF card), it doesn't make so much sense for a more constrained boot a ramdisk from flash setup. Warner