On 7/31/07, Robert Millan <[EMAIL PROTECTED]> wrote: > On Tue, Jul 31, 2007 at 10:55:09AM -0500, Hollis Blanchard wrote: > > I think the simplest solution will be to allocate Efika's heap high, > > as we talked about earlier. If the first "available" region is above > > 4MB, just reserve 4MB and don't worry about where it is. In general we > > should try to keep 4MB free, but at the end of the day it's Efika's > > fault and probably won't be a big deal for them anyways. > > Ok, let's do that. But what do we do if the first available region is > just a few kBs below 4MB? Or if it's just too small? I think we need to > determine what is the minimum heap size we want to accept, such that the > ability to keep 4MB free still compensates having a small heap. > > Any suggestion?
Yup, it's a pain. Here's one idea: set a "GET_HEAP_FROM_WHEREVER" flag, then later do if (GET_HEAP_FROM_WHEREVER) { grub_addr_t heap_addr; grub_ieee1275_claim(0, MIN_HEAP_SIZE, 4, &heap_addr); } That will ask firmware to find us a suitable area of memory.and return the address. It might even work. We could try doing that in all situations, except: - this method isn't often used, so firmwares can have bugs here - if MIN_HEAP_SIZE were small enough (e.g. 2MB), it would mean we probably would still have 4MB+ free. However, that depends on the size of the modules. I would hate to document "oh, if you can't load your OS, try using fewer GRUB modules." On the other hand, we already have this problem to some extent: if our modules are too large, we will fail to allocate any heap. So maybe this isn't a practical concern. -Hollis _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel