Open Arucard1983 opened 7 years ago
qemu user emulation could work for sure and you probably wouldn't need a different prefix - thanks to FAT Mach-O binaries being used for the prefix (which is a work in progress).
The real question is if there are still any PPC Mac OS X applications that were never ported to x86 and are worth while.
And the same strategy can be applied to the iOS ARM programs. So far, by my experience, I use the Qemu-User-Mode on one ARM computer to run the "rar" utility to create RAR archives, since it was released for x86 Linux only, and I use this little emulator to run "rar", and a very few GTK programs. Also the binfmt_misc module simplify the program management, since PowerPC, ARM and x86 programs can be called from the Darling without effort, since the adequate emulator are loaded and executed directly.
But the main issue is how the Darling executable, when execute PPC code using qemu-ppc-static, the PPC OS X program makes a system call to the Mach API, where, so far I know, are implemented as a Linux kernel module. Qemu not support kernel modules, which could give two scenarios:
If a PPC program makes a direct system call as before, a patched qemu-ppc-static or a special Darling routine will translate some system calls to the native x86 Mach module, as long it is possible, otherwise the program is also killed.
Realistically, very few PPC OS X programs are worth to try, and much of them are old versions of Microsoft Office or Quicken. Some of them, like the PPC Quicken use file formats and functionalities that was made incompatible to the x86 Quicken. Also, some old PPC software had features that was crippled to the most recent ones. Even so, the PPC support to Darling may be comparable to the 16-bit Windows support on Wine. In most cases, most Wine users don't even run Windows 3.x programs, but some do. The same could be applied to Darling.
qemu user emulation could work for sure
It won't, because we link to native libraries; unless you're suggesting users should install PPC versions of their whole /lib.
If a PPC program makes a direct Mach API system-call, Darling will kill the program.
"Good" (see #193) macOS programs only use syscalls and Mach traps via library wrappers; this is how syscall emulation works on Darling. Mach traps are implemented as ioctls on /dev/mach, so this won't be a problem.
What about running Darling on a PowerPC host? There are some games released for OSX that could be played on Linux PPC if Linux supported OSX binaries. With Darling, that possibility is open.
It could be done, but someone would just have to be interested in doing it. I am currently trying to get darling to build on an ARM64 device.
After some real adventuring on programming, I think that the "Darling Rosetta" will require to the user install:
Honestly I think that a Darling Setup applet (Like the winecfg) would be the first thing to do, to help novice users to configure some features.
I was wandering with old PowerPC software that works on Mac OS 9 and earlier Mac OS X to find a real motivation to someday implement the "Rosetta", and I notice that any real use to introduce PowerPC emulation to Darling are 99.9% certain that the old software are games.
But the real problem of the earlier Mac OS X games are actually Mac OS 9 software (PEF executable) and run on real Mac OS X using the Classic Environment, which gives another headache.
So far the only project similar to Wine and Darling dedicated to run Mac OS Classic software was the Ardi's Executor, and an active fork named Executor 2000 was made some improvements, including PowerPC emulation which are highly experimental so far. (The old 68K emulation mode are still there). Maybe on the future the Executor 2000 starts to implement the later Mac OS 9 libraries, or at least the minimum support to run old games, and then integrate on Darling for "Legacy Support".
What about the no-emulation approach like with Wine? Wine does not emulate x86/amd64 in a normal setup but instead delegates Windows library calls to Wine subsystems that hook up nicely into native backends, regardless if the host OS is OSX, Linux or *BSD. This is exactly the kind of support I'm looking for with regards to PowerPC software because I have a big-endian PowerPC machine with AltiVec support. In theory, this is a basic foundation with which a Wine-like API wrapper could work relatively fast.
@grepwood We don't have that hardware and neither do 99.9% of others, so emulation will be the primary way to go.
@Arucard1983 PEF executables are not a problem (easy to implement) and a lot of them could have been executed under macOS without using the Classic Environment. The Classic Environment was aimed at non-CarbonLib CFM (PEF) software.
non-CarbonLib stuff is really better left to Executor 2000.
@LubosD sorry to hear that. Just a heads up - PS3s, G5 Macs and Wii Us are still out there on eBay.
Now Apple introduce macOS 11.0 Big Sur with native aarch64 support (Arm 64-bit). With this, Darling really need to support arm and powerpc builds coupled with Qemu User Mode.
Combining the ideas shared on this discussion, I think that this feature will need the following realistic milestones (Edit):
@Arucard1983 as for number 1, if I can help it, I can either lend my PS3 for development or sponsor a G5 for someone who can drive this. Native PowerPC support a'la Wine's non-emulating support for x86 on x86 hardware would be very desirable for other weirdos like me who still hold on to big endian PowerPC hardware.
As an additional remark about those milestones: PEF PowerPC executables would run always on a preemptive and protected multitasking environment. A native or Mach-O binary (using Qemu for x86 hosts) called pefserver (or whatever named) emulate some flags and stubs for Mac OS 9 and Mac OS X support, and loads the wrapper compability libraries for CarbonLib and GLLib against the Darling's frameworks that was based. The perserver then starts a pefclient for each PEF executable and handles the Mac OS 9 emulation shims when the program requested. If the PEF natively supports Mac OS X libraries, it will be accepted by default, and only fallback for Mac OS 9 emulation when the program don't support it. However, as explained before, the focus would be games and simple programs. The advantage of this approach was the removal of the obsolete 68k software traps, lesser RAM usage by avoiding a full Mac OS 9 virtual machine. Software that require specific extensions, that was enhanced the old Mac OS 9,or been plug-ins or system extensions or control panels, or use 68k code would left unsupported and killed for good. Eventually, additional wrapper for printing could be considered, but the printing request would be pass to native CUPS, instead on the original classic, that uses Mac OS 9 drivers inside Classic just for printing!
I found on GitHub a (unfortunately) abandoned project that precisely would implemented the #4 and #5 features: Classix. https://github.com/zneak/classix
This was intended to run PowerPC PEF executables of the Mac OS 9 era using a compatibility layer that implement some Classic libraries over the Mac OS X frameworks. The project included a PowerPC binary translator emulator to run on Intel machines. My humble suggestion is someday to fork this project and integrate to Darling, just in case to run old PowerPC games that could run on OS X or Mac OS 9 that require some libraries of the older operating system to run.
My other hand, a potential list to test the Darling's PEF support would be:
Diablo II & Lord of Destruction Age of Empires II (MacSoft port) Microsoft Office 2001, X and 2004 (both are PEF executables with Carbon support.) ... (fill a game with native OpenGL support)
@Arucard1983 you can try WarCraft 3 if you have the original iso lying around. Blizzard's last patch that had PowerMac support was 1.26a IIRC
@Arucard1983 @grepwood PM me on Discord mePy2#0741
@mePy2 sent you a friend request.
What about running Darling on a PowerPC host? There are some games released for OSX that could be played on Linux PPC if Linux supported OSX binaries. With Darling, that possibility is open.
This could be handy for things like Flash games on PPC Linux. Adobe made a stand-alone player/projector up to 10.1.102.64 for PPC OS X, but never made a publicly available PPC Linux build. Emulating the x86 ones in qemu is quite painful.
@wyatt8740 at this point I'm more inclined to wait for a proper FLOSS Flash replacement to arrive. Here's a quick rundown of the Flash situation I mailed a while ago:
there's Lightspark, which has pretty much no publicity, but sounds promising
And with that said, Lightspark is actually working rather well except for anything relating to ActionScript. Last I tested it, it could animate things, but any sophisticated automations like loading bars and buttons did not work.
There's also Ruffle, a flash emulator written in rust, last time i tried it was half a year ago, and i was able to run some simple swf animations and games on it.
@wyatt8740 at this point I'm more inclined to wait for a proper FLOSS Flash replacement to arrive. Here's a quick rundown of the Flash situation I mailed a while ago: …
Yeah, I am largely in agreement there. Especially the part about Mozilla.
Ruffle worked pretty well for a lot of things – though unfortunately, the desktop version currently requires a Vulkan renderer which lots of machines (including power macs) don't have without falling back on software rendering implementations. Gnash (while abandoned) works quite well for older flashes, but is getting harder and harder to build all the time. It's probably just one or two more FFmpeg API breakages away from me giving up on it.
Lightspark… is interesting, but still flawed in some major ways, and prone to segfaulting in my experiences with it. Also, it has some endian problems that cause incorrect colours on PowerPC as well.
lots of machines (including power macs) don't have without falling back on software rendering implementations
PowerMacs IIRC come in variety of shapes and sizes. Some with integrated graphics, some not. We know PowerMacs like IBM PCs have PCI, AGP and PCIE ports, so it shouldn't be a problem to:
Although is a little early to implement the "Darling Rosetta", since the Appkit support is highly experimental, and command line utilities are ports from Linux programs, one of the target uses of Darling use may to run old Mac OS X programs coded for the Power PC architecture.
So far, there's two ways to achieve this functionality:
Get the PearPC CPU core emulator, and port to Darling.
I think the first approach is more easy to achieve, and won't require much effort to implement.