the XNU kernel
/ ex-en-YOO /
XNU is the kernel inside Apple's operating systems — macOS on the Mac, and iOS, iPadOS, watchOS, and tvOS on Apple's phones, tablets, and watches. The name is a playful recursive joke (XNU is Not Unix), but in practice the system behaves very much like Unix. If NT is a disciplined company built fresh, XNU is more like two proven teams merged into one building: it stitches together two famous earlier kernels and uses each for what it is best at.
Concretely XNU is a hybrid kernel built from a Mach core wrapped together with a large slice of BSD Unix. The Mach part (a microkernel from Carnegie Mellon) provides the lowest-level machinery: scheduling threads, managing virtual memory, and message-based communication between tasks. The BSD part provides the familiar Unix face: processes, signals, the file system layer, sockets and networking, and the POSIX system calls that ordinary programs use. A third layer, the I/O Kit, is a clean object-oriented framework for writing device drivers. The two halves do not run as separate isolated servers the way a strict microkernel would; for performance they live together in the kernel, which is exactly why XNU is called a hybrid rather than a pure microkernel.
The honest nuance is that calling XNU a microkernel is misleading even though Mach is one. Apple kept Mach's interfaces but co-located the BSD and Mach code in a single kernel address space to avoid the message-passing overhead a real microkernel would pay, so XNU enjoys Mach's flexible memory and IPC model while still being fast like a monolith. This pragmatic blend — Mach below, BSD Unix above, all in one kernel — is why your Mac feels like a polished Unix yet shares deep machinery with the iPhone in your pocket.
On a Mac you open a Terminal and run a familiar Unix command like ls or grep, then write a program that calls fork and exec. Those POSIX calls are served by XNU's BSD layer. Meanwhile the memory your program uses and the threads the scheduler runs are managed underneath by the Mach core — two heritages cooperating in one kernel.
Mach below, BSD Unix above: one hybrid kernel powering Mac and iPhone alike.
A frequent mistake: because XNU contains Mach, people call it a microkernel. It is not run as one — the BSD and Mach code share a single kernel space for speed, making XNU a hybrid kernel in practice.