From owner-freebsd-hackers@FreeBSD.ORG Thu May 17 15:00:39 2012 Return-Path: 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 C953D106566B for ; Thu, 17 May 2012 15:00:39 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id A00348FC15 for ; Thu, 17 May 2012 15:00:39 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id B5A51B94F; Thu, 17 May 2012 11:00:38 -0400 (EDT) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Thu, 17 May 2012 10:36:44 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p13; KDE/4.5.5; amd64; ; ) References: <4FA95960.7090908@shadowsun.net> <201205151144.38123.jhb@freebsd.org> <4FB3AAA6.3090708@shadowsun.net> In-Reply-To: <4FB3AAA6.3090708@shadowsun.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201205171036.45009.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 17 May 2012 11:00:38 -0400 (EDT) Cc: Eric McCorkle Subject: Re: GSoC Project: EFI on amd64/i386 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: Thu, 17 May 2012 15:00:39 -0000 On Wednesday, May 16, 2012 9:24:54 am Eric McCorkle wrote: > On 05/15/12 11:44, John Baldwin wrote: > > The i386 kernel assumes it starts out with a flat 32-bit mode with > > the kernel loaded into a contiguous memory region at a fixed > > physical address. If we need a relocatable kernel (as Marcel > > hinted at I think), then that adds a fair bit of complication. > > > > The amd64 kernel assumes it starts in long mode (the bootinfo64.c > > bits in the loader setup initial page tables, etc.). I think the > > amd64 kernel also has to be loaded into contiguous memory at a > > fixed physical address currently. > > > > Seems like an initial workaround could be to allocate a space big > enough for all the necessary ELF segments, and split it up ourselves. > > Do the kernel and modules actually do anything that depends on being > in a contiguous space in some way (ie some relocation trick)? Because > it seems like it shouldn't really matter otherwise. They are statically linked at a fixed address. Modules can be wherever, but the kernel has to be at the physical address it is linked for (unless you make the kernel relocatable). -- John Baldwin