Subject: Re: How netbsd-macppc use the BAT MMU
To: Noah yan <noah.yan@gmail.com>
From: Matt Thomas <matt@3am-software.com>
List: port-macppc
Date: 10/26/2005 21:15:29
Noah yan wrote:
> I am studying netbsd code for power mac g4. I am curious how netbsd use
> the BAT MMU.
> The address translation of BAT MMU is parallel with that of segment/page
> MMU. BAT MMU is known as superpages in other architecture.
> I am not good at the kernel coding part, hope that my questions share
> the common fundermental with you and no stupid.
> 
> Here  is my questions:
> Is the kernel turn BAT MMU on? if so, a BAT array have been setup for
> that, which part of the netbsd code does this?

Yes.  The initppc code.  for macppc, 0x80000000, 0xb0000000 and 0xf0000000
as setup as io bats.  in addition, all of physical memory in setup in
the bat table.

> If BAT MMU is used, how about segment/page address translation in
> kernel, is this also enabled and page table is setup?

The addresses mapped by BATs and those by PTEs don't overlap.

> If both BAT and seg/page are enabled, how the kernel make sure that the
> correct one is used in adress translation?

It's only used in kernel.

-- 
Matt Thomas                     email: matt@3am-software.com
3am Software Foundry              www: http://3am-software.com/bio/matt/
Cupertino, CA              disclaimer: I avow all knowledge of this message.