
The different address spaces used in the source code
can be quite confusing. This document will try to straighten
things out.

For convenience, it is assumed that Mac OS is booted in the emulator. 
This convention is used throughout the source code, even though it
could be another operating system or OF.


1. Linux virtual addresses
==========================

Linux virtual addresses refer to addresses in the
memory space of the mol application. I.e. normal
pointers.

In this space, the memory used for the mac-RAM could be at
almost any address. To simplify debugging RAM is normally 
mapped to 0x20000000 and ROM to 0x4c000000.


2. (Linux) physical addresses
=============================

These addresses are the "raw" untranslated addresses 
given by the hardware of the particular machine
the software is running on. In most machines, RAM is
continuous starting at 0. Linux physical addresses
are except in a few places used only in the kernel.


3. Mac-physical addresses
=========================

The mac-physical address space is the untranslated
address space of the emulated hardware. In this space,
the RAM is continuous starting at 0. ROM can be found
at 0xfc000000. This address space is directly accessed
whenever MSR_DT or MSR_IT is not set (at startup 
and in exception handlers).

In the source code, mac physical addresses are declared
ulong to make it clear that this isn't an address which
can be dereferenced.

The function add_io_range take mac-physical addresses
as arguments.


4. Mac-virtual addresses (effective addresses)
==============================================

Mac-virtual addresses corresponds to addresses 
which are to be translated by the mac-MMU
to a mac-physical address. What the address space looks 
like depends on the MMU registers (and the PTE hash 
table in mac-ram). Effective addresses are also
declared ulong.

Maintaining the mac-virtual address space is
the responsibility of the mmu-code in the kernel.
No code in the user process (mol) except the 
debugger/monitor code should use mac-virtual
addresses.

For information about virtual memory management
and the MMU, refer to Motorola's PowerPC reference 
manuals (available online).


