[OpenBIOS] PPC: QEMU breaks static variables in OpenBIOS

Mark Cave-Ayland mark.cave-ayland at ilande.co.uk
Wed Jan 2 14:45:33 CET 2013


On 02/01/13 13:23, Programmingkid wrote:

> I have noticed that a single register (r9) appears to be used at a base register for all static variables. If we created our own memory region using malloc for static and global variables, and set register r9 to this value, we can make static variables work again. I know it is a hack, but I was able to make static variables work this way.
>
> Early in the boot process, register r9 is set to 0x7c631a15. This address is what I used to make next_grab_slot work. My guess is the address is a static variable memory region. Register r9 might have been intended to be some kind of base register, but I haven't found any documentation that states this. I do know all static variables in ofmem.c use it for address calculations.

It would almost seem that either the QEMU ELF loader or something in 
arch/ppc/qemu/entry.S should be relocating the data section or entire 
ROM image into RAM before execution.

Reading the comments for SPARC in arch/sparc32/entry.S, it looks as if 
the pages are marked writeable in the MMU and there is some kind of 
relocation into RAM occurring - Blue, can you comment on this?


ATB,

Mark.



More information about the OpenBIOS mailing list