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

Re: [MiNT] mint & mmu



> You can do it simpler. If a program do Super() just set a flag that
> the program wanted to switch to Super(), don't do anything other and
> let the program run in usermode. On the next illegal instruction or
> memory
> violation look if the flag is set. If yes analyze the reason, if the
> application wanted to get the cookie jar the faulted address will be
> the cookie jar address for example. If this is an allowed operation
> copy over
> the cookie jar pointer and let the application normally run. If it's
> an illegal operation do normal signal handling (e.g. terminating app
> most probably).

I actually thought about something else (setting trace bit in SR and let the
program continue in user mode, checking by the trace exception handler every
instruction before its execution etc.), but your proposal is simpler and
more elegant indeed. At last, it does not require generating so many (trace)
exceptions, the code is simpler etc.

Anyways the original idea with MMU is to be dropped, because the MMU cannot
prevent something like this:

andi.w #~$2000,SR

:-)

--
CVV
Konrad M.Kokoszkiewicz, http://draco.atari.org

** Ea natura multitudinis est,
** aut seruit humiliter, aut superbe dominatur.
** Taka to juz natura pospólstwa, albo sluzalczo sie plaszczy,
** albo bezczelnie sie panoszy. (Liwiusz XXIV, 25).