WarpOS emulation bugs
Posted: Tue Jul 19, 2011 11:28 am
I'm not sure about the status and the future of the WarpOS emulation in OS4, but maybe you want to check this:
I was sent a small 68k example program, which calls a PPC function via powerpc.library RunPPC(). It works fine with the original kernel, while it is causing a Grim Reaper under OS4.1.
After some debugging I found out that the top level function, called by RunPPC(), is saving some of its arguments in the Parameter Save Area, beginning at offset 24 of the callers PowerOpen-ABI stack frame. Could it be that the initial stack frame created by RunPPC() is not big enough to hold the Parameter Save Area? A PowerOpen stack frame should always be at least 64 bytes because of that. Otherwise the called function might overwrite important data in the callers stack.
The WarpOS emulation under MorphOS seems to have the same problem. Just the original kernel behaves correctly.
Another potential problem you might want to check is whether PP_Regs[8..14] are still copied into their default registers, even when the PPF_LINEAR flag is set to map PP_Regs[0..7] to r3..r10.
I was sent a small 68k example program, which calls a PPC function via powerpc.library RunPPC(). It works fine with the original kernel, while it is causing a Grim Reaper under OS4.1.
After some debugging I found out that the top level function, called by RunPPC(), is saving some of its arguments in the Parameter Save Area, beginning at offset 24 of the callers PowerOpen-ABI stack frame. Could it be that the initial stack frame created by RunPPC() is not big enough to hold the Parameter Save Area? A PowerOpen stack frame should always be at least 64 bytes because of that. Otherwise the called function might overwrite important data in the callers stack.
The WarpOS emulation under MorphOS seems to have the same problem. Just the original kernel behaves correctly.
Another potential problem you might want to check is whether PP_Regs[8..14] are still copied into their default registers, even when the PPF_LINEAR flag is set to map PP_Regs[0..7] to r3..r10.