· 3 min read

Asahi Linux — Running Linux on Apple M1

This article was auto-translated from Chinese. Some nuances may be lost in translation.

Asahi Linux

Recently, I came across a tweet about an effort to port Linux to Apple M1 machines, including the Mac mini, MacBook Air, and 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.

This isn’t running through an emulator or a virtual machine; it’s about running the Linux kernel directly on bare-metal Apple M1. The development difficulty and performance between the two approaches are entirely different. Because of Apple M1’s proprietary design, simply compiling the Linux kernel and trying to run it on the M1 won’t work out of the box.

Apple obviously isn’t going to hand you documentation for their drivers. Drivers for peripherals need to be written from scratch, and you need to understand the Apple M1’s CPU architecture and internal design—meaning they essentially have to rely on reverse engineering to figure it all out.

I find this incredibly cool. Achieving this requires not only a deep understanding of low-level hardware communication, but also the expertise to modify the Linux kernel—all while flying completely blind. The entire codebase is open source, which makes it tremendously helpful for understanding how Linux works under the hood as well as the inner workings of Apple M1.

That said, this project will likely only attract Linux enthusiasts and a subset of engineers. After all, the general public and even most developers don’t have a compelling reason to run Linux on an Apple M1. Still, it opens up an exciting new possibility: running Linux on Apple Silicon.

The official website specifically addresses this question:

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.

As long as you don’t use any proprietary macOS code, doing this is completely legal under the terms.

Though as netizens have pointed out, whether it’s legal is one thing; whether Apple decides to sue you anyway is another.

Related Posts

Explore Other Topics