grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] generic ELF loading


From: Johan Rydberg
Subject: Re: [PATCH] generic ELF loading
Date: Tue, 24 Oct 2006 22:48:39 +0200
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux)

Hollis Blanchard <address@hidden> writes:

>> 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.

Have you looked at how EFI solves this?  

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

Attachment: pgpa5horltpw8.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]