We are going to discuss Darwin: The core of modern Mac OS.Mac OS core is based on multiple components, such as:- BSD- Mach- NeXTSTEPOpenDarwin and PureDarwin. Darwin is the core of Mac OS X. The Darwin kernel consists mainly of the FreeBSD and Mach 3.0 technologies. Darwin includes various core services, such as those involved in networking and device drivers. I discuss this topic in more detail in Chapter 5, as I walk through the startup sequence of events. Darwin is the Open Source operating system from Apple that forms the basis for macOS.
Mac OS X merge therefore the efficiency and stability of UNIX (protected memory area) with the simple usability of Mac OS. Hexley the platypus is the mascot of the operating system Darwin. Affected by the open source concept developers of Apple and the open source community work together for the PowerPC and x86 operating system version. New Darwin Versioning Scheme As of Software Update 1 for Mac OS X v10.1, we have moved to a new numbering policy for the Darwin portions of Mac OS X. It you type 'uname -a' from the command-line, you will see that the Darwin version number has changed to '5.1' (actually 5.1.0), which better aligns Darwin's numbering scheme with our internal.
Versioning software is a surprisingly difficult task. The version number conveys technical information: how much change can you expect and might it break existing workflows and data? Users will be more willing to pay for a major upgrade with new features, so the version number is used as a marketing tool. But for developers and MacAdmins, the version number has to be as granular as possible, ideally with a different number for each build made.
Because of these, sometimes opposing, interests, it is no wonder that versioning is often a problem for MacAdmins.
A brief history of the Mac operating system versions
Before the “Mac OS” label, the Macintosh operating system was called “System 7.” “Mac OS 8”, code-named “Copland,” was supposed to be the new operating system with all the new features, but the project kept slipping and then was cancelled. The “System 7.7” update was then re-named “Mac OS 8” to get Apple out of some third party licensing deals, which were set to expire on version 8. Marketing and legal matters decided the versioning here. (But it wasn’t all just marketing: Mac OS 8 also got the new interface design that had been created for Copland.)
When Apple announced the NextSTEP based major overhaul for the Macintosh in the late nineties, they chose to not give it a different name and new version numbers. Instead they chose to label the new system as “Mac OS X”, where the “X” was read as the roman numeral ten. I assume this was a marketing choice to demonstrate continuity with the previous versions, which had been “Mac OS 8” and “Mac OS 9.”
The first version of Mac OS X had the numerical version number
10.0.0
and got four “updates” to 10.0.4
Then it got the first major “upgrade” to 10.1
. This broke with conventional versioning as major upgrades should get a new major number. When “Mac OS X 10.2 Jaguar” was announced at WWDC in 2002, it was obvious that Apple now considered “Mac OS X” a brand and would stick to the 10
in the system version numbers.With the “Xserve,” the ‘X’ became a moniker to represent Apple’s “professional” or “EXpert” hardware and distinguish them from the ‘i’ prefix used for the consumer friendly devices and software. (iMac, iBook, iPod, iTunes, iMovie, iPhoto, etc.) Later “pro” software tools, such as “Xcode,” “Xsan,” and “Xgrid” picked up that prefix. Confusingly, the leading “X” was pronounced ‘ecks’ and the trailing ‘X’ in “Mac OS X” was still pronounced as ‘ten.’ Or at least that was what Apple marketing insisted it should be called.
In 2012, Apple dropped the “Mac” from the operating system for “OS X Mountain Lion” (10.8) The “X” represented the “pro” nature of Mac platform, as opposed to “iOS” for iPhone and iPad. Apparently, the “X” was considered a stronger brand for “pro” than “Mac” at the time…
This changed when Apple finally dropped the “X-as-ten” and returned the “Mac” with “macOS Sierra” (10.12) in 2016.
Even without the “X” in the system name, the ‘10’ has remained in the version number up to macOS 10.15 Catalina.
(The “X-as-ten” lives on with “Final Cut Pro X” and “Logic Pro X”. The prefix “X” lives on with “Xcode.”)
Big Sur goes to 11
The naming and versioning of the Mac platforms operating system was largely driven by symbolism, marketing and even legal matters. The same is true this year: Apple has finally given up on the “ten” and will raise the major version of macOS to 11.
I have a post on my opinion and reaction to macOS 11. Whatever the reasons, this is the year that we will get macOS 11.
When you go to “About this Mac” on a Mac running the Big Sur beta, it will proudly announce that it is running macOS 11.0. You get the same result when you run
sw_vers
:This seems easy enough, however, there is a catch to this.
10.16 vs 11.0
Big Sur will not always report
11.0
as the macOS version. It might report 10.16
in some cases. These cases are meant for situations where software might just check the second part of the version for version checks.The rules are detailed in this post from Howard Oakley.
![Techno Techno](https://www.howtogeek.com/wp-content/uploads/2017/02/hexley_fork_450.png?trim=1,1&bg-color=000&pad=1,1)
In Big Sur you can force the compatibility mode by setting the
SYSTEM_VERSION_COMPAT
environment variable to 1
:Checking the Version
When you have a script that checked the version of macOS (or Mac OS X or OS X), so far it was safe to ignore the first number of the product version and only compare the second. For example to see if macOS was Mojave or newer, you probably would have done something like this:
Now, with the release of macOS 11.0, this setup will return
0
for the minorVersion
and fail.The obvious solution here would be to extract the
majorVersion
as well and compare that first:This will work well enough, even when the script runs in a setup where it might get
10.16
as the version number. But is not particularly nice to read. Also, when you want to compare update versions, these will be (presumably) the minorVersion
for Big Sur and later and the third part of the version number in Catalina and earlier and things will get even more messy quickly.Maybe there is a better way of doing this than using the product (marketing) version of macOS?
Build Version
As I mentioned earlier, the user visible version may not be granular enough for the needs of developers. And because of this macOS has a second version, called the “build version”
The build version for the current version of macOS Catalina as I am writing this is
19G2021
.You can also see the build version in the “About this Mac” window when you click on the version number.
The build version consists of three parts and a fourth optional one. The first number is the Darwin Version. The following capital letter designates the update. The following number (up to four digits) is the specific build number. Sometimes the build number is followed by a lower case letter.
Darwin Version
This part of the version takes its name from the Darwin core of macOS.
The Darwin Version is number that is increased on every major release of macOS. Mac OS X 10.2 Jaguar was the first release of Mac OS X to consistently report its Darwin Version as
6
. From that you can conclude that 10.0 had Darwin version 4
which makes sense, because it was the fourth release of NextSTEP, the operating system Mac OS X is based on.macOS 10.15 Catalina, has a Darwin version of
19
and Big Sur reports 20
.You can also get the Darwin version in the shell from the
OSTYPE
environment variable:But keep in mind that environment variable may not be set depending on the context your script runs in.
A safer way to get the Darwin version is with the
uname
command:This Darwin version includes the update information.
Updates
In the build version updates are tracked with a capital letter. The letter
A
stands for the .0
or first release of a major version. B
signifies the second release or first update or .1
release, and so on.The current Catalina build version starts with
19G
so we know it is the seventh release or sixth update to Catalina (10.15.6). The current Big Sur beta starts with 20A
so it is the first release or .0
version.Build numbers
The significance of the build number is most often seen during the beta phase. While the Darwin version and update letter are fixed during the beta phase, the build number increases with every beta release. This is the most granular number we have to determine the version.
For each update and major release the build number starts over, so it can only be used to compare releases for the same major release and update version.
Traditionally, there was a difference between two- and three-digit build numbers and four-digit build numbers. The builds with lower numbers of digits were general release builds, that will run on all Macs that support this version of macOS. The four digit build numbers designated either a security update or a hardware specific build.
Hardware specific builds occur when a new Mac model is released. These usually get a hardware specific build of macOS, since the drivers necessary for the new hardware are not included in the current general release version. Even though the product version numbers of macOS are the same for the general release and the hardware specific release, they have different build numbers.
Usually, the hardware specific drivers are merged into the general release on the next update. However, until the builds are merged, MacAdmins may have to manage hardware specific system installers and workflows for new hardware. This was especially annoying with the release of the 2018 MacBook Pro which had a specific build of 10.13.6 that was never merged into the general 10.13 build. MacAdmins that wanted or needed to support 10.13 had to manage a separate installer for these MacBooks.
Intruigingly, the Big Sur beta is different: its build number started in the 4000s and switched to the 5000s with beta 3.
Special builds
Some releases of macOS have a trailing lower case letter after the build number. This is particularly common during the beta phase. It is unclear what this letter designates exactly. It might designate that the installer application was re-built one or more times.
You can use regular expressions to parse out all the individual pieces of the build version:
But in most cases, you will not need this level of detail.
Using the Build Version
The build version provides a way to compare macOS system versions that is not subject to the whims of marketing. We can even use it distinguish hardware specific builds of macOS from general versions or determine if security or supplemental updates have been applied.
For most comparisons, we only need the Darwin version and maybe the update.
The Darwin version has had two digits since Mac OS X 10.6 Snow Leopard. It is safe to assume that you won’t be managing Macs running 10.5 Leopard any more. (And if you do, they will probably be “hand-fed” and not subject to your deployment and update automations.) Assuming a two digit Darwin version, we can use string comparison to compare build versions:
Since all versions of Mojave start with
18A...
they are all alphabetically greater than 18
. The same would go if you want to check for a maximum macOS version:You can also filter for specific minimum updates:
By using the build version, we are avoiding all the trouble that the “marketing-driven” build version brings with it.
zsh solution
The above works for sh, bash and zsh scripts. However, when you are using zsh, there is another useful solution. zsh provides a function to compare versions called
is-at-least
.When you use zsh in the Terminal interactively, it is probably already loaded, but when you want to use it in scripts, you should use
autoload
to make sure it is loaded. Then you can use is-at-least
this way:Since both
11.0
and 10.16
are higher than 10.14
this will work no matter what number Big Sur might be reporting, but if you want to check that the system is Big Sur, you want to use 10.16
as the minimum, which covers both possible values:Conclusion
The change of the version number in macOS 11 Big Sur might affect or even break some of your system version checking in your deployment and management scripts. There are some nice and easy solutions that are more resilient to changes in the “marketing” product version.
Darwin is the open source core of OS X.
- 1Rhapsody
- 1.1Getting this to run
- 2XNU
- 2.2Getting this to run
Rhapsody
Darwin 0.1
In the beginning of the project it was a fork of OPENSTEP. As far as I've been able to track down there have been 3 public releases of this OPENSTEP Darwin. And there have been several more public releases, up to and including OS X Server 1.0 which was based on the OPENSTEP kernel. Further complicating things, Darwin 0.1 reports itself as Rhapsody 5.3, while Darwin 0.2 and 0.3 report themselves as Darwin 0.2/0.3
From the source code of Darwin 0.1, The kernel is based on OS/F's 6.1 kernel. This is evident in boolean.h as an example:
The following is a table of versions I've been able to put together with information from the Rhapsody Resource Page, and a mirror of the Darwin Q&A.
Kernel Version | OS Name | OS X Version | Darwin Version | Code name |
---|---|---|---|---|
5.0 | Rhapsody | Rhapsody Developer Release | N/A | Grail1Z4 |
5.1 | Rhapsody | Developer Release 2 | N/A | Titan1U |
5.2 | Rhapsody | Rhapsody 1.0 | N/A | Unknown |
5.3 | Rhapsody | Mac OS X Server 1.0 | Darwin 0.1 | Hera1O9 |
5.4 | Rhapsody | Mac OS X Server 1.0.1 | Darwin 0.2? | Loki1A2 |
5.5 | Rhapsody | Mac OS X Server 1.0.2 | Darwin 0.3 | Loki2G1 |
5.6 | Rhapsody | Mac OS X Server 1.2 | N/A | Pele1Q10 |
5.6 | Rhapsody | Mac OS X Server 1.2v3 | N/A | Medusa1E3 |
Getting this to run
i386
Darwin 0.x can be built using a Rhapsody/OS X Server 1.0 binary system as a starting point. However when it comes to emulation and physical hardware the EIDE driver has a problem losing interrupts. It is not only a problem with Darwin/Rhapsody but on physical machines as well. This poses a challenge to 'white box' builders to this day. However the emulator Qemu 0.90 can run Rhapsody albeit with a busmouse driver.
For the sake of preservation, the preserved downloads from Darwin 0.1 are on archive.org. Some components in the 0.1 tars didn't make it to the 0.3 CD-ROM so they are needed to build a more 'complete' set.
At this moment I have the following version of Darwin setup to run on Qemu:
PowerPC
There has been tremendous improvements to Qemu, and it is now possible to install MacOS 9, and OS X Server 1.x, along with OS X 10.x. Darwin for the PowerPC doesn't have an actual installer on the discs, but rather you boot up into MacOS, and restore a disk backup from CD onto your target hard disk, and boot into that. Information can be found about the progress of the Qemu PowerPC on emaculation.com
Currently I have images of 0.3 & 1.0.2:
The process right now involves installing MacOS 9, as 8.6 included on the 0.3 currently doesn't boot. And likewise, the restore program on 0.3 won't run under MacOS 9, but the restore program from the 1.0.2 image will run on MacOS 9.
For the impatient, I do have the images already extracted and setup with Qemu
Currently there is no networking.
XNU
Darwin 1.4.1
After the release of OS X Server 1.0, it was clear at this point that OS X was doomed, as 3rd party software vendors expressed no interest in porting applications to OPENSTEP/Cocoa API's. Instead Apple would have to go and create the Carbon framework, allowing traditional MacOS applications to use a subset of the toolbox API, and then be ported to OS X. Along the way the older OPENSTEP kernel was dropped in favor of a newer kernel based on Mach 3.0 and a C++ driver framework.
The Darwin OS includes both the XNU kernel, along with all the free tools.
As far as I recall it started being fully distributed in Darwin 1.0, which was a PowerPC only release, while later releases included native support for the x86.
Version | Released | Corresponds With |
---|---|---|
Darwin 1.0 | April 2000 | Mac OS X Developer Preview 4 |
Darwin 1.2 | October 2000 | Mac OS X Public Beta |
Darwin 1.3.1 | April 2001 | Mac OS X 10.0.1 |
Darwin 1.4.1 | Fall 2001 | Mac OS X 10.1 |
Darwin 5.1-5.5 | Mac OS X v.10.1.1-10.1.5 | |
Darwin 6.0-6.8 | Mac OS X v.10.2.0-10.2.8 | |
Darwin 7.0-7.9 | Mac OS X v.10.3.0-10.3.9 | |
Darwin 8.0-8.11 | Mac OS X v.10.4.0-10.4.11 | |
Darwin 9.0-9.1 | Mac OS X v.10.5.0-10.5.1 |
Versioning confusion
Techno Darwin Mac Os Pro
As mentioned over on this thread at nextcomputers.org, that although there was a released memo explaining the logic behind the version number changes so that way Darwin would match up to the build number of XNU, it lead to great confusion. However this letter at least sets it to the original intent.
The following releases can be downloaded here:
- Darwin 1.0 - OS X 10.0 DP 4 - Release notes
- Darwin 1.4.1 - OS X 10.1 x86 - Release notes
- Darwin 1.4.1 - OS X 10.1 ppc - Release notes
- Darwin 6.0.2 - OS X 10.2 x86 - Release notes
- Darwin 6.0.2 - OS X 10.2 ppc - Release notes
- Darwin 7.0.1 - OS X 10.3.1 unknown - Release notes
- Darwin 8.0.1 - OS X 10.4 x86 - Release notes
- Darwin 8.0.1 - OS X 10.4 ppc - Release notes
Getting this to run
Compatibility is a mixed bag, and it was just as bad at the time, and on real hardware.
Darwin 1.4.1
Recently I've found that it will run using Qemu 2.7.I didn't have to do anything special and I've written about it here.
Darwin 8.0.1
Darwin 8.0.1 to run under Qemu 0.13.0. As far as I know 1.4.1, has some kind of CPU issue, and 6.0.1 and 7.0.1 all have ACPI issues.Installation is pretty simple, a config like this is more then enough to get going:
Techno Darwin Mac Os Pro
v•d•eUNIX Versions, Vendors and Related |
---|
Research UnixUNIX Fifth Edition • UNIX Sixth Edition • Unix Seventh Edition • Unix Eighth Edition • Unix Ninth Edition LSX • MINI-UNIX • 32v AT&T - PWB/UNIX • Unix SYSIII • Unix SYSIV • Unix SYSV BSD - 2.9 BSD • 2.10 BSD • 2.11 BSD • 3 BSD • 4.0 BSD • 4.1 BSD • 4.2 BSD • 4.3 BSD • NeXTSTEP • Darwin • NetBSD • OpenBSD Other - AMIX • SunOS • Solaris • ULTRIX • A/UX • Xenix • AIX • Dell UNIX Clones - DEMOS • Coherent |
Darwin Os Download
Retrieved from 'https://gunkies.org/w/index.php?title=Darwin&oldid=21370'