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

Re: [MiNT] Super() bug



 
What is a context ?
Where does this rule come from ?
Compendium :) It says: "In addition, supervisor mode should be entered and left in the same stack context (same 'C' function) or stack corruption can result.". Don't break this rule and you're out of troubles (this is why I couldn't understand it, I always comply to this one).
 
Anyway: Super() is supposed to change the user/supervisor mode, this should be unrelated to the stack. I can hardly understand how restoring a bogus stack could not be considered as a bug.
Well, as Super() directly affects a stack, I wouldn't say it's "unrelated". You just must know what you are doing, why and what are possible consequences. Dangerous OS call may do dangerous things.
 
My solution is simple and safe. If the OS is clean (like FreeMiNT), it does not change anything. If the OS is bogus (like TOS), it fixes the stack. I have been using it for a long time, it works very well. Also, it solved David's trouble with his USB work. Personally, I will never use Super() in the classic way again.

You are right, the Super() behavior should be checked on other operating systems. If my solution is compatible with all of them, it should be used.

use Supexec()

I hate that OS call because it has 2 drawbacks:
[...]
I agree, this SV handling is far from ideal. Question is if it makes sense to make workarounds to existing bindings (i.e. only new software would gain from that) or to use completely new, well-defined, OS call for that. Something like your SuperToUser and UserToSuper(). MiNTLib would emulate it on non-FreeMiNT OS using Super() calls (be it with your workaround, why not).

--
MiKRO / Mystic Bytes
http://mikro.atari.org