Kalan's Blog

Kalan 頭像照片,在淡水拍攝,淺藍背景

四零二曜日電子報上線啦!訂閱訂起來

本部落主要是關於前端、軟體開發以及我在日本的生活,也會寫一些對時事的觀察和雜感
本部落格支援 RSS feed(全文章內容),可點擊下方 RSS 連結或透過第三方服務設定。若技術文章裡有程式碼語法等特殊樣式,仍建議至原網站瀏覽以獲得最佳體驗。

目前主題 亮色

我會把一些不成文的筆記或是最近的生活雜感放在短筆記,如果有興趣的話可以來看看唷!

Asahi Linux — 在 Apple M1 上跑 Linux

Asahi Linux

最近在推特上看得一則推文,目標是將 Linux porting 到 Apple M1 的機器上,包含 Mac Mini、Macbook Air 跟 Macbook Pro。

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 的程式碼,根據使用者條款這件事情是完全合法的。

但根據網友說法,合不合法是一回事,蘋果要不要告你又是另外一回事了

相關資源

上一篇

這些年我使用的程式碼字體

下一篇

前端焦慮症

如果覺得這篇文章對你有幫助的話,可以考慮到下面的連結請我喝一杯 ☕️ 可以讓我平凡的一天變得閃閃發光 ✨

Buy me a coffee