Subject: LCII Memory Layout
To: None <port-mac68k@NetBSD.ORG>
From: Sunny Daniels <sdan002@cs.auckland.ac.nz>
List: port-mac68k
Date: 04/26/1996 21:51:45
Hello Again!

In an attempt to discover a little more about the LCII's memory layout, I 
booted up MacOS on my LCII with virtual memory switched off.  I then used 
MacsBug to carefully examine the contents of the page tables ("Translation
Tree" in 68030 terminology) and MMU registers.  I did this in both 24 bit 
and 32 bit modes.  I also looked at the information on the LC and LCII
memory layouts in the Apple Tech Info Library.  As soon as I get a change
to write a readable summary of my findings, I'll post it to the mailing
list.  The most interesting things that I discovered were:

1) The LCII DOES use the MMU to rearrange the address space, even when the
LCII has virtual memory turned off in the Memory control panel.

2) In spite of my earlier suspicions, the physical addresses of the RAM do
appear to be in a single contiguous block.  The bottom of the block is at
Ox0; the top of the block is at Ox9FFFFF.

3) The top 64K of the area of the physical address space reserved for RAM
(i.e. Ox9F0000 to Ox9FFFFF) is mapped to a block of virtual addresses above
the top of the area of virtual memory reserved for ordinary RAM.  Furthermore, 
the processor cache is disabled on this block of virtual  addresses.  This 
suggests that the addresses Ox9F0000 to Ox9FFFF are used for memory-mapped
I/O to some part of the LCII hardware.  The reason for MacBSD crashing on 
LCIIs with 10Mb of RAM might be that the MacBSD kernel is trying to use this
top 64K of the physical RAM area as ordinary RAM.  How difficult would it be
to modify the MacBSD kernel to avoid using this area?




--- Sunny Daniels,
--- Department of Computer Science,
--- University of Auckland,
--- Private Bag 92019,
--- Auckland,
--- New Zealand.
---
--- E-Mail: sdan002@cs.auckland.ac.nz