On 8 Feb 2009, at 22:08, Francis Devereux wrote:

Hi,

I have figured out why the dynarec wasn't working on Mac OS X - it's because the Mac OS X x86 ABI requires the stack to be aligned to a 16 byte boundary on function calls. Below is a patch that allows the dynarec to work on Mac OS X.

Since writing the original patch I have discovered that the opSWI function can also call OS libraries, so it needs an aligned stack on Mac OS X too. This was resulting in crashes when I attempted to use HostFS. An updated patch is below. Note that I haven't looked at what happens with on OS X/amd64 - this patch should not change behaviour when RPCEmu is compiled as 64 bit on OS X. I haven't even attempted to compile RPCEmu as 64 bit on OS X, has anyone else?

I have also had a look at networking on OS X. I had the same problem with kernel panics as Timothy Coleman, but I copied network-linux.c to network-macosx.c and rewrote it to use threads instead of signals. This prevented the panics (not really sure why) but networking still didn't work properly. I then discovered that TunTapOSX doesn't include the 4 byte ethernet frame preamble when reading from the tap device or expect it when writing to it. After I changed network- macosx.c to take this into account I got networking to work, with RISC OS 4.02 running on the guest. My code isn't really ready for submission yet because (a) it uses AuthExecuteWithPrivileges to run / sbin/ifconfig, which the Apple docs seem to suggest isn't secure (this could be avoided by writing a privileged helper tool, I've done this before and would be willing to do it for RPCEmu networking if people are interested and it would get committed to SVN) and (b) RPCEmu has become much less stable on my system for unknown reasons which makes testing difficult - it crashes quite a lot and I can no longer install the RO 4.02 boot sequence from a CD image - the progress bar of the RISC OS installer program stops at about 85% although the hourglass is still animated so the guest OS hasn't completely crashed. I've tried reverting my recent code changes but this hasn't helped.

Francis

Attachment: rpcemu-dynarec-osx.diff
Description: Binary data


_______________________________________________
Rpcemu mailing list
[email protected]
http://www.riscos.info/cgi-bin/mailman/listinfo/rpcemu

Reply via email to