What is Darwin?

DarwinI am very happy about the direction in which the Mac OS X GUI is going, although sadly many Mac users aren’t interested in (or don’t know about) the “lower levels” of the Macintosh Operating System. Have you ever wondered why the Terminal greets you with the words “Welcome to Darwin”? Why do BSD and Mac OS share certain bits of code? Why does Wikipedia describe Mac OS X as a graphical operating system? Today we’re going to take a look at the underlying open source technology which powers your fancy Leopard OS – the hidden core set of components, named Darwin.

Let’s take a trip back in time…

Every Operating System has a core, called a “kernel”. Mac OS X uses a hybrid kernel – the Mach microkernel developed until about 15 years ago at Carnegie Mellon University. The Berkeley Software Distribution project, a Unix derivative from which FreeBSD and similar distributions were born, used this kernel for its BSD version of UNIX. During the development of this kernel and the growth of the BSD project, a certain Steve Jobs founded the NeXT company. Apple bought this company in 1996, effectively bringing Steve Jobs back to Apple as interim CEO (most of you probably know he left Apple in 1985). NeXtStep was a very important “step” towards Mac OS X. After a few failed attempts at using various projects, like Taligent or Copland to base their new OS project on, Apple decided to simply buy NeXT and use OpenStep, a programmer-friendly OS by NeXT, as its foundation for further development.

OpenStep used the Mach kernel. The developers at Apple then took advantage of the permissive BSD licence (which is not as aggressive towards commercial use as the GPL, for instance) to build the first Darwin with BSD code, along with other Free Software projects’ code. Thus, Darwin was born. That is why the Darwin kernel is based on both FreeBSD and Mach 3.0 technologies.

Yes, your shiny Mac OS X and the ultra-geeky NetBSD have a lot in common. Like most UNIX systems, Darwin includes the standard set of UNIX tools, along with Apache, sendmail and similar services.

A new version of Mac OS X is prepared by putting together the different pieces of Darwin and Apple’s Quartz graphics system. Of course, the developers at Apple include their own applications and modifications, making Darwin a user-friendly environment. Your iPhone runs Darwin, too.

So now you know! You may think you don’t need this knowledge, but maybe sometime in the future you will see some potential in the UNIX base. That is why you can run X natively, for instance.

Go read the Mac Terminal Introduction by Alex and learn more!

Find out more on these sites:
gnu-darwin.org
developer.apple.com
kernel.macosforge.org

Again, “Welcome to Darwin”!

P.S. I would like to hear comments from developers. I did my homework, but if you have more information please let us know about it!

Comments

