Darwin

Also known as: Darwin operating system

On this page 7

Darwin is the open-source, Unix-like core operating system on which macOS is built. It comprises the XNU kernel, the BSD-derived system libraries, the dynamic linker, the launchd service manager and the command-line userland, and it is published by Apple under the Apple Public Source License. In macOS fundamentals, Darwin is the layer that makes a Mac a Unix system beneath the graphical interface.

The same Darwin foundation also underlies iOS, iPadOS, watchOS, tvOS and visionOS. What separates macOS from Darwin is the large set of proprietary layers on top, including the Aqua interface, AppKit, the Quartz graphics system, Finder and most bundled applications, none of which are part of the open-source release.

Components of the Darwin operating system

Darwin is not a single program but a collection of open-source projects that together form a bootable Unix core. Its heart is XNU, a hybrid kernel that combines the Mach microkernel for tasks, threads, virtual memory and message passing with a BSD layer for processes, permissions, the network stack and POSIX system calls, plus the I/O Kit driver framework. Executables use the Mach-O binary format rather than the ELF format common on Linux and BSD systems, and kernel extensions have largely given way to user-space system extensions on current macOS releases.

Around the kernel, Darwin provides the libraries and services that every macOS program uses, directly or indirectly. The main components are summarized below.

ComponentRoleOrigin
XNU kernelScheduling, memory, system calls, driversMach and BSD heritage, Apple development
libSystemC library, math, threads, system call wrappersBSD-derived with Apple extensions
dyldLoads executables and shared librariesApple
launchdFirst process, starts and supervises servicesApple
Userland utilitiesShell tools such as ls, grep, tarLargely FreeBSD-derived
Security and networking librariesCryptography, certificates, configurationApple, partly open source
Main components of Darwin

Origins and version numbering

Darwin descends from NeXTSTEP and OPENSTEP, the operating systems Apple acquired with NeXT in 1997, combined with code from FreeBSD and other BSD projects. Darwin 1.0 appeared in 2000, shortly before Mac OS X 10.0, and its source has been published for each subsequent release.

Darwin has its own version numbers, which the uname -r command reports. For the Mac OS X and macOS 10 releases, the Darwin major version was the macOS minor version plus four. Since macOS 11, the relationship has shifted again, and from macOS 26 the marketing version follows the year while Darwin continues its own sequence. The table shows representative pairs.

macOS releaseDarwin versionNote
Mac OS X 10.01.3First consumer release
macOS 10.15 Catalina19Last 10.x release
macOS 11 Big Sur20First release for Apple silicon
macOS 14 Sonoma23Darwin equals macOS plus nine
macOS 15 Sequoia24Same offset
macOS 26 Tahoe25Year-based marketing version
Darwin versions and corresponding macOS releases

Developers meet the Darwin name constantly in build target identifiers such as arm64-apple-darwin, and package managers such as Homebrew report the platform as darwin, because toolchains identify the operating system by its core rather than its marketing name.

Darwin compared with macOS and other Unix systems

Darwin is frequently confused with macOS itself or treated as a variant of FreeBSD. Both views are inaccurate. Darwin shares BSD tools and APIs, but its kernel architecture, driver model and service management are distinct, and macOS adds far more than an interface on top.

SystemKernelLicense statusRelation to Darwin
DarwinXNU hybrid kernelOpen source, APSL and othersThe core itself
macOSXNUProprietary productDarwin plus Apple frameworks and apps
FreeBSDFreeBSD monolithic kernelBSD licenseSource of many Darwin utilities
Linux distributionsLinux monolithic kernelGPL and othersSimilar POSIX interface, unrelated code
PureDarwinXNUCommunity open sourceAttempt to make Darwin bootable on its own
Darwin relative to neighboring systems

macOS holds UNIX 03 certification for both Intel and Apple silicon Macs; the certification applies to the complete product, but the POSIX behavior it measures comes almost entirely from Darwin.

What Darwin means in practice

For Mac users and administrators, Darwin is what appears in Terminal: the shell, the file system hierarchy with directories such as /usr and /bin, standard Unix permissions and the process model. Tools that work across Unix systems, such as SSH, Git and many scripting languages, run on a Mac because Darwin supplies the expected POSIX environment.

Apple stopped shipping standalone bootable Darwin images in the late 2000s, and today the open-source release mainly serves security researchers, kernel developers and anyone needing to understand system behavior. Some components appear with a delay after a macOS release, and drivers for current Mac hardware are not included, so the source alone does not produce a working Mac operating system.

Common misunderstandings about Darwin

Because Darwin is visible mostly through version strings and Terminal, several misconceptions persist. The table below corrects the most frequent ones.

MisconceptionReality
macOS is open source because Darwin isOnly the core is open; the interface and frameworks are proprietary
Darwin is just FreeBSDXNU and launchd differ fundamentally from FreeBSD
Darwin tools behave like GNU toolsBSD versions of sed, date and others use different options
Darwin version equals macOS versionDarwin uses its own numbering sequence
Darwin misconceptions and corrections

The BSD versus GNU difference causes most practical problems: a shell script written on Linux may fail on a Mac because sed -i or date -d behave differently. Installing GNU tools through a package manager or writing portable POSIX syntax avoids this.

The simple explanation

Every Mac has two parts working together. The part you see, with its windows, menus and apps, is designed by Apple and kept private. Underneath sits Darwin, the engine room, which manages memory, files, programs and hardware.

Apple publishes the plans for that engine room so others can study it. Darwin is related to older Unix systems, which is why many tools from the Unix and Linux world also work on a Mac.

How it is used in practice

A developer maintains a build script used on Linux servers and on colleagues’ Macs. On the Macs, the script fails with an error from sed. Running uname -a shows a Darwin kernel, which reminds her that macOS uses BSD versions of command-line tools, not the GNU versions found on Linux.

She rewrites the affected commands in portable POSIX form and detects Darwin in the script to select the right options where needed. The same script now runs unchanged on Linux and macOS, and the team adds the darwin platform to its automated tests, preventing similar breakage in future changes.