From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1GcT5u-0007w4-2v for mharc-grub-devel@gnu.org; Tue, 24 Oct 2006 16:41:54 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GcT5s-0007vN-53 for grub-devel@gnu.org; Tue, 24 Oct 2006 16:41:52 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GcT5q-0007te-FH for grub-devel@gnu.org; Tue, 24 Oct 2006 16:41:51 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GcT5q-0007tU-BB for grub-devel@gnu.org; Tue, 24 Oct 2006 16:41:50 -0400 Received: from [66.111.4.26] (helo=out2.smtp.messagingengine.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GcT5q-00023k-BF for grub-devel@gnu.org; Tue, 24 Oct 2006 16:41:50 -0400 Received: from db2.internal (db2.internal [10.202.2.12]) by frontend1.messagingengine.com (Postfix) with ESMTP id C87C7DB9311 for ; Tue, 24 Oct 2006 16:41:48 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by db2.internal (MEProxy); Tue, 24 Oct 2006 16:41:51 -0400 X-Sasl-enc: BhGsj07KMB1pgrV2F0JpTWPVMb8sTD0Z3p0s/0S26oNa 1161722511 Received: from basalt.austin.ibm.com (bi01p1.co.us.ibm.com [32.97.110.142]) by mail.messagingengine.com (Postfix) with ESMTP id 159171128A for ; Tue, 24 Oct 2006 16:41:50 -0400 (EDT) From: Hollis Blanchard To: The development of GRUB 2 In-Reply-To: <20061014172325.GA3021@saphi> References: <1160779061.21017.75.camel@basalt.austin.ibm.com> <200610141733.44320.okuji@enbug.org> <20061014172325.GA3021@saphi> Content-Type: text/plain Date: Tue, 24 Oct 2006 15:41:47 -0500 Message-Id: <1161722507.23331.43.camel@basalt.austin.ibm.com> Mime-Version: 1.0 X-Mailer: Evolution 2.6.3 (2.6.3-1.fc5.5) Content-Transfer-Encoding: 7bit Subject: Re: [PATCH] generic ELF loading X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Oct 2006 20:41:52 -0000 On Sat, 2006-10-14 at 19:23 +0200, Tristan Gingold wrote: > On Sat, Oct 14, 2006 at 05:33:44PM +0200, Yoshinori K. Okuji wrote: > > On Saturday 14 October 2006 00:37, Hollis Blanchard wrote: > > > This patch adds generic ELF loading infrastructure for both 32-bit and > > > 64-bit ELF. It provides an "iterate" function for program headers, and a > > > "load" function for convenience. > > > > The idea is very good. But I don't like that loaded areas are always allocated > > from the heap. GRUB has a staging area for OS images on i386-pc, and I prefer > > to load an image directly instead of consuming the heap. > Two points for ia64: > * the area must be allocated from EFI. What does this mean? Open Firmware has a "claim" call, which reserves memory and makes it available to the application. I assume EFI must have something similar. This can be called via a hook. For error handling, you'd probably need to iterate once to claim the memory, iterate once to copy the ELF file there, and in case of error iterate again to free the claimed memory. > * we need to support relocation: loading the ELF file with an offset > (this feature can be on/off/forced). This is provided via `load_hook' in grub_elf32_load(). In fact, PowerPC already does this. Please see offset_phdr() in my second mail (Subject: Re: [PATCH] ppc64 Linux ELF loader). -Hollis