From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1GcSUQ-0006QE-3T for mharc-grub-devel@gnu.org; Tue, 24 Oct 2006 16:03:10 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GcSUO-0006PA-EZ for grub-devel@gnu.org; Tue, 24 Oct 2006 16:03:08 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GcSUN-0006ON-Gy for grub-devel@gnu.org; Tue, 24 Oct 2006 16:03:07 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GcSUN-0006OI-7X for grub-devel@gnu.org; Tue, 24 Oct 2006 16:03:07 -0400 Received: from [66.111.4.26] (helo=out2.smtp.messagingengine.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GcSUM-00036A-P5 for grub-devel@gnu.org; Tue, 24 Oct 2006 16:03:06 -0400 Received: from db2.internal (db2.internal [10.202.2.12]) by frontend1.messagingengine.com (Postfix) with ESMTP id 04CEFDB832A for ; Tue, 24 Oct 2006 16:03:04 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by db2.internal (MEProxy); Tue, 24 Oct 2006 16:03:06 -0400 X-Sasl-enc: zvXya+kZcfycob0XF9FjAhik4c34LvCelasGJcqSYnzc 1161720186 Received: from basalt.austin.ibm.com (bi01p1.co.us.ibm.com [32.97.110.142]) by mail.messagingengine.com (Postfix) with ESMTP id 3D09A1BDE2 for ; Tue, 24 Oct 2006 16:03:06 -0400 (EDT) From: Hollis Blanchard To: The development of GRUB 2 In-Reply-To: <200610141733.44320.okuji@enbug.org> References: <1160779061.21017.75.camel@basalt.austin.ibm.com> <200610141733.44320.okuji@enbug.org> Content-Type: text/plain Date: Tue, 24 Oct 2006 15:03:00 -0500 Message-Id: <1161720181.23331.25.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:03:09 -0000 On Sat, 2006-10-14 at 17:33 +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. Actually I'm not using the heap, I'm just directly copying wherever phdr->p_paddr says to. That's not a good thing actually; in the future we should add some error checking to make sure we don't clobber GRUB itself. Also, I made sure that the load hook could veto loading each segment. So the x86 loader would do something like this: int x86_load_hook (Elf32_Phdr *phdr) { if (phdr->p_paddr not in x86 OS load area) return 1; return 0; } grub_elf32_load (elf, x86_load_hook); -Hollis