From: kcd@cbmvax.commodore.com (Ken Dyke - Amiga Networking)
Newsgroups: comp.sys.amiga.programmer
Subject: Re: 68040 MMU Tools?
Date: 12 Sep 92 14:59:47 GMT
Reply-To: kcd@cbmvax.commodore.com (Ken Dyke - Amiga Networking)
Organization: Commodore, West Chester, PA

In article <1992Sep11.212657.5929@beaver.cs.washington.edu> wille@june.cs.washington.edu (Robert Wille) writes:
>In article <1992Sep11.201144.16881@ifi.unizh.ch>, swalter@avalon.physik.unizh.ch (walter stefan) writes:
>|> 
>|> Sorry for wasting bandwidth with such a simple question. Are there
>|> any MMU based 68040 tools around? I haven't seen any so far but
>|> I'd need some, i.e. a FastRom or Enforcer like tool or whatever.
>|> 
>|> Thanks, Stefan
>
>I have an even simpler question.  Is the '040's MMU that much different
>from the '030's?  If so, what I'm interested in knowing what differences
>there are.

Well, there are a LOT of differences between the two MMU designs that make
writing tools like Enforcer/SetCPU/etc. rather difficult but NOT impossible
:)

First, the 68040's MMUs do not support early page termination as the 68030
does.  This means, that you must have a completely filled in MMU table,
which eats up considerably more RAM than 030 tables do.  For example, if
you needed to have individual control of every single page in the system
and you were using 4K pages, the MMU table would require two megabytes of
RAM, assuming that the supervisor and user level tables were the same.

Another difference is that the 040 only supports 4K and 8K page sizes, while
the 030 is much more flexible (sorry, I can't remember exaclty what the
030 is capable of).

However, it's not so much the MMU's that make writing and Enforcer-like
utility difficult, it's the 040's exception processing.  The 68030 used
a continuation model for access error exceptions.  This meant that if
you were to access illegal memory, Enforcer could print out the hit, and
then fill in the exception stack frame with the data that it wanted you
to read (usually 0) and then let the 030 continue it's cycle.

The 040 on the other hand must always re-run the instruction if a read
fault occurs.  This is the problem.  With something like Enforcer, this
means that you must somehow let the program run *just one* instruction
with a modified page table that says it's OK to read that location.  Then
immediately after that instruction executes, you have to quickly mark
that page as illegal again.  This gets really ugly when you try to make
accesses to low memory illegal, and still be able to read from location
4.

Take heart, though.  About 3-4 months ago I wrote a version of Enforcer
for the 68040, but it was a serious *hack* to say the least.  There is
a better one in the works, but I have no idea how long it will be before
it's available, but with the release of the A4000, having 68040 tools
will be very important, I think.

-Ken


>
>-- 
>Robert
>
>Warning: The food and drug administration has announced that saliva causes
>         stomach cancer, but only when swallowed in small amounts over a
>         long period of time.


-- 
Kenneth Dyke                                  All of the above opinions are my
Commodore-Amiga Networking Group              own and not necessarily those of
email: kcd@cbmvax.commodore.com               my employer.

        "You'll get over it.  If not, you'll learn to live with it."