[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] Re[2]: Re[2]: 68030 MMU crash course?



Selon "George (HOL, IMAP)" <ggn@hol.gr>:
> > FYI, this is already done by TOS. Even on ct60  TOS Didier did this. So no
> > problem here  (whole 0x00FFxxxx area is already "mirrored" on 0xFFFFxxxx)
> Not on 4.04. At least not on the state the MMU is when booting.

Of course, since you're not talking about shadowing between $00FFxxxx and
$FFFFxxxx, but between $xxFF8800 and $xxFF8804 and $xxFF8808 and $xxFF880C and
so on. The later is not supported by the Falcon hardware as opposed to the ST
hardware, althought the Falcon silently ignore them (there's no bus error
generated if one tries to write at $xxFF8804).

> > can i ask why do you find this as easier solution? Patching the binary is a
> > question of one clever script/program which search for 0xffffxxxx in code
> > segment with some exceptions maybe... but it could be automated for sure a
> lot.
> Well,  if  we  program  the MMU efficiently I think it will be easier because
> we
> won't even notice if it will be needed.

That one is _very_ tricky to do with the 68 030 MMU.

The minimal page size does not allow to map $xxFF8804 to $xxFF8800 for example,
so you have to set the whole page as not readable nor writable. This way a bus
error will be generated each time the code tries to access the PSG (Or you may
perhaps as well use those infamous limit fields...)

Then, in the bus error handler, you have to decode the operation which caused
the error, emulate the access and resume to next instruction.

Of course this is _very_ slow. An original Falcon may have trouble running an ST
Software at its original speed with such a trick if there are many access to the
PSG (as you already know from Backward documentation).

Please also note 68 040 and 68 060 do not support emulation of access. This
approach won't work on those processors... Or at least will need more tricks to
pass this limitation.


BTW, a cycle accurate ST emulator for the CT60 would be a lot more compatible
with original ST softwares. But of course that's a very different project, and
limit public to CT60 owners...


Have fun with the MMU ! Best regards,


Xavier