[OpenBIOS] Sparc64 memory allocation problem
tarl-b2 at tarl.net
Wed Aug 25 21:31:55 CEST 2010
> Blue Swirl wrote:
>>> Hmmm I didn't think that elf_load() should be being called by the openBSD
>>> IEEE-1275 bootblock at all (it looks like the source just opens the file as
>>> a standard device) - is it?
>> Yes, I think the problem is with the next stage loader.
> I took a quick look at the openBSD loader again, and it appears that it
> moves load-base up to 0x6000 and then calls init-program which would imply
> that init-program should sometimes claim the memory, and sometimes not :( A
> quick play with openBSD 4.7 seems to show the problem has been fixed there,
> which made me think they are relying on another assumption.
> I did find an interesting comment in the OpenSolaris bootblock source though:
> \ OBP doesn't allocate memory for elf
> \ programs, it assumes they'll fit
> \ under the default 10MB limit
> Does that mean there should be a default mapping on SPARC64 whereby the
> first 10MB of memory (0 - 0xa00000), both physical and virtual, are mapped
> together? This would explain why openBSD loads at 0x800000, and by doing
> this we would mark that region of physical memory as being used which means
> the phys_mem allocator would then choose somewhere different...
My recollection is that OpenBoot on SPARC allocates the _top_ of memory for
its own use. I.e., a box which has 16G of memory will allocate something like
3.FF00.0000 through 3.FFFF.FFFF for itself (I don't have the amount it
allocates readily at hand). It does not report this as available memory to
Solaris, which is why there isn't a conflict.
More information about the OpenBIOS