[OpenBIOS] Booting SunOS from OpenBIOS

Mark Cave-Ayland mark.cave-ayland at ilande.co.uk
Tue Apr 2 21:45:05 CEST 2013


On 02/04/13 20:12, Artyom Tarasenko wrote:

> After some debugging, I think the problem is in the current
> obp_memalloc realization: it calls ofmem_claim_virt which
> expects the address to be precise and thus can not be called
> twice for the same virtual address.
>
> Looking at the OpenSolaris headers (
> http://fxr.watson.org/fxr/source/sun/sys/promif.h?v=OPENSOLARIS#L83 )
>
> extern  caddr_t         prom_alloc(caddr_t virthint, size_t size, uint_t align);
>
> it seems that "virthint" is just a hint for a virtual address, so
> prom_alloc (which is our obp_memalloc) shall not fail unless the whole
> RAM is exhausted.
> The comment on lines 70-71 says:
>
> "The alloc function should guarantee that it will never return an
> invalid pointer."
>
> Someone cares to fix?

Ah I think I may see the bug here - what if you change 
arch/sparc32/lib.c line 276 in obp_memalloc() from:

virt = ofmem_claim_virt(pointer2cell(va), size, 0);

to:

virt = ofmem_claim_virt(pointer2cell(va), size, align);

Does that fix the bug for you?


ATB,

Mark.



More information about the OpenBIOS mailing list