From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1GcSkI-0008NV-UF for mharc-grub-devel@gnu.org; Tue, 24 Oct 2006 16:19:34 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GcSkH-0008LI-Dv for grub-devel@gnu.org; Tue, 24 Oct 2006 16:19:33 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GcSkC-0008D6-Gb for grub-devel@gnu.org; Tue, 24 Oct 2006 16:19:32 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GcSkC-0008Ci-AP for grub-devel@gnu.org; Tue, 24 Oct 2006 16:19:28 -0400 Received: from [195.54.107.70] (helo=mxfep01.bredband.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GcSkC-0005a7-1T for grub-devel@gnu.org; Tue, 24 Oct 2006 16:19:28 -0400 Received: from ironport2.bredband.com ([195.54.107.84] [195.54.107.84]) by mxfep01.bredband.com with ESMTP id <20061024201927.CJQ953.mxfep01.bredband.com@ironport2.bredband.com> for ; Tue, 24 Oct 2006 22:19:27 +0200 Received: from c-e8df71d5.029-19-73746f13.cust.bredbandsbolaget.se (HELO localhost.localdomain) ([213.113.223.232]) by ironport2.bredband.com with ESMTP; 24 Oct 2006 22:19:26 +0200 From: Johan Rydberg To: The development of GRUB 2 References: <1160779061.21017.75.camel@basalt.austin.ibm.com> <200610141733.44320.okuji@enbug.org> <1161720181.23331.25.camel@basalt.austin.ibm.com> Date: Tue, 24 Oct 2006 22:48:39 +0200 In-Reply-To: <1161720181.23331.25.camel@basalt.austin.ibm.com> (Hollis Blanchard's message of "Tue, 24 Oct 2006 15:03:00 -0500") Message-ID: <87iri91lug.fsf@night.trouble.net> User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" 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:19:33 -0000 --=-=-= Content-Transfer-Encoding: quoted-printable Hollis Blanchard writes: >> The idea is very good. But I don't like that loaded areas are always all= ocated=20 >> from the heap. GRUB has a staging area for OS images on i386-pc, and I p= refer=20 >> 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. Have you looked at how EFI solves this?=20=20 They keep track of all memory regions, and with each region is a "memory type" associated. Whenever you allocate memory you change the type of the region (from "free") to some that makes sense (could be "loader data", "disk cache", ...). You can only allocate memory that is marked "conventional", meaning it is considered free. The memory region database is later feed to the operating system. We could do the same. Is this case we could allocate the regions specified by the ELF image. If any of the allocations fail we know there is something already loaded there, or the image is faulty. ~j --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) iD8DBQBFPnwq3CqIy3K3X2ERAv83AKCqHveQfHZ1aXET+lYpqqC8fVDDnwCfWfK8 LVPMs0UK2pu4f1Z2v0RklyU= =3fPE -----END PGP SIGNATURE----- --=-=-=--