Subject: NetBSD and the 68030 MMU
To: Erik E. Fair <fair@cesium.clock.org>
From: Jeremy Cooper <jeremy@broder.com>
List: port-sun3
Date: 10/23/1996 17:05:34
On Wed, 23 Oct 1996, Erik E. Fair wrote:

> Of course, the Mac versions of NetBSD already run on 68030, so the code for
> the 030 MMU exists. What other architectural differences are there?

You are absolutely correct!  The amiga and hp300 port use the 68030 ATC as
well.  In fact, they both use the same MMU code which came with the hp300
port.  However, there's been a desire for a cleaner MMU management code.
The hp300 MMU code (which is officially called the 'pmap' module in
NetBSD) is really a bizarre sort of hack.  Even Jason, who manages the
hp300 port agrees.

The problem deals with its dependency on other parts of the kernel in its
operation.  Ideally, the pmap code should be able to run independently of
the other parts of the kernel; it should not rely on other kernel
subsystems (like virtual memory management) to do its job because often,
these subsystems depend on the pmap code to do theirs!  This means that
the pmap code must be re-entrant and that it also know the consequences of
calling the other parts of the kernel.  Should these intracacies change,
it could be very hairy trying to fix the pmap code to handle these new
changes. 

As to the second part of your question, one major difference is how DMA is
handled.  The sun3x has a special piece of hardware called the "I/O
Mapper" which handles DMA to virtual memory.  Generally, the sun3x port is
going to be an easier port because the machine was designed from the start
to run UNIX.  The Mac port probably was a, well, insert your favorite
explative here.

-J