HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
apple-oss-distributions
xnu
C2022–2026
apple-oss-distributions / xnu

xnu

Discover this repository through its Hacker News conversations.

47Distinct people
57Mentions
1Explicit recommenders
3.9KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

A public description has not been verified.

Where it is used

No documented product use was verified in the last source check.

What people are saying

> MacOS was absolutely derived from BSD through NeXTSTEP. The OS-X (now branded as "macOS") kernel was not, and is not, a derivative of the FreeBSD kernel, or any other BSD,…

AdieuToLogic used a recommendation phrase. One indexed comment matches. This is a phrase match, not a verdict.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 8–Nov 15 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/15/2026, 10:49:33 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year57 dated mentions

Observed mentions: 2022-04-25 11:48:54 UTC to 2026-09-21 17:51:59 UTC.

051015202022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 10 mentions; 0 submissions, 10 comments20222023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 6 mentions; 0 submissions, 6 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 7 mentions; 0 submissions, 7 comments20242025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 14 mentions; 1 submissions, 13 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 20 mentions; 1 submissions, 19 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC10010
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC606
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC707
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC14113
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC20119

From the project README

An excerpt from the repository, fetched Nov 13, 2026.

Read the project’s introduction
What is XNU? XNU kernel is part of the Darwin operating system for use in macOS and iOS operating systems. XNU is an acronym for X is Not Unix. XNU is a hybrid kernel combining the Mach kernel developed at Carnegie Mellon University with components from FreeBSD and a C++ API for writing drivers called IOKit. XNU runs on x86_64 and ARM64 for both single processor and multi-processor configurations. The XNU Source Tree config - configurations for exported apis for supported architecture and platform SETUP - Basic set of tools used for configuring the kernel, versioning and kextsymbol management. EXTERNAL_HEADERS - Headers sourced from other projects to avoid dependency cycles when building. These headers should be regularly synced when source is updated. libkern - C++ IOKit library code for handling of drivers and kexts. libsa - kernel bootstrap code for startup libsyscall - syscall library interface for userspace programs libkdd - source for user library for parsing kernel data like kernel chunked data. makedefs - top level rules and defines for kernel build. osfmk - Mach kernel based subsystems pexpert - Platform specific code like interrupt handling, atomics etc. security - Mandatory Access Check policy interfaces and related implementation. bsd - BSD subsystems code tools - A set of utilities for testing, debugging and profiling kernel. How to Build XNU Building a DEVELOPMENT Kernel The xnu make system can build kernel based on KERNEL_CONFIGS & ARCH_CONFIGS variables as arguments. Here is the syntax: make SDKROOT=<sdkroot> ARCH_CONFIGS=<arch> KERNEL_CONFIGS=<variant> Where: <sdkroot>: path to macOS SDK on disk. (defaults to /) <variant>: can be debug, development, release, profile and configures compilation flags and asserts throughout kernel code. <arch>: can be valid arch to build for. (E.g. X86_64) To build a kernel for the same architecture as running OS, just type make SDKROOT=macosx.internal Additionally, there is support for configuring architectures through ARCH_CONFIGS and kernel configurations with KERNEL_CONFIGS. make SDKROOT=macosx.internal ARCH_CONFIGS=X86_64 KERNEL_CONFIGS=DEVELOPMENT make SDKROOT=macosx.internal ARCH_CONFIGS=X86_64 KERNEL_CONFIGS="RELEASE DEVELOPMENT DEBUG" Note: By default, the architecture is set to the build machine's architecture, and the default kernel config is set to build for DEVELOPMENT. This will also create a bootable image, kernel.[config], and a kernel binary with symbols, kernel.[config].unstripped. To install the kernel into a DSTROOT, use the install_kernels target: make install_kernels DSTROOT=/tmp/xnu-dst For a more satisfying kernel debugging experience, with access to all local variables and arguments, but without all the extra check of the DEBUG kernel, add something like the following to your make command: CFLAGS_DEVELOPMENTARM64="-O0 -g -DKERNEL_STACK_MULTIPLIER=2" CXXFLAGS_DEVELOPMENTARM64="-O0 -g -DKERNEL_STACK_MULTIPLIER=2" Remember to replace DEVELOPMENT and ARM64 with the appropriate build and platform. Extra Flags: You can pass additional flags to the C compiler at the command line with the EXTRA_CFLAGS build setting. These flags are appended to the base CFLAGS, and the default value for the setting is an empty string. This setting allows you to e.g. selectively turn on debugging code that is guarded by a preprocessor macro. Example usage... make SDKROOT=macosx.internal PRODUCT_CONFIGS=j314s EXTRA_CFLAGS='-DKERNEL_STACK_MULTIPLIER=2' To build with RELEASE kernel configuration make KERNEL_CONFIGS=RELEASE SDKROOT=/path/to/SDK Building FAT Kernel Binary Define architectures in your environment or when running a make command. make ARCH_CONFIGS="X86_64" exporthdrs all Other Makefile Options $ make MAKEJOBS=-j8 # this will use 8 processes during the build. The default is 2x the number of active CPUS. $ make -j8 # the standard command-line option is also accepted $ make -w # trace recursive make invocations. Useful in combination with VERBOSE=YES $ make BUILD_LTO=0 # build without LLVM Link Time Optimization $ make BOUND_CHECKS=0 # disable -fbound-attributes for this build $ make REMOTEBUILD=user@remotehost # perform build on remote host $ make BUILD_CODE_COVERAGE=1 # build with support for collecting code coverage information The XNU build system can optionally output color-formatted build output. To enable this, you can either set the XNU_LOGCOLORS environment variable to y, or you can pass LOGCOLORS=y to the make command. Customize the XNU Version The xnu version is derived from the SDK or KDK by reading the CFBundleVersion of their System/Library/Extensions/System.kext/Info.plist file. This can be customized by setting the RC_DARWIN_KERNEL_VERSION variable in the environment or on the make command line. See doc/building/xnu_version.md for more details. Debug Information Formats By default, a DWARF debug information repository is created during the install phase; this is a "bundle" named kernel.development.<variant>.dSYM To select the older STABS debug information format (where debug information is embedded in the kernel.development.unstripped image), set the BUILD_STABS environment variable. export BUILD_STABS=1 make Building KernelCaches To test the xnu kernel, you need to build a kernelcache that links the kexts and kernel together into a single bootable image. To build a kernelcache you can use the following mechanisms: Using automatic kernelcache generation with kextd. The kextd daemon keeps watching for changing in /System/Library/Extensions directory. So you can setup new kernel as cp BUILD/obj/DEVELOPMENT/X86_64/kernel.development /System/Library/Kernels/ touch /System/Library/Extensions ps -e | grep kextd Manually invoking kextcache to build new kernelcache. kextcache -q -z -a x86_64 -l -n -c /var/tmp/kernelcache.test -K /var/tmp/kernel.test /System/Library/Extensions Booting a KernelCache on a Target machine The development kernel and iBoot supports confi
Read the full README on GitHub

