开发者Heyang Zhou发布了名为“XNU Linux”的项目,该项目成功将苹果开源的macOS内核(XNU)编译为可加载内核模块(xnu.ko),使其能够在未经修改的arm64 Linux内核中作为用户空间运行 1。这一架构允许macOS进程与Linux进程在同一CPU上直接并行执行,无需虚拟化层介入 1。为了支撑macOS系统的正常运行,项目引入了一个小型接口模块fki.ko,负责向XNU转发内存、计时器、网络及GPU等主机资源请求 1。
在硬件兼容性与性能方面,该系统已在Apple Silicon Mac上成功引导macOS 27.2.1桌面环境,启动时间介于31至48秒之间 1。项目实现了GPU加速支持,通过Metal-to-Vulkan桥接技术利用主机GPU 1。目前该方案需要配备M1或更新芯片以及约24 GB RAM的硬件环境 1。尽管具备原生并行能力,但受限于4K与16K页面大小的差异,其内存访问速度仍慢于原生虚拟机,且AMFI和SIP安全机制需被放宽 1。在法律合规性上,xnu.ko遵循APSL-2.0许可,而Linux侧代码遵循GPL协议,两者仅通过FKI接口进行交互 1
Summary
Developer Heyang Zhou has released a project named XNU Linux, which compiles Apple’s open-source macOS kernel (XNU) into a loadable kernel module (xnu.ko). This allows the macOS userspace to run as a user-space process within an unmodified arm64 Linux kernel 1. The implementation enables native parallel execution of macOS and Linux processes on the same CPU without any virtualization layer or hypervisor intervention 1. The solution successfully boots the macOS 27 desktop environment on Apple Silicon Macs with GPU acceleration support 1.
Core Mechanism and Technical Breakthrough
1. Native Co-execution Without Virtualization
Unlike traditional virtual machines, XNU Linux builds the macOS kernel as a loadable module for the Linux kernel 1. A small interface module, fki.ko, is responsible for forwarding resources such as CPU, memory, files, network, and GPU requests from Linux to XNU 1. This architecture allows macOS processes to run directly alongside Linux processes, eliminating the overhead associated with hypervisors 1.
2. Performance and Boot Metrics
In testing environments, macOS 27.2.1 can boot to the desktop within 31 to 48 seconds 1. The system utilizes a Metal-to-Vulkan bridge (gpu/xnu-cpu-metal) to leverage the host GPU for graphical acceleration 1. However, the performance is not fully native; memory access remains slower than in native virtual machines due to differences in page size handling (4K vs 16K pages) 1. Additionally, security features such as AMFI and SIP are relaxed to facilitate this operation 1.
Hardware Requirements and Licensing
- Hardware: The project requires an Apple Silicon M1 or newer chip and approximately 24 GB of RAM 1.
- Licensing: The codebase maintains a strict license separation. The
xnu.ko module follows the APSL-2.0 license, while the Linux-side code adheres to the GPL 1. The two components interact solely through the FKI interface 1.
Significance
This release demonstrates that full macOS GUI userspace can operate within an unmodified stock Ubuntu kernel 1. By providing resources via fki.ko, the project achieves direct interaction between the Linux kernel and the macOS kernel module, offering a unique approach to running macOS software on Linux hardware without emulation layers 1.
评论
还没有评论,欢迎留下第一条。