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...
ATB,
Mark.