ArticleslgStudy

computer science

XNU

XNU is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand XNU rather than just read about it. In short: XNU ("X is Not Unix") is the computer operating system (OS) kernel developed at Apple Inc. since December 1996 for use in the Mac OS X (now macOS) operating system and released as free and open-source software as part of the Darwin OS, which, in addition to being the basis for macOS, is also the basis for iOS, iPadOS, watchOS, visionOS, and tvOS. XNU was originally developed by NeXT for the NeXTSTEP operating system.

XNU — main illustration
XNU — illustration

Key takeaways

  • XNU belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect XNU to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of XNU from memory before moving on to harder problems.

Reference excerpt

XNU ("X is Not Unix") is the computer operating system (OS) kernel developed at Apple Inc. since December 1996 for use in the Mac OS X (now macOS) operating system and released as free and open-source software as part of the Darwin OS, which, in addition to being the basis for macOS, is also the basis for iOS, iPadOS, watchOS, visionOS, and tvOS. XNU was originally developed by NeXT for the NeXTSTEP operating system. It was a hybrid kernel derived from version 2.5 of the Mach kernel, developed at Carnegie Mellon University, which incorporated the bulk of the 4.3BSD kernel modified to run atop Mach primitives, along with an application programming interface (API) in Objective-C for writing drivers named DriverKit. After Apple acquired NeXT, the kernel was updated with code derived from OSF MK 7.3 from OSF, and the FreeBSD project, and the DriverKit was replaced with new API on a restricted subset of C++ (based on Embedded C++) named IOKit. macOS achieved UNIX certification in 2007 with the release of Mac OS X 10.5 Leopard under the Single UNIX Specification (SUS) by The Open Group. Despite this, Apple retained the original 'XNU' name, which stands for 'X is Not Unix,' a relic from its NeXTSTEP origins before macOS was UNIX-certified. This has led to confusion, as the name suggests that XNU is separate from UNIX, even though macOS, as a whole, was officially recognized as a UNIX operating system until October 11, 2026.

Kernel design XNU is a hybrid kernel, containing features of both monolithic kernels and microkernels. As of November 2026, XNU runs only on ARM64 processors. PowerPC support was removed as of the Mac OS X Snow Leopard kernel. Support for IA-32 was removed as of the Mac OS X Lion kernel; support for 32-bit ARM was removed as of iOS 11. Support for x86-64 was removed as of the macOS Golden Gate kernel.

Mach

The basis of the XNU kernel is a heavily modified (hybrid) Open Software Foundation Mach kernel (OSF MK) 7.3. OSF MK 7.3 is a microkernel that includes applicable code from the University of Utah Mach 4 kernel and from the many Mach 3.0 variants forked from the original Carnegie Mellon University Mach 3.0 microkernel. XNU doesn't use Mach as a microkernel, rather including other subsystems (such as the BSD one) as a part of the kernel, instead of as a userspace daemons. Mach in XNU is used to manage virtual memory, facilitate Inter-process communication (IPC), and do input/output (I/O) operations with the console. OSF MK 7.3 is able to run the core of an operating system as separated processes, which allows a great flexibility (it could run several operating systems in parallel above the Mach core), but this often reduces performance because of time-consuming kernel/user mode context switches and overhead stemming from mapping or copying messages between the address spaces of the kernel and that of the service daemons. Apple licensed OSF MK 7.3 from the OSF, and attempted to streamline some tasks by building BSD functions into the kernel along with the Mach code. The result is a heavily modified (hybrid) OSF MK 7.3 kernel.

BSD The Berkeley Software Distribution (BSD) part of the kernel provides the Portable Operating System Interface (POSIX) application programming interface (API, BSD system calls), the Unix process model atop Mach tasks, basic security policies, user and group IDs, permissions, the network protocol stack (protocols), the virtual file system code (including a file system independent journaling layer), several local file systems such as Hierarchical File System (HFS, HFS Plus (HFS+)) and Apple File System (APFS), the Network File System (NFS) client and server, cryptographic framework, UNIX System V inter-process communication (IPC), audit subsystem, mandatory access control, and some of the locking primitives. The BSD code present in XNU has been most recently synchronised with that from the FreeBSD kernel. Although much of it has been significantly modified, code sharing still occurs between Apple and the FreeBSD Project as of 2009. The first thing that happens after Mach initializes BSD is the initialization of memory allocation.

K32/K64 XNU in Mac OS X Snow Leopard, v10.6, (Darwin version 10) comes in two varieties, a 32-bit version called K32 and a 64-bit version called K64. K32 can run 64-bit applications in userland. What was new in Mac OS X 10.6 was the ability to run XNU in 64-bit kernel space. K32 was the default kernel for 10.6 Server when used on all machines except Mac Pro and Xserve models from 2008 onwards and can run 64-bit applications. K64 has several benefits compared to K32:

Can manage more than 32 GB RAM, as the memory map would consume a disproportionately large area of the 32-bit kernel space. Cache buffer sizes can be larger than what the 32-bit kernel space allows, potentially increasing I/O performance. Performance is increased when using high-performance networking devices or multiple graphics processing units (GPUs), as the kernel can map all of the devices in 64-bit space even if several have very large direct memory access (DMA) buffers. Booting while holding down 6 and 4 forces the machine to boot K64 on machines supporting 64-bit kernels. K64 will run 32-bit applications but it will not run 32-bit kernel extensions (KEXTs), so these must be ported to K64 to be able to load. XNU in OS X Mountain Lion (10.8) and later only provides a 64-bit kernel.

… excerpt ends here. Continue reading the full article.

Illustrations

XNU illustration

Worked examples

Example 1 — a first encounter with XNU

Start with the simplest possible case. Write down what XNU claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to XNU before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about XNU ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of XNU

In research
XNU appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses XNU in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
XNU is common in secondary-school and first-year university syllabi. It links to neighbouring topics IOS, MacOS, Mach (kernel), so understanding it makes those chapters shorter.
In everyday life
Look for XNU outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “XNU” →

How to study XNU in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what XNU means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain XNU out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is XNU in simple terms?

XNU ("X is Not Unix") is the computer operating system (OS) kernel developed at Apple Inc. since December 1996 for use in the Mac OS X (now macOS) operating system and released as free and open-source software as part of the Darwin OS, which, in addition to being the basis for macOS, is also the ba…

Why does XNU matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study XNU?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on XNU.

Tags

  • IOS
  • MacOS
  • Mach (kernel)
  • Monolithic kernels
  • Software using the Apple Public Source License

Keep exploring