Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Apr 2008 08:30:59 -0500
From:      Nathan Whitehorn <nathanw@uchicago.edu>
To:        freebsd-ppc@freebsd.org
Subject:   G5 Bridge-mode MMU
Message-ID:  <4804AE13.2060600@uchicago.edu>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4804AE13.2060600>