G5 Bridge-mode MMU
Nathan Whitehorn
nathanw at uchicago.edu
Tue Apr 15 13:26:21 UTC 2008
I'm trying to get G5 support going, and have run into an interesting
problem while bootstrapping the MMU. Firmware loads the kernel in
protected mode, and we have no BAT facility. Thus, the bootstrap
allocator fails because low physical memory isn't 1:1 mapped. And we
can't add this region to the page table, because the page table is what
we are trying to allocate. And we can't even use the MMU's large page
facility in bridge mode.
One solution is to drop back to data real mode while the page table is
allocated and set up. This seems to work ok, but requires that the
kernel stack is mapped 1:1, which seems to be the case on my iMac G5.
I'm not sure how reliable this assumption is, though. It's also
irritating because any open firmware calls from real mode (e.g.
printf()) make the machine hang up.
The other solution is to prepare a temporary statically-allocated page
table with enough mappings to map the kernel, OF, and the real page
table, then switch to the dynamically allocated one. I'm not sure there
is enough stack for this though, since we are so early in the boot
process. It could be globally statically allocated, but that would
pointlessly increase the kernel memory footprint of everyone with bridge
support compiled into their kernels.
Thoughts?
-Nathan
More information about the freebsd-ppc
mailing list