What Hacker News says

14 sources
AdieuToLogic·Dec 20, 2025Recommendation phrase
> MacOS was absolutely derived from BSD through NeXTSTEP. The OS-X (now branded as "macOS") kernel was not, and is not, a derivative of the FreeBSD kernel, or any other BSD, even though macOS/OS-X has a FreeBSD kernel component due to its Mach heritage. The userland tools are however BSD. OS-X's kernel is XNU and from the XNU GitHub repo[0]: XNU kernel is part of the Darwin operating system for use in macOS and iOS operating systems. XNU is an acronym for X is Not Unix. XNU is a hybrid kernel combining the Mach kernel developed at Carnegie Mellon University with components from FreeBSD and a C++ API for writing drivers called IOKit. XNU runs on x86_64 and ARM64 for both single processor and multi-processor configurations. I recommend the book "Mac OS X Internals"[1] for a detailed analysis of same. EDIT: In theory,
Read the rest
XNU could simultaneously run the existing FreeBSD subsystem alongside Linux and/or MS-Windows ones. In practice, this would be a herculean effort fraught with difficulty. See QNX[2] for another example of a micro-kernel OS architecture. 0 - https://github.com/apple-oss-distributions/xnu 1 - https://books.apple.com/us/book/mac-os-x-internals/id4343583... 2 - https://en.wikipedia.org/wiki/QNX
In The FreeBSD Foundation's Laptop Support and Usability Project
There's pthread_cond_timedwait_relative_np. Looking at the implementation, pthread_cond_timedwait starts by converting the deadline to a relative timeout [1], but this is skipped if pthread_cond_timedwait_relative_np is used. Then, in the kernel, the timeout is converted back to an absolute deadline by either [2] or [3], but both of those are using Mach absolute time rather than the wall clock. Mach absolute time is monotonic. It pauses while the system is asleep, which may or may not be what you want. If need the timer to keep incrementing while the system is asleep, there's no way to do it directly with a timed wait, but you can use kevent with EVFILT_TIMER + NOTE_MACHTIME + NOTE_MACH_CONTINUOUS_TIME. [1] https://github.com/apple-oss-distributions/libpthread/blob/1... [2] https://github.com/apple-oss-distributions/libpthread/blob/1..
Read the rest
In macOS Tahoe is certified Unix 03 [pdf]
Another example of a new OS developed by a vendor is DryOS by Canon [0] as a replacement for WindRiver VxWorks[1]. It has been extensively explore by the chdk community of custom software extensions for Canon cameras. It appears to have some compatibility with Linux in some form. In my non-expert mind, an OS for "foveated rendering" would be similar to what many cameras prioritize and more likely be similar to an "realtime OS" of some sort. OTOH, Apple's goggles use the XNU kernel, so maybe a microkernel would be sufficiently realtime, similar to QNX often used for automotive applications [4]. 0. https://web.archive.org/web/20190214134247/http://www.canon.... 1. https://www.windriver.com/ 2. https://chdk.fandom.com/wiki/For_Developers 3. https://github.com/apple-oss-distributions/xnu 4. https://en.wikipedia.org/wiki/QNX
In John Carmack's arguments against building a custom XR OS at Meta
> BSD jails are architected wholly differently from what something like Docker provides. > Jails are first-class citizens that are baked deep into the system. Both very true statements and worth remembering when considering: > Additionally, iirc, the logic for FreeBSD jails never made it into the Darwin kernel. You are quite correct, as Darwin is is based on XNU[0], which itself has roots in the Mach[1] microkernel. Since XNU[0] is an entirely different OS architecture than that of FreeBSD[3], jails[4] do not exist within it. The XNU source can be found here[2]. 0 - https://en.wikipedia.org/wiki/XNU 1 - https://en.wikipedia.org/wiki/Mach_(kernel) 2 - https://github.com/apple-oss-distributions/xnu 3 - https://cgit.freebsd.org/src/ 4 - https://man.freebsd.org/cgi/man.cgi?query=jail&apropos=0&sek...
In Apple announces Foundation Models and Containerization frameworks, etc
> My impression is that FreeBSD is Apple's shadow in FOSS, they hold a lot of soft power over it. Apple has no influence over the FreeBSD project. > I know the kernels are different and obviously only part of the userspace is the same, but is FreeBSD actually far enough away from Apple to say it's not bogged down by corporate interests? Yes. OS-X (now macOS) is based on XNU[0], which itself has roots in the Mach[1] microkernel. The Unix user-space programs distributed with OS-X/macOS are those found in FreeBSD distributions AFAIK. This is also conformant with FreeBSD licenses for same. So there is no "soft power" Apple has over FreeBSD. And FreeBSD is not "Apple's shadow in FOSS". > I don't imagine it's the same as Linux at all, but it exists in a non-trivial way, no? No. It does not. EDIT: Just in case you'd like to verify any of the
Read the rest
In A year of funded FreeBSD development
Yes, panicking in kernels is bad. I've followed the whole R4L fight about working around it. https://github.com/apple-oss-distributions/xnu/blob/main/doc... https://github.com/apple-oss-distributions/xnu/blob/main/doc... Upstream fbounds in xnu has options for controlling if it panics or is just a telemetry event. They are in a kernel situation and have the exact same considerations on trying to keep the kernel alive.
In Greg K-H: "Writing new code in Rust is a win for all of us"

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.