Being able to bring Linux on the Apple M1 is no small feat, which is why after all these months since the Apple M1 was released, Linux is not yet available on Apple's new platform. This is due to the fact that Apple's SoC features numerous new and proprietary technologies, and certainly the Cupertino company is not collaborative in helping the development of unofficial solutions .
However, the developers managed to run Linux on an Apple M1-based system , which at this point can be used for basic operations. The project in question is called Asahi Linux, and it aims to bring Linux to new Apple devices.
The work is also possible thanks to the fact that Apple is unique in maintaining compatible hardware interfaces between different generations of SoCs . For example, the peripheral that takes care of UART communication in the M1 dates back to the original iPhone . It is therefore possible to write and / or adapt drivers without knowing exactly the underlying hardware. In fact, the classic way to write drivers for new SoCs is to know exactly the hardware they have to work with (for example the number of registers, communication ports to the outside, how to use the registers, etc.) and map 1- 1 drivers with hardware.
Linux on Apple M1: what works and what doesn't?
At the time of writing this article, Asahi Linux developers have managed to get various drivers to work regarding PCIe and USB-C for Linux 5.16. They also managed to get other SoC peripherals to work with pinctrl-related drivers (whose functionality allows for GPIO pin control), I2C driver, device power management, NVMe + SART driver, and DCP driver ( display control).
“With these drivers, M1 Macs are effectively usable as Linux desktop machines. While there is no GPU acceleration yet, the M1's CPUs are so powerful that a software-rendered desktop is actually faster on them than, for example, hardware-accelerated Rockchip ARM64 machines. "
Hector Martin, head of the project
That's right, unfortunately there is still no hardware acceleration , and this is no small job. In fact, the SoC also integrates a proprietary GPU , of which not much is known and is probably based on PowerVR. To get it working it is therefore necessary a big reverse engineering job for the drafting of new drivers or adaptation of existing drivers that operate on similar GPU architectures.
To give an idea, a similar work can be found on classic desktop PCs with Nvidia graphics cards. The latter, in fact, have a closed architecture as well as its drivers. The nouveau drivers are an open source attempt to support Nvidia graphics cards, but despite all the reverse engineering effort carried out by the community, they fail to come close to the performance and functionality offered by the official drivers. Fortunately, the official drivers are constantly updated and offer performance and functionality equal to those of Windows. It is a regret that there is no such support from Apple.
"Once we have a stable kernel base, we will begin releasing an 'official' installer that we anticipate will see wider use among the adventurous"
The article Finally a first working version of Linux on Apple M1 comes from Tech CuE | Close-up Engineering .