Heyang Zhou, one of the creators of the Deno Deploy platform, published the XNU Linux project, which allows users to compile and load the XNU kernel as a Linux kernel module and use it to run a macOS user environment on Linux. XNU is used in macOS, is part of the open-source Darwin project, and is a hybrid kernel that combines the Mach microkernel, FreeBSD kernel subsystems, and C++ IOKit API for writing drivers. By loading XNU as a kernel module, one can run the standard macOS graphical environment inside Linux, where macOS applications, including the Safari browser, will execute.
The XNU kernel is compiled from the source code provided by Apple and runs in Linux as a kernel module xnu.ko, which interacts directly with the CPU and memory management unit (MMU), enabling Linux and macOS processes to run side by side on the same CPU without a hypervisor. To allow the XNU kernel access to memory, files, timers, exception handling, networking, and GPU through the Linux kernel, a bridging module fki.ko (Foreign Kernel Interface) has been created.
The XNU kernel module operates in its own address space â the XNU kernel receives a continuous block of physical memory from Linux and manages it through its pmap, while a portion of the address space for user processes is shared between Linux and XNU. Each virtual CPU for macOS is configured as a Linux kernel thread, pinned to a physical CPU core. Drivers for accessing the disk image with macOS, display, keyboard, mouse, Ethernet, and GPU are provided. The Metal graphics API is implemented on top of Vulkan through the metal2vulkan layer.
The project-developed bridging kernel module and accompanying utilities are distributed under the GPLv2 license, while the components of the XNU kernel module are supplied under the APSL-2.0 license. The drivers XnuDisplay, XnuEthernet, and XnuInput, borrowed from the macOS-DroidVM project, are available under the BSD license. XNU Linux also involves developments from the UniXNU project, which allows running macOS and iOS on non-Apple ARM64 systems. The development of XNU Linux is carried out with the assistance of AI assistant Claude. As an example, the booting of a macOS system disk created by Apple's installer in Ubuntu Linux was demonstrated. Currently, only booting on Apple ARM computers with M1 chips and newer is supported.



Burimi: opennet.ru
