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

Re: [MiNT] FreeMiNT 1.18 release coming up.



On 04/03/2013 07:32, Markus Fröschle wrote:
Don't want to judge if its good or bad, but official Atari docs ("Rainbow
TOS Release Notes", http://dev-docs.atariforge.org/files/Rainbow_TOS_RN_8-7-1989.pdf, pg. 24)
state its perfectly legal to call the AES from supervisor mode (with
quite some care, though).

Very good document. See page 19.

1) "Care must be used when calling AES from the 68000's supervisor mode."

So it implicitly says that's legal. But beware.

2) "Some AES functions return to the caller in user mode"

It is not said which functions are affected. appl_init() is probably unaffected, since it sometimes works, but that should be double checked. On every TOS version.

3) "and all AES functions use the 68000 register usp to save the caller's registers"

This is true, I verified that with appl_init() with both TOS 1.62 and EmuTOS.

This means that currently, when GEM=ROM is used, any call to the underlying AES from xaaes.km pushes some data to USP. And as far as I understand, the value of USP is undefined inside xaaes.km. So either it crashes, or either it trashes a random memory area. That's certainly not acceptable.

The workaround would be to set USP to a safe location before calling appl_init() / appl_exit() from supervisor mode.

--
Vincent Rivière