Build a debug variant of the XNU kernel and load it on a test Mac with an automatic fallback to the original kernel if boot fails.
Study how macOS and iOS manage processor scheduling, memory, and system calls at the lowest software level.
Explore the BSD-derived networking and file system code in the kernel's bsd directory for operating systems research.
Develop or debug macOS hardware drivers using the IOKit C++ framework included in the kernel source.
Requires Apple's macOS SDK and developer toolchain, loading a custom kernel requires a separate test Mac and careful use of the fallback boot procedure.
This repository contains the source code for XNU, which is the kernel at the heart of macOS and iOS. A kernel is the lowest-level software running on a computer: it manages the processor, memory, storage, and all communication between hardware and the programs you run. Without the kernel, no application on your Mac or iPhone could function. XNU stands for X is Not Unix, which is a reference to its hybrid nature. It combines two different foundations: the Mach microkernel, which was originally developed at Carnegie Mellon University, and code from FreeBSD, a Unix-like operating system. On top of those, it includes IOKit, a C++ framework used by hardware drivers. This layered architecture is why XNU is called a hybrid kernel rather than a pure implementation of either Mach or Unix. The repository is organized into directories that correspond to these layers. The osfmk directory contains the Mach-based components. The bsd directory contains the BSD-derived subsystems. The libkern and iokit code supports hardware drivers. Other directories handle startup, system calls, platform-specific behavior, and security policies. Building XNU requires Apple's development toolchain and macOS SDK. The build system uses make, and you can produce debug, development, or release variants of the kernel. The README includes instructions for loading a custom-built kernel on a test machine in a way that automatically falls back to the original kernel if something goes wrong during boot. Apple publishes this source code as part of the Darwin open-source project. It reflects the kernel version shipping in Apple operating systems, though some components remain closed source and are not included here.
← apple on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.