First progress on creating a Linux port on Apple's M1

First progress on creating a Linux port on Apple's M1

An update has just been published on the progress of the project called Asahi Linux-an attempt to create a working Linux port on the Apple silicon platform. The entry was created by Hector Martin, the co-founder of the project, and it is interesting enough to illustrate, how much computers with Apple processors differ from other technologies of this type. We have there so m.in. information about how Apple’s technology works on a fundamental level and a description of some of the “quirks”. Many of these things made the developers of the Asahi Linux project have to face non-standard challenges and solve particularly difficult problems.

So here we are dealing with a scrupulous description of the equipment, about which there is no specific documentation. The developers had to make their own analysis, which, hopefully, will finally help them to create a working Linux port on Apple computers.

However, Asahi Linux is not the only project that is trying to create a Linux port on Macs. We still have Corellium., which is trying to run a port of Ubuntu on a Mac mini, that is, on one of Apple’s latest computers.

Returning to the subject, however, Martin writes that there are five elements that absolutely must work well to run Linux on any system. These are:

  • Processor
  • MMU, or Memory Management Unit
  • Interrupt Controller
  • System time
  • Console – in the case of Asahi Linux, it will be a serial console

The first four are standard on most systems-Linux will therefore have no problems to run there. But as we mentioned, Apple’s system is unique and uses custom solutions. Let’s take a look at some of the things that make the Cupertino company’s silicon technology so special.


Apple’s uniqueness

One of the things that makes Apple computers so special is that the boot process there looks completely different than with standard ARM systems – you can even safely say that this is a mechanism created specifically for Apple, which has slowly evolved since the early days of IOSA, according to what Martin writes.

The design elements were borrowed from the Open Firmware specification, which is a hardware – independent firmware developed by Sun Microsystems, which is clearly visible in new world ROM computers-Macintosh models that do not use the Macintosh Toolbox rom.

Therefore, the creators of the project Asahi Linux had to develop their own bootloader, which they called m1n1. Its goal is to deal with as many things as possible that exist only in Apple’s silicon computers. m1n1 also allows you to run external code and control the machine in real time from the computer where development is happening.

Using the interactive m1n1 shell or writing simple Python scripts, you can get to know the low-level operation of Apple’s processors. this, in turn, allowed you to identify even more things that are only in Mac computers.

As for the “quirks” of Apple, it was also a big problem that the inactivity of processors on Macs can cause the closure of some of its parts in order to reduce energy consumption. This can remove many registers, even stack pointers or Program counters this will result in a linux crash. Fortunately, the creators of Asahi Linux were able to disable this feature-they managed to do this by providing a specific value to the registry of Apple’s proprietary hardware.

However, this is not all the problems that the developers had to face-Apple’s hardware is also characterized by a non-standard approach to exceptions and system time.

A big surprise when it comes to Apple silicon is also that this system borrows a lot from older products, and it’s not just companies from Cupertino. In addition to the boot process, which dates back to the early days of iOS, we also have the UART chip, which was created by Samsung-this in turn provided systems on the chip for the first iPhone devices. Moreover, the I2C bus was based on the pwrficient chip used in the amigaone x1000.

As you can see, there are a lot of special things here.


Summary

Martin’s entry, unfortunately, has not yet been completed with a link to a Linux distribution that would work on Mac. Nevertheless, it is good to know that work moving forward and despite a lot of problems, the developers of Asahi Linux somehow manage. Apple’s Silicon processors are very unique systems, so creating a Linux port there is not one of the easiest tasks.

Go to our cases Get a free quote