The macOS Concept Journey — XNU (X is not Unix)
<p>XNU (X is not Unix) is a core part of the Darwin (<a href="https://medium.com/@boutnaru/the-macos-concept-journey-darwin-c333b994f932" rel="noopener">https://medium.com/@boutnaru/the-macos-concept-journey-darwin-c333b994f932</a>) operating system which is used in macOS, iPhone, AppleWatch and other Apple products (<a href="https://dbpedia.org/page/XNU" rel="noopener ugc nofollow" target="_blank">https://dbpedia.org/page/XNU</a>). We can think about it as the GNU/Linux kernel is in Linux distributions.</p>
<p>XNU is the intermediate layer between the software (like iOS/macOS) and the hardware (components of an iPhone/MacBook). It is one of the first pieces of software that is loaded into memory and one of the last when the system is turned off (<a href="https://www.iphoneitalia.com/658413/xnu-kernel-macos" rel="noopener ugc nofollow" target="_blank">https://www.iphoneitalia.com/658413/xnu-kernel-macos</a>).</p>
<p>The source code of XNU is published under APSL (Apple Public Source License) v2.0. It is hosted in Apple’s own site (<a href="https://opensource.apple.com/source/xnu/" rel="noopener ugc nofollow" target="_blank">https://opensource.apple.com/source/xnu/</a>) or as part of GitHub (<a href="https://github.com/apple-oss-distributions/xnu" rel="noopener ugc nofollow" target="_blank">https://github.com/apple-oss-distributions/xnu</a>). There are instructions on how to build the XNU kernel (<a href="https://kernelshaman.blogspot.com/2021/01/building-xnu-for-macos-big-sur-1101.html" rel="noopener ugc nofollow" target="_blank">https://kernelshaman.blogspot.com/2021/01/building-xnu-for-macos-big-sur-1101.html</a>).</p>
<p>Lastly, we can summarize XNU as 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 (<a href="https://opensource.apple.com/source/xnu/" rel="noopener ugc nofollow" target="_blank">https://opensource.apple.com/source/xnu/</a>) — more on those in future writeups. A diagram showcasing that is shown below.</p>
<p><a href="https://medium.com/@boutnaru/the-macos-concept-journey-xnu-x-is-not-unix-33c802368914"><strong>Learn More</strong></a></p>