Running Mac OS X Binaries With NetBSD
An anonymous reader writes "KernelTrap has an interesting article about an effort to add a Mach and Darwin binary compatibility layer to NetBSD. The project has evidently already made a fair amount of progress, currently working to stabilize the WindowServer emulation portion that will then allow NetBSD to run Mac OS X graphical applications."
That's great, really, but what is there to discuss? Now we can run apps from OS X on OS Y (my apologies), happy day. Next topic!
evil adrian
That's pretty cool, but personally I'd probably just run OS X, it's a very nice OS. I can see where this would be nice though. Now if they can make this run on x86s (I know, VERY though, that requires emulating a ton more stuff) then I'll rush to download it.
Comment forecast: Bits of genius surrounded by a sea of mediocrity.
It's only the NetBSD/powerpc port. The biggest problem with MacOSX is that it only runs on Macs. If I'm going to pay all that money for a shiny new Mac, I'm going to run Apple's shiny new operating system.
Someone stole my old sig.
But one question: is there anything Apple can do to stop this?
If you remember, they've been *very* anal in the past about some things they consider to be "their stuff", such as the look and feel of the OS. I can't see them just sitting around and watching while all their OS capabilities are matched (or, for that matter, exceeded).
If they sent C&D letters for freakin' themes, I doubt they'll just sit around while their API is emulated. They've show themselves to be rather devious, and I'd be a little worried if I was a NetBSD developer.
Dragging people kicking and screaming into reality since 1996.
Oh now look what you did: You woke the swarming team of Apple lawers on a beautiful sunday morning. They're going to be extra pissed.
_______
2B1ASK1
Or should that me...of course NetBSD runs it? Whew...imagine the possibilities. NetBSD runs on next to anything, and can run binaries in all those formats. /me installs NetBSD on his watch and tries to load Mail.app Dangit! Doesn't work. What crap is this???
Please correct me if I got my facts wrong.
Taken to its logical extreme, it appears that these guys would create a de facto x86 OSX. What would be missing? Obviously the OSX UI (could easily be cloned)...and some multimedia stuff. What else?
to use this, since it is only binary compatability. So You will still need to buy PowerPC based computers. And who is one of the largest and most noted for selling powerPC based PCs... Apple Computer; so why not just run MacOS X?
I know you can buy third party PowerPC computer, but they are more expense than Apple's machines.
I do appricated their effort, it is probably a good exercise in programming skill.
It would be useful if it was on x86, but there are plenty of problems with that; see
http://www.emaculation.com/ppc.shtml
(This is not a flame, just an observation)
Accentuate the positive, don't waste your mod points on the negative.
What works?
On NetBSD/i386: nothing. On NetBSD/powerpc, most UNIX binaries, such as ls, sh, or vi will work. No Graphical User Interface (GUI) based program will work for now. We are able to startup WindowServer up to the first attemps to use the IOKit. See the kernel traces for WindowServer and for mach_init to discover how far we have been.
Here is what have been implemented so far:
Mach-O binaries loading
Mach system calls handling
Minimal Mach ports, messages and rights support, so that simple program are able to link and run.
Signals handling (except for siginfo) Minimal multithreading support
Support in ktrace/kdump to display Mach messages (useful for debugging)
Hacks to get mach_init starting (and to get it behaving as bootstrap mach_init)
Support for port rights carried by Mach messages
Here is what is in the TODO list:
Implement Mach notifications for destroyed ports, dead names, and no sender ports
Re-implement enough of Darwin's IOKit to get
WindowServer actually displaying something.
Use COMPAT_MACH for COMPAT_OSF1 (Tru64 binary emulation on NetBSD/alpha), to get multithreading working.
Get Darwin binaries to link and run on NetBSD/i386
Running Gnustep on NetBSD? It has most of the NEXTStep/OS X libs already ported over to Linux (And therefore easily ported to NetBSD)...
This will be one of those things where it's cool because you can do it, but is there really any reason to do it? Kinda like Mac on Linux.
Karma: The shiznight, mostly because I am the Drizzle.
... you only have to make sure both your windows and OS X binaries are for the same processor architecture.
Programming can be fun again. Film at 11.
I wonder if this could be used to get an increase in speed for running OS X apps without the overhead of the OS X GUI? If it eliminates the eye candy effects, I'd bet it'd be noticeably faster.
8==8 Bones 8==8
Running Photoshop or Office would require a complete reimplimentation of Quartz, Aqua, Carbon, and quite a few other OS X technologies. Besides, even if successful, it would only work under LinuxPPC. The work necessary to get Wine to run Photoshop well is a small fraction of what would be needed to port all OSX API's to Linux.
It's hard to be religious when certain people are never incinerated by bolts of lightning.
why on earth would i want to kludge linux on a Mac to run OSX apps when I can just run OS X? you'll notice that the project is still only for ppc machines, and while LinuxPPC/YDL is nice, i really prefer X...it's just so much better a *nix on the Mac...
Facts do not cease to exist because they are ignored. - Aldous Huxley
Time for a PlexPPC, similar to Plex86...
--- Hindsight is 20/20, but walking backwards is not the answer.
Mac-On-Linux
OK, it's not binary compatibility, but unlike COMPAT_MACH and COMPAT_DARWIN it does already work. But COMPAT_MACH and COMPAT_DARWIN are very interesting and worth keeping an eye on it.
Oh, BTW.... From the MOL-FAQ:
Um...I use MOL and have found it to be far from pointless. I use MOL mostly to run a FirstClass groupware client. The reason why I run Linux on a Pismo Powerbook is that I have an environment mostly identical to my x86 Linux machine at home. This means Linux largely frees me from worrying about underlying architecture (Wine and so forth aside). I have not found OSX to be so insanely great that I should blow away my Linux partition. Believe it or not there are good reasons to prefer Linux over OSX.
I have also found MOL to be far more reliable than Classic on OSX. Classic is much slicker in that OS 9 apps run directly on the Quartz desktop and one can cut and paste between apps. This also means it is more complex and therefore failure prone. My boss has no end of trouble with it. Classic icons go missing or change themselves into another apps icons. Some Classic apps will lock and won't release control to the Aqua UI. This means the machine is locked up for end user intents and purposes. Classic inflicts HFS metadata problems and some instability on OS X and kills much of OS X advantages if one has to make heavy use of OS <=9 apps. On the other hand if the OS 9 in my MOL sessions screws up then I can kill it and restart without affecting my Linux session. Since I boot my MOL session from an image I have an advantage normally only associated with virtual PC. If that boot image gets messed up, I can replace it from a backup quickly. Incidentally, MOL is very close to running OS X acceptably...eye candy and all.
MOL is can also be used as a user mode Linux. One can boot another acceptably fast Linux inside a virtual machine. This is useful for things like kernel development. MOL is far from pointless.
It does alredy exsist. It called Mac-On-Linux.
Most FreeBSD users I know have no interest in Photoshop or Office anymore now that the alternatives are as mature as they are. I think users of any BSD would enjoy this new compatibility, but I think it could be just as valuable to everyone (except MS) if MacOS X gained some compatibility layers.
You're making a lot of assumptions. Firstly, that such an emulation system could be completed in any reasonable amount of time, and could keep up with Apple. Obviously, that isn't the same kind of issue as it is with Wine as Apple is a lot smaller, and to be frank, Windows has far more APIs and features to the developer than OS X does (at present).
Secondly, you're assuming Apple would let this happen. They can't stop a cleanroom implementation, but they can copyright the artwork which is a big deal to Mac users. Wine has to have its own artwork for instance (but not for the widget toolkit, as the Win98 L&F is so basic it can't really be copyrighted). Not that nice distinctions like code vs art would bother Apple, they have a long history of abusive lawsuits.
Finally you're assuming that such an emulator could emulate PPC opcodes at a reasonable speed, which is a) hard and b) unlikely.
Bear in mind that doesn't say "You can run MacOS apps on NetBSD", far from it, they have some of the basics of Mach IPC working. They haven't even started on graphics support. If there's something we've all learnt from Wine (which has 2 companies working on it as well as hundreds of volunteers), it's that cloning another OS's APIs is a lot of work, and as most of the MacOS APIs are not simply lifts of their UNIX equivalents, they are Apple proprietary (iokit/coreaudio etc), that's no less amount of work.
IMHO, the hardest part to copy, clone or imitate in Mac OS is the way the OS extends outside the Apple software.
The much appraised Mac 'look & feel' bases itself on all developers sticking to the UI conventions and guidelines, nicely outlined in this guide for porting over Win32 apps.
The longer you use Mac OS, the more you'll appreciate this 'cultural' aspect of the OS.
Having used Windows XP a lot lately, I've been quite happy with the OS and 'Window Manager' itself, but as soon as I actually use an other app, the whole experience breaks down.
Keyboard shortcuts vary, widget placement is random, the tone of dialog varies and in general, application interoperability seems harder.
Funny how so many people lust after the visual aspect of the UI, risking lawsuits from Apple, while the 'feel' part - the real magic of Mac OS - is quite publicly available AND applicable in form of UI guidelines.
It won't hurt your Win/Linux app to apply some/all of these guidelines instead of no guidelines at all.
J
Notice the part you didn't quote:
"Once we will have a fully functionnal Darwin binary compatibility on NetBSD/powerpc (if that happens some day), we will just have to grab Mac OS X libraries to run any MacOS X program"
I.e. you would still have to have the whole Mac OS windowing, graphical, and multimedia (QuickTime) environment for something like Photoshop to run. That's a far cry from just getting Darwin running.
The only legal way to get the Mac OS libraries is to buy Mac OS from Apple. Or reimplement them in a legally defensible way. Good freaking luck.
A question..
..it will not harm you!
The status report link is from 1/2002...
Did anybody bother to read it before posting?
70 people so far did not..
The actual project ot watch is not NetBSd..in that they don't have the nice Apple relationship like Darwin does..
In fact if my memory is right the proejct was stopped because they were duplicating Darwin's efforts..
To see if MacOSx will run under intel machines check Darwin porject site not NetBSD!
Come on People read once in awhile
Show yourself to better than those wintel geeks who don't even read but jsut spout what MS Gates wants..
Don't Tread on OpenSource
Umm.... you could just buy a Mac and VirtualPC, then install Xfree86 in rootless mode. Seems like a simpler means to the stated end, considering that a Mac running Mac OS X is a "unix box".
OK, this is probably a stupid idea but..
Anyone know what kind of speed a powerpc emulator running on a x86 would get?
If this OSX apps on BSD/PowerPC jazz works, what would you get if you coupled it to a powerpc to x86 emulator and had OSX running on a x86?
Even if it ran at half the speed you might end up getting a cheaper 'mac' because x86 hardware is cheaper?
now i'm really lookin forward to installing NetBSD on my Quadra 660av. kudos to NetBSD!
"You never want a serious crisis to go to waste." - Rahm Emanuel
Realizing the 'open source' (sort of) nature of Darwin, I've thought of doing this myself (for linux).. but just didn't have them time.
For those who think this is a dumb idea.. you're not seeing the bigger picture. Currently, MacOS X only runs on G3 and G4 apple machines designated by Apple unless you boot Linux and install Mac On Linux (similiar to Plex86 for PPC). If you can run OSX applications on Linux, NetBSD, etc.. then you wouldn't need the overhead of a VM. Your RS6000 could run OSX with minimum overhead. From NetBSD you could run from the same machine, binaries compiled for: OSX, Linux, FreeBSD, and NetBSD.
Personally, I don't like OSX; However, I wouldn't mind being able to run natively on Linux: Internet Explorer, Quarx Express, etc.. Not to mention that Quartz is a pretty neat looking, X11 compatable (with Xfree86-rootless) windowing system.
This is more important for Linux than NetBSD, only because NetBSD currently has poor support for devices on many PowerPC machines (compared to Linux), especially laptops.
Please stop comparing COMPAT_MACH to WINE. The WINE project is attempting to build cleanroom implementations of the Win32 API. The COMPAT_MACH folks are working on binary compatibility. If you want to talk about APIs look up GNUStep which is an implementation of the OpenStep specification. That is a project more analguous to WINE because it is actually attemping API reimplementation. If this project gets everything working it could allow NetBSD to be a drop-in replacment for Darwin as a BSD subsystem and kernel. WINE and GNUStep on the otherhand would be drop-in replacements for application level APIs.
I'm a loner Dottie, a Rebel.
*BSD's COMPAT_* are better than MOL and plex86 because there is no overhead of a secondary kernel.
Opcode emulation is probably the easiest part of emulating the PPC. Much harder is the emulation of all those registers with the handful in x86. This will be much easier with x86-64 (AMD) because you have twice as many registers, but you still have to determine which registers are being acted on and swap the contents of registers in and out as you go -- basically, the same thing modern CPUs do internally to reduce the cost of context switches (register renaming) except you're going to have to do it in software. You might be able to avoid that in the case of a transmeta CPU, but the proper way to do that with a TM chip is to make it emulate a PPC anyway. I really hope someday transmeta manages to emulate something other than x86, and further that we end up with systems with multiple TM CPUs on them so that we can emulate multiple CPUs of different architectures.
Incidentally, CPU-manufacturing companies are really goddamned annoying. Why oh why can the FACT SHEET for a processor not tell you in simple terms how many general purpose registers it has? You have to go all the way to the user manual... Anyway the G3 has 32 GPRs and 32 FPRs (floating point), I had that noted down already and didn't want to look up the G4 to see if it has more (it probably doesn't, except for altivec.) I'm only familiar with four GPRs on x86; [E]AX through [E]DX. There are a number of index registers, many of which can be used as GPRs, but which in practice nearly always must be used for their design purpose. Of course motorola uses GPRs for indexes so the real number of usable GPRs is closer to four times as many than eight times as many as it at first appears.
In any case that's a LOT more registers! You think context switches are bad now...
"You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
Perhaps surprisingly, it probably isn't illegal!
...
I'm assuming that this NetBSD kernel+shim is being used to replace just Apple Open Sourced components , in which case, you seem to fall within the scope of section 2B of the Mac OS X License.
To be totally careful, your step 2 would have to be Joe User nukes the shipped Darwin kernel with his new kernel, but I doubt it makes a difference, as long as it is the same computer; the computer can run only one of them at a time.
2. Permitted License Uses and Restrictions.
B. Certain components of the Apple Software have been or may be made available by Apple on its Open Source web site (http://www.opensource.apple.com/) (collectively the "Open-Sourced Components"). You may modify or replace only these Open-Sourced Components; provided that: (i) the resultant Apple Software is used, in place of the unmodified Apple Software, on a single Apple-labeled computer; and (ii) you otherwise comply with the terms of this License and any applicable licensing terms governing use of the Open-Sourced Components. Apple is not obligated to provide any maintenance, technical or other support for the resultant Apple Software.
How about "OSXE"? Pronounced "Oh sexy."
I've saw once such "COMPAT" - Wine. Comparing to stable and fast MOL, Wine is crashy and slow. I don't expect good results from BSD if they will do it like Wine.
Less is more !
Basically, what the COMPAT stuff emulates is not the somewhat ill-defined layer between libraries and applications in Windows, but the very well defined (and open-sourced) layer between the kernel and user-land. In order to make it useful, I'd suspect you'd need almost a full OSX installation.
Go Badgers! -- #include "std/disclaimer.h"
That was my plan, as im sure it would be ported over.
I commend the NetBSD people, but i still use FreeBSD for now since im only running i386 chips these days.
---- Booth was a patriot ----
Or, wait, what about devices? The biggest problem of MOL is that every device has to be reimplemented. As a result, today the MOL user can forget about virtually all USB and Firewire devices: printers, scanners, cameras. Is this the same problem with NetBSD's COMPAT?
Less is more !
about html <br> tags.
You can't judge a book by the way it wears its hair.
Under most versions of Unix, there is a very similar interface between the user application and the kernel. Basically, the COMPAT stuff just says "Well, this program is a MacOS X program so when it makes a call that looks like A, it really means B under NetBSD so go do that and I'll reformat the results back to what the binary is expecting". The result is that the OSX binary is really running natively under NetBSD so any device supported by the NetBSD kernel *should* be supported by OSX. It looks like their present state is trying to get enough of the OSX device interface working for that to happen.
Go Badgers! -- #include "std/disclaimer.h"