Getting to the Source of Mac OS X
by Chris Coleman12/21/2001
When Apple began developing Mac OS X, they did something really cool: they chose BSD Unix as the core foundation for the OS. On top of BSD Unix, they added their programming APIs, Graphics Engine, and Aqua GUI. This is common knowledge. But what many people don't know is that the source code for much of Mac OS X is available to the public.
But Apple didn't open source all of Mac OS X. They kept enough closed to make a very good commercial product while not limiting its usefulness for developers.
Darwin, the base operating system upon which Apple layered its components, is the open source component of Mac OS X. It's based largely on FreeBSD Unix and Mach technologies. Most of this code was already open, and Apple chose to keep it that way. The existing business-friendly license on the code allows Apple to create a proprietary version and maintain an open source version without compromising any of their intellectual property.
Darwin Can Stand on Its Own Two Feet
Since Darwin is there working all the time beneath the Aqua interface, this Unix-based core of Mac OS X can be accessed directly using the Terminal application. Apple has even taken things one step further and added enough of its own code to Darwin to make it a stand-alone operating system.
|
Related Reading
|
You can install Darwin on your computer system and have a fully functional Unix server, or activate the standard XFree86 graphics engine to turn it into a Unix desktop. Many popular Unix applications have already been ported to Darwin.
Installing Darwin as a standalone OS is much like installing BSD or Linux, especially versions that only have a text-based installer. It asks you a few questions about where you want to install it and then goes to work; it's still a very simple installer. The install notes recommend disconnecting all drives except the target drive. It says this is to prevent the accidental destruction of data on the wrong disk. This is the first release that Darwin has had its own installer, so this really isn't that unexpected.
Also new with this release, XFree86 comes installed by default. Since XFree86 for Darwin doesn't need a configuration file, you should be able to start X immediately. However, you may wish to install a different window manager than the default one.
If you're interested in working with XFree86, we've already published some articles to get you on your way. Michael Norton's Installing XFree86 on Mac OS X and my Rootless X Server on Mac OS X will provide you with all the info you need.
At this point, Darwin will feel very familiar to users of Unix. All the familiar tools are there, ranging from sed, to ssh, to vi, to Perl. It also has the standard suite of developer tools, like CVS, GCC, GNU Make, and even BSD Make.
If you register at their developer site, you can check out a current copy of the source code from CVS. If you don't register, you can get a copy on CD or download it project by project from the 1.4.1 Release site.
Apple also makes it very easy to contribute as a developer to the project. Just make your change available for download and submit a modification request at http://www.darwin.org/projects/modifications.html.
Darwin is Open Source
Darwin is 100% open source (you can check out the source code online). It's also free via a download, or available for purchase on CD with lots of Darwin-packaged applications. To download it, go to Darwin.org and grab the PowerPC version (it's a CD image that needs to be written to CD before installation). You can also purchase the CD from BSD Mall.
When a project is released into the open source community, it takes on a life of its own. How it's developed doesn't necessarily correspond with the goals of company sponsoring the project. The original creators have two basic options:- Ignore, squash it, and don't let changes in to the code base.
- Or, accept it and let the code thrive and evolve.
Apple has chosen the latter option, even to the point that there's a download available for the Intel platform.
Darwin on Intel
|
| |
Yes, that is what I said. Darwin, the core of Mac OS X, is available for the Intel platform. Granted, it only works on a limited number of hardware configurations, but work is progressing to increase its compatibility on more Intel processors. This port has been coordinated entirely by volunteers in the open source community.
Here's where the supported hardware stands at this point:
- IDE: Only the PIIX4 IDE controllers have been found to work. Attached devices must be UDMA/33 compatible or better.
- Ethernet: Intel 8255x 10/100 ethernet controllers are supported.
- Video: You must have a VESA 2.0-compliant video card. Almost all modern graphics cards are VESA 2.0 compliant. However, emulators such as
vmwaredo not have VESA 2.0-compliant emulated video cards. - Successfully tested hardware: All 440BX motherboards tested have worked with their internal IDE controllers. IBM ThinkPad A21m (with onboard Intel ethernet)
- Known to not be supported: All AMD- and VIA-based systems.
As you can see, the list of supported hardware is pretty slim. Also there are a few known issues to consider before installing on x86. From the release notes:
- IDE drives may not work on x86. Try it, if it doesn't work, it's a known problem.
- Video cards must support VESA 2.0 framebuffer modes on x86. Try it, if your console looks weird, or doesn't appear, it's a known problem.
The installer is basically the same on x86 as on PowerPC. Both require you to burn the downloaded image to CD before installing. I didn't have much luck with the spare x86 hardware I had available, but I'd be interested in hearing some success stories.
A Brief Review of the State of Darwin
- Darwin is the BSD Unix core of Mac OS X. To create OS X, Apple takes Darwin and adds "Core Graphics," QuickTime, Carbon, Cocoa, and Aqua.
- Darwin is a complete OS. Even though Darwin is used as a part of Mac OS X, it's a complete operating system on its own. It comes standard with XFree86 and has a wide selection of applications available.
- Darwin is directly accessible from inside Mac Os X. You can fire up the terminal application, or install XFree86 on OS X and utilize the Darwin core directly.
- Darwin is open source. Apple used BSD License code from FreeBSD and Mach and added their own code to create Darwin (governed by the Apple Public Source License recently approved by OSI as an Open Source License). You can become a developer of Darwin and obtain the source code.
- Darwin is free. You can obtain it via a free download or buy it on CD. Both PowerPC and Intel versions are included on the CD set. If you download Darwin, you will need to burn it to CD to install.
- Darwin is available for any Power PC Platform that can run Mac OS X. However, Darwin is also available for Intel hardware and Mac OS X isn't.
The code in Darwin is the same as the code used to build Mac OS X. So if you want access to the source code for Mac OS X, you need to become part of the Darwin project. The department at Apple responsible for Darwin seems very responsive to community needs and feedback. As you can tell from the inclusion of Intel support, this is a true open source project. Apple has fully embraced the open source spirit, without compromising its financial interests.
You must be logged in to the O'Reilly Network to post a talkback.
Showing messages 1 through 9 of 9.
-
Re: OS X on intel ? Porting Possiblities
2002-05-24 06:30:17 kane121975 [Reply | View]
Is the guy that wrote this statement high or is he just an idiot. NextSTEP never used Windows NT technology. The only thing Windows NT used of next heritage was the Openstep Development environment. That was ported over and that was it. It never used Hal it alwasy used Mach as the microkernel and BSD unix as its abstraction layer. Even when Jobs ported it over to the x86 hardware. So before you print something and make yourself look like an idiot learn what you try to talk about. -
Let's show a little decency here... Re: OS X on intel ? Porting Possiblities
2003-04-15 21:57:58 anonymous2 [Reply | View]
It doesn't look like you read the post you're so brazenly flaming. Before you call someone an idiot you might consider whether you understood what they said. I don't think he's saying that when you bought a NeXT box it was really NT, but that you could install NeXT on top of NT (probably much like Be allowed you to install BeOS on top of Windows).
-
OS X on Intel machine? Porting Possibilities
2002-01-03 08:45:49 markstinson1 [Reply | View]
Obviously Porting to a entire different architecture can pose a big challenge. PowerPC & IA have quite different of operating on the lowest level.
However, a little historical reflection should reiterate it is entirely "doable" for Apple.
Way back around '90, there was a version of System 7 ported to Intel with the code name "Star Trek" - bolding going where no man has gone before". This was an important step because of Apple's hardware design. The Mac OS used a ROM chip soldered on the Mainboard. The downside is that it could never be upgraded. There's other Pros/Cons.
Shortly there after in the Mid '90s, Apple moved that ROM chip's data to a file in the System Folder. This allowed for updated ROM files. This file used to be very hardware specific, now it's just Apple Specific. Mac OS X doesn't require the ROM File, per se. Classic emulation does require it.
But what about the different binaries required for PowerPC and Intel Architecture? Enter NeXTStep. Mac OS X is the modern version of NeXTStep. It is a BSD Unix variant that runs on a Mach Microkernel. [ NeXT was formed by Steve Jobs after Scully fired him from Apple back in the Late 80's. So it should be noted, that Mac OS X / NeXTStep has a longer history than Windows NT, even excluding its Unix history. ] Left
The Microkernel, acts just like Windows NT's "HAL" Hardware Abstraction Layer . NeXTStep originally ran on 68K Motorola based hardware. However, NeXT started encountering financial issues surrounding their hardware division. Due to their strategic planning of the operating system, NeXT with able to port their operating system to Windows NT. Now instead of using Mach, their micro kernel was Windows NT. NeXTStep literally took over the NT operating system. However, programs written had to be compiled to support one platform or both. Due to its Unix roots, NeXT applications bundled its resources into directory structures and called the enter structure a ".app" . This allowed multiple executable binaries for different platforms to share the same application resources. The applications (really directories) could be relocated and ran from anywhere, just like on the Macintosh (a feature Windows could sorely use).
If you open the contents of the current Mac OS X application, you will see it has the same structure as the old next applications. In fact, the native Mac OS X development tools are updated versions of the NeXTStep development tools. Even the language, Objective C, is NeXTStep's native programming language.
If Mac OS X was ever ported to Intel platform, having anything Classic (pre-OS 9) or Carbon (OS 9/OS X) is probably possible using an emulation later. If it is to be strictly OS X or OS X server, it's probably doable right now. But as in the previous posting this would significantly impact Apple's hardware revenue. It would also impact the other Unix-like communities of Linux and BSD being that Mac OS X is the first commercial grade Unix-like Desktop OS. As to the impact of Microsoft, your guess is as good as mine - hitting a 900 lbs gorilla tends to make it mad. -
OS X on Intel machine? Porting Possibilities
2003-04-14 08:13:27 anonymous2 [Reply | View]
Why are you talking about it being ported??? Apple when OS X was in beta by the name of "Rhapsody" was released for Intel. Infeact was branded "Rhapsody for Intel" It required no ROM and could even be installed over NT so you could run NT windows based programs, and Mac OS programs.
-
OS X on Intel
2001-12-26 00:32:11 ablair [Reply | View]
It seems that anywhere Apple's plans are mulled over, or OS X's open source roots are introduced, there is an immense & bottomless interest in MacOS X on Intel hardware. One can only hope that this interest would trnaslate into a tidal wave of OS purchses if ever Apple Computer released an x86 version of OS X, because they would be destroying 80% of their revenue base in the same fell swoop. Apple is *hardware company* and they get most of their revenue from selling computers, not operating systems.
However, an Intel-version of OS X exists, even if in rudimentary form. MacOS X (the "Yellow Box" environment while the OS was under development) and Classic (the Blue Box environment in OS X) are both well known by now, but development was thought to be halted internally on Red Box (MacOS X on Intel version) shortly before it was completed. This is the reason the MacOS is still around at all (and not an unfortunate anectdote like OS/2): because Apple has wisely decided *not* to release such a version and deep-6ing their hardware market.
That being said, if certain conditions in the industry are right they could quickly release OS X on Intel, but only if they are sure of being able to play on an even field in the OS market on Intel hardware. The principal condition is undoubtedly if Microsoft is restricted from maintaining an unfair competitive advantage by tying Office, IE or other MS products to the Windows OS, probably ensured via breakup as ruled by Judge Jackson. Since this is now unlikely to happen any time soon, don't expect Apple to suicide themselves by competing with a company that holds all the strings. As evidence of this danger, you don't see any other significant market-share competitors around to the MS hegemony, do you? There used to be.
For now, we will have to be satisfied with Apple's open-source Darwin core on Intel hardware. Notably it does not have Aqua, but it is gaining steam as a streaming server platform for Quicktime content, amongst other things. And happily, improving quickly. -
OS X on Intel
2004-10-07 10:12:26 dive@myrealbox.com [Reply | View]
Also - keep in mind that Microsoft Corporation owns a controlling interest in Apple - 1/3 of the stock is owned by Microsoft. This can explain why Apple does or doesn't do a lot of things, and why Apple will not directly compete with Microsoft by releasing an Intel version of OS X. It would be too popular and pervasive, and could take a lion's share of the PC operating system market.
-
OS X on Intel machine?
2001-12-22 20:38:59 cms7912 [Reply | View]
This insightful article eludes to this possibility, with Darwin on an Intel. Is it possible to then add "core graphics, QuickTime, Carbon, Cocoa, and Aqua" on top of this Darwin installation and run OS X on an Intel?? Is this theoretically possible or has it been done? -
OS X on Intel machine?
2004-12-10 12:27:18 cparker15 [Reply | View]
Core Graphics, Carbon, Cocoa, and Aqua were compiled for the PowerPC architecture. Therefore, they WOULDN'T be able to run on an x86 machine, even with the same base operating system.
Theoretically, it would be possible if these components were ported, but only Apple has the source code, and the last time I checked, it was illegal to reverse engineer/decompile proprietary binaries. -
OS X on Intel machine?
2001-12-31 18:24:59 shareme [Reply | View]
I don't know remebr Quicktime and Java were split into parts to get to run on MacOSx one part is in the OS layer itself on part in the app..
But I don't see whynot as long as you had some wahy to get apsec to reverse engineer or and combination of source and spec to reverse engineer






