[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [MiNT] Trans.: Re: Questions about 68040
Hello Konrad,
Selon Konrad Kokoszkiewicz <draco@obta.uw.edu.pl>:
> >> When you encounter a bus fault for reading of 0x5a0, tweak PMMU to
> >> allow for reading (and reading only) of 0x0-0x1000 (or 0x0-0x2000, I
> >> don't which page size MiNT uses), modify SR on stack to set TRACE
> >> mode, and install tour own trace handler. Then ReTurn from Exception.
> There may be some problem with it, though. Namely, the first portion of the
> memory (2k or something) is protected from being accessed in user mode, but
> AFAIK, the protection is not done by MMU, but rather by the ST hardware. If
> so, modification of the MMU configuration won't help, the error will occur
> anyways.
>
> Am I right with this?
Yes, you're right. I overlooked this.
So, you will have to allocate a free page, copy the data needed there (at the
right offset), and map it to 0x0000-0x2000 in the process MMU tree. This way,
we will be able to access our fake low mem from user mode.
If you want/need to handle some write access, you will have to copy the data
written from the fake low mem (or fake peripheral area) to the real one in the
cleaning code (trace handler). This also means storing some infos about the
access being simulated (address, size) between the access fault handler and the
trace handler.
Best regards,
Xavier