Run Darwin programs on LinuxPPC?

Benjamin Herrenschmidt mol-general@lists.maconlinux.org
Tue, 16 Apr 2002 18:50:56 +0100


>
>I might be confused here, but if we're doing true binary
>compatibility, won't the OSX native Quartz binaries work?  ;-)  There
>would have to be an OSX compatible *video ABI* for that to work, but I
>don't think Quartz would have to be rewritten.
>
>This is assuming Quartz is in userspace or can be coaxed into Linux
>userspace; I suppose it is possible it is a Mach process, I'm not that
>up on the issue.

The big problem with an ABI compatibility is that Darwin ABI is far
from simple.

 - The BSD part is probably the simplest
 - The Mach messaging part (a lot of stuffs, including Quartz, rely on it)
 - The IOKit. Here's the core of the problem. The IOKit is the way most
   drivers communicates with userland on Darwin. That more/less replace the
   whole /dev/xxx + ioctls stuff we have on linux. Quartz, for example, rely
   on a bunch of primitives provided by the IOKit for graphic devices. That
   would have to be emulated and it promises to be rather painful.

Another way would be to take the actual darwin kernel (including IOKit but
exluding Apple drivers) and do a bit like mklinux, that is remove the core
of Mach, and replace it with a direct interface to the linux kernel. I'm
afraid however that mach & linux semantics differ way too much to make that
simple. Then, we could have to write IOKit drivers for emulated HW (display
etc...), but this is less painful that re-writing the entire IOKit framework
and APIs.

Ben.