OS Overview - Darwin
Darwin is an open-source, as strange as it is to hear that from Apple, operating system based on UNIX and is the basis of macOS, iOS and basically any other operating system that Apple have made. Darwin is the core of the *OS family and comprises of other open source projects, namely XNU. Darwin was initially released on November 15, 2000 (16 years ago at the time of writing), and supports 3 processor architectures: PowerPC, x86 and ARM.
Darwin is a continuation of the NeXTStep OS, and is made up of a mixture of components from the BSD and Mach Kernels, this is because of the inclusion of the XNU kernel. Darwin is still in active development today, and is basically made up of all the open source components of macOS on opensource.apple.com. Apple's description of Darwin is the following: "XNU, along with other core parts of macOS, are collectively referred to as Darwin".
Writing about Darwin and XNU is difficult, especially for someone in my position. It's quite confusing to differentiate what components are what because Darwin and XNU are usually seen as the same thing. Before I begun my research into the inner workings of macOS and iOS, i thought that Darwin was the kernel and I basically ignored XNU.
The figure above show the output of the uname -v
command. Invoking this command gives us some information about the running OS, namely the Darwin version, build date of XNU, XNU version and build type.
Darwin Kernel Version 16.7.0
This is the current version of Darwin, note how it states "Kernel", this is what makes things slightly strange.
Thu Jun 15 17:36:27 PDT 2017
This is the build time of XNU. If you've ever tried loading a custom XNU build, it shows the exact time of compilation.
root:xnu-3789.70.16-2/RELEASE_X86_64
This is the XNU build, It shows the user that was used to compile, XNU version and the version type.
Now, you may be think "What's the point of showing this now?". Well, if i'm honest, for about 10 mins i thought the same, however, it lets us see how Darwin is still used, and that XNU is actually the running kernel.
Projects derived from Darwin
I initially thought that this would be a boring section to write, but there's actually quite a few things that have come of Darwin's open-source-ness.
OpenDarwin
I shall start with OpenDarwin. OpenDarwin is an open-source project from Apple. OpenDarwin was a "community led operating system" created by Apple, yes a shock i know, in 2002. The aim of this project was to increase collaboration between Apple and other developers, Apple actually used contributions made to OpenDarwin to improve Darwin itself. The project, however, did not last particularly long and shut down July 25 2006. The last version of OpenDarwin was 7.2.1 released on July 16 2004.
PureDarwin
PureDarwin is a continuation of OpenDarwin and is aimed at building a suitable release based on Darwin 14.5, used in macOS 10.10.5. They plan to incorporate technologies like X11 and DTrace.
Darwin on ARM and future projects
Darwin on ARM is a open-source Github project, created by winocm, aimed at creating a port of Darwin XNU to ARM and ARM64. Although this projects last commit was February 12 2016 (at the time of writing) the idea of this project has not disappeared, since the release of XNU 4570 (I shall discuss this later on in more detail) the idea of running Darwin on ARM has been revived by Jonathan Levin and, by the time this is published, will probably be far into development.
Summary
Things get slightly confusing when discussing Darwin. Is it a Kernel? Is it an operating system? Well, in short, Darwin is an open-source project comprised of other open-source projects, including XNU, that create the base of Apple's *OS's. "Darwin Kernel" usually is referring to XNU, since that is the kernel used in Darwin. Darwin isn't exactly a full operating system, more of the base of one.