Asahi Linux
最近在推特上看得一則推文,目標是將 Linux porting 到 Apple M1 的機器上,包含 Mac Mini、Macbook Air 跟 Macbook Pro。
LLVMPipe, my shoddy display controller, and hours of @svenpeter42's patience presents....
— Alyssa Rosenzweig (@alyssarzg) August 22, 2021
GNOME Shell on the Apple M1, bare metal.
No, it's not GPU accelerated. Yes, I'm sending this tweet from it. pic.twitter.com/P4YuPEnbvp
Asahi Linux is a project and community with the goal of porting Linux to Apple Silicon Macs, starting with the 2020 M1 Mac Mini, MacBook Air, and MacBook Pro. Our goal is not just to make Linux run on these machines but to polish it to the point where it can be used as a daily OS. Doing this requires a tremendous amount of work, as Apple Silicon is an entirely undocumented platform. In particular, we will be reverse engineering the Apple GPU architecture and developing an open-source driver for it. Asahi Linux was founded by Hector Martin “marcan” after the launch of the first M1 devices.
這並不是透過模擬器或是虛擬機,而是直接讓 linux kernel 跑在 Apple M1 上,兩者的開發難度與效能完全不同,因為 Apple M1 的特殊設計,直接編譯 linux kernel 跑在 Apple M1 上是沒有辦法正常運作的。
Apple 顯然不會將各個驅動的文件秀給你看,外部設備的驅動需要自行撰寫、要理解 Apple M1 CPU 架構跟內部設計,所以基本上只能靠逆向工程來理解。
這件事對我來說超酷的,因為要做到這件事不僅要對硬體的溝通有所認知,還要知道怎麼修改 linux kernel,而且還是摸黑前行。整個開發程式碼都是開源的,用來理解 linux 運作跟 Apple M1 的設計都很有幫助。
不過這件事顯然只能吸引 linux 愛好者或部分工程師的注意,畢竟一般大眾甚至是開發者沒有強烈使用 Apple M1 跑 Linux 的動機,但這倒是開啟了新的可能性—Apple M1 可以拿來跑 Linux。
合法嗎?
官方網站說明有特別提到這件事:
As long as no code is taken from macOS to build the Linux support, the result is completely legal to distribute and for end-users to use, as it would not be a derivative work of macOS. Please see our Copyright & Reverse Engineering Policy for more information.
只要你沒有使用 macOS 的程式碼,根據使用者條款這件事情是完全合法的。
但根據網友說法,合不合法是一回事,蘋果要不要告你又是另外一回事了