[OpenBIOS] static and global variable problem

Programmingkid programmingkidx at gmail.com
Tue Dec 25 05:19:52 CET 2012


> 
> In short, this is actually fine. You have to remember that OpenBIOS uses the MMU (emulated by QEMU) and hence physical pages can be mapped to any virtual address within the 32-bit address space of the PPC CPU.
> 
> Once the MMU is enabled in the OpenBIOS startup code, all addresses (including those used by gdb) are virtual addresses. If you want to view the current virtual to physical mappings, use the "info tlb" command from the QEMU monitor.
> 
> Note that if you try and access an unmapped address then you will normally obtain some kind of "page fault" or "TLB miss" processor exception. So if you can read and write from the variable, then everything is working correctly.
> 

I tried the "info mtree" command and found out that the variable next_grab_slot's address is located in this section:

00000000fff00000-00000000ffffffff (prio 0, R-): ppc_heathrow.bios

next_grab_slots's address is 0xfffda060.

The "R-" seems to indicate that this section is read only explaining why the variable's value can't be changed. I am pretty sure static variables should not be kept in this region. How do we change where static and global variables are stored?


More information about the OpenBIOS mailing list