18 Responses to “What is Darwin?”

  1. Lucky on April 8th, 2008 11:04 am

    I just wanted to be notified of other replies :P

    Great post! There is some stuff I didn’t know about :)

  2. Michael Engel on April 8th, 2008 12:59 pm

    Some small corrections – BSD distributions (4.x BSD or the Net/Open/FreeBSD derivatives) never used Mach as a kernel; instead they used and still use their own, monolithic kernel(s).

    The hybrid kernel of OS X is in fact based on Mach 3 with BSD kernel parts added in the same address space (to speed up system calls). NeXTs kernel (as well as Rhapsody and OS X Server 1.x), however, was based on Mach 2 (with some improvements from 2.5), which is more of a traditional monolithic kernel. It helps when you’ve got one of the principial Mach developers (Dr. Avie Tevanian) working for your company, it seems ;-) .

    Apple’s first efforts in using Mach 3 were, however, based on Linux. In fact, there was an officially supported, Mach 3 microkernel (i.e. non-hybrid) based Linux version called “MkLinux” available for early PowerPC based Macs. MkLinux was developed in cooperation with the OSF, but never saw widespread use.

    The portability of NeXTstep and OpenStep were, btw, very important in making Apple’s switch to x86 instead of PowerPC rather easy, since both NeXT OSes already supported four different system platforms (“black” 68k-based NeXT hardware, i486 PCs, Sparc and HP-PA, though HP-PA support was dropped from OpenStep 4.2).

    – Michael

  3. Leonard on April 8th, 2008 1:13 pm

    I did know that by reading John Siracusa’s reviews of Mac OS X since the public beta.

    Still very interesting material.

  4. Joi on April 8th, 2008 4:03 pm

    Neat.

  5. Daniel Cedilotte on April 8th, 2008 4:03 pm

    Another thing to point out is that NeXTStep is a framework, not an OS. OpenStep is a version of NeXTStep made by NeXT with Sun Microsystems. And in turn, GNUStep is an open source version of OpenStep.

    NeXTStep on Wikipedia (http://en.wikipedia.org/wiki/NeXTStep)
    OpenStep on Wikipedia (http://en.wikipedia.org/wiki/OpenStep)
    GNUStep on Wikipedia (http://en.wikipedia.org/wiki/GNUStep)

  6. Joël Kuiper on April 8th, 2008 5:50 pm

    Actually the operating system is called Darwin upon which higher-level OSX functionality is build.
    The kernel is called XNU (http://en.wikipedia.org/wiki/XNU) which is the combination of the Mach hybrid-kernel structure and the parts borrowed from FreeBSD to make it a POSIX compliant kernel.

  7. Joël Kuiper on April 8th, 2008 5:52 pm

    See: http://www.kernelthread.com/mac/osx/arch_xnu.html for more details. This article is incorrect.

  8. Greg Bocic on April 9th, 2008 2:08 am

    Thanks for your corrections. I’d just like to add:
    - I never said NeXtstep was an OS.
    - There are many definitions of Darwin on the web, I didn’t make it up :)

    You’re right about the kernel, though. That’s why I asked people to help with their comments!

  9. lesmana on April 9th, 2008 4:10 am

    the GPL is NOT (and never was) aggressive towards commercial use.

    the GPL allows you to sell GPL licensed software, but if you do, you also have to provide the source code.

    see here for more
    http://www.fsf.org/licensing/licenses/gpl-faq.html#GPLCommercially

  10. leeg on April 9th, 2008 4:12 am

    @Michael Engel: nail has been hit on the head, there. The kernel organisation where the BSD system call layer lives alongside the mach code is called POE mode, and isn’t just used by Darwin – Tru64 (OSF/1) is Mach-based too and uses the same monolithic approach.

    BTW, I can strongly recommend http://osxbook.com and the book, Mac OS X Internals by Amit Singh :-) .

  11. memson on April 9th, 2008 6:24 am

    No, no, no! NEXTSTEP was an OS. OPENSTEP was an OS. OpenStep was a specification implemented by a few vendors, based on the OpenStep spec, in turn based on the NEXTSTEP/OPENSTEP API.

    @Daniel C, you are an idiot ;-) Did you even read the first like of the Wikipedia article you linked to for NEXTSTEP?

    “NEXTSTEP was the original object-oriented, multitasking operating system that NeXT Computer developed to run on its proprietary NeXT computers”

    Ouch!

    When NEXT and Sun released the OpenStep spec, FSF or similar started GnuStep, based on the spec.

    If NEXTSTEP is not an OS now, you’d better let all the NEXT hardware nuts know that they aren’t really running an OS ;-)

  12. Johan Krüger-Haglert on April 9th, 2008 2:10 pm

    I have no idea why this made OSNews since it’s neither deep (the average OSnews reader probably got more of a clue than the writer) and also incorrect. It’s ok if the writer want to try to learn these things but uhm, it’s not very good as a source for information about it.

  13. The Steven on April 11th, 2008 9:35 am

    I look back and laugh, the NeXT OS v3.3 was available for both “black boxes” (NeXT cubes and slabs) and “beige boxes” (x86 PC’s)… Several parts from NeXT were ported directly to OS X. I had a copy of 3.3 on a pc years ago. I showed this old machine to a Mac Fanboy friend of mine, his response was “How did you fit the Mac motherboard in that pc case?”

    So, I can say I had parts of OS X running in a pc before the “Hackentosh” projects did.

  14. memson on April 11th, 2008 10:37 am

    @The Steven – I had Rhapsody on my PC – you can’t get much more OS X than that without running OS X itself!

  15. Counsel on April 11th, 2008 2:53 pm

    I think when he said that the GPL is “aggressive” towards commercial use, he actually means that commercial use does not benefit from the complete release and sharing of code.

    Sure, there are companies that do this – IBM, Linux, SNORT, etc., but these companies not only provide the software but really focus on providing a service surrounding the software.

    Installing SNORT after downloading the software did not use to be a single-click install. These companies could be said to really be offering a service surrounding a freely-available software stack rather than really offering the software – since that software can be used by anyone else… In other words, if you did not offer better service regarding the software than other firms, you would not have a business…

    We should try to not be so critical over the terms used and try to understand what is being said. I am trying to clarify what I see as a misunderstanding rather than be critical, so please don’t take it that way…

    Individuals will always have moments when they are wrong. Simply point out the facts and stop harping on the “wrong” assumption… Being critical really doesn’t help anyone..

  16. ä»â‚¬Ã¤¹Ë†Ã¦Ëœ¯Darwin ? | 维以不永伤 on October 19th, 2008 2:33 am

    [...] MacApper:What is Darwin? [...]

  17. idrive on February 9th, 2011 3:44 pm

    Hi Guys, I just found a pretty nice site for unlock / jailbreak/ iphone 3g 3gs and iphone4 jailbreak.

    http://www.anysim.net

    Thank u Anysim Team for fast Support. :)

    Did everybody now when the update ios 4.3 for iphone4 comes?

  18. ralph lauren femme pas cher on April 27th, 2013 12:42 am

    If you wish for to take a great deal from this post then you have to apply such techniques to your won
    webpage.

    Here is my page … ralph lauren femme pas cher

Feel free to leave a comment...
and oh, if you want a pic to show with your comment, go get a gravatar!