Comment by stuaxo

Comment by stuaxo 2 days ago

2 replies

This is nice, I wish there was way to bring the old Rosetta over, though I guess it probably needs something like all/some parts of the OS to be compiled as fat binaries to work,

Wowfunhappy 2 days ago

You'd need to compile a custom kernel, but it might it be possible.

https://forums.macrumors.com/threads/rosetta-on-10-7-and-abo...

> 10.6 xnu does have special support for rosetta, namely in kern_exec where it seems to set some special ppc environment bits if the oah binary is invoked (and of course there's the handler to call the oah binary for a ppc mach-o, but the former is more important for minimal viable example since you can always invoke oah manually). I think this bit is actually needed because the kernel has other codepath here when allocating memory. (Not 100% confident though, bit it makes sense there are different conventions about base address, region sizes, etc.)

> Likely might need changes to dyld also for obvious reasons, but that's open source as well https://opensource.apple.com/source/dyld/dyld-132.13/src/dyl...

> Would be easiest to try getting a plain assembly hello world ppc binary working first. I see that someone on your linked thread tried copying translate binary but it crashed even without args; tracing in lldb would be the logical next step but seems he never followed up on that...

> Another thing which I'm not sure of is whether rosetta relies on existence of ppc-arch system frameworks; I'd assume not since they'd want to do high-level thunking here for performance, but maybe that only ends up being done in some cases? I couldn't find any docs on reverse engineering rosetta1m or if they exist they've disappeared.

A possible counterpoint to the last paragraph would be, if Rosetta doesn't need those system frameworks why are so many libraries in Snow Leopard compiled as intel-ppc universal binaries? If those actually get used, a port would be much more difficult.

  • saagarjha a day ago

    Trying to get this to work three OSes later seems kind of hard.