Asahi's plan for Linux on Apple's new silicon shows Cupertino has gone back to basics with iOS booting

Open source project shows Apple has done some funky stuff with M1


The Asahi Linux project has published the first progress report detailing its effort to port Linux to the Apple Silicon platform.

The lengthy blog post describes in extensive detail the challenges faced by the project in understanding how Apple’s home-grown proprietary chippery works on a fundamental level, as well as the circumventing the various non-standard quirks that limit the ability to boot third-party operating systems.

The report, written by kernel hacker and Asahi Linux co-founder Hector Martin, unfortunately doesn’t conclude with a link to a fully working Linux distro. It does, however, illustrate how widely Apple Silicon-based Macs diverge from standards you might typically see.

The boot process, for example, isn’t what you’d expect to see on a conventional ARM64 system, but rather “a bespoke Apple mechanism” originating from the early days of iOS, with design elements derived from the Open Firmware specification as seen with the New World ROM Macs.

This has forced the Asahi Linux project to develop a bespoke bootloader for Apple Silicon machines called m1n1, which aims to take care of as many ‘Apple-isms’ as possible. But it’s a bit more than that.

The origins of m1n1 lie in mini, a project created by Martin as part of his research into jailbreaking the Nintendo Wii. While it supports the booting of third-party code, it also allows researchers to control the machine in real-time from a development computer. By using its interactive shell, or writing simple Python scripts, you can enumerate how the Apple Silicon processor works on a low, bare-metal level.

This has allowed the Asahi Linux team to identify features that are distinct to the Apple Silicon M1 processor, such as configuration bits designed to improve performance when running x86 code in Rosetta.

“Using m1n1, we’ve been hard at work documenting Apple’s custom Arm instructions, Apple-specific system registers, hardware such as the Apple Interrupt Controller, and more,” Martin wrote.

Asahi Linux logo

Crowdfunded Asahi project aims for 'polished' Linux experience on Apple Silicon

READ MORE

This enumeration came in handy because, as noted, Apple Silicon is a completely distinct and proprietary system. There is almost no documentation on how it works, and its behaviour diverges from other ARM64 chips.

Martin notes that when the chip idles, there’s a chance it may choose to “power gate,” which sees parts of the CPU switched off to reduce energy consumption. This has the nasty side effect of wiping the contents of registers, save for the stack pointer and program counter, causing Linux to crash.

Fortunately, the Asahi Linux team was able to identify a way to disable this particular functionality by providing a specific value to an Apple-proprietary hardware register, allowing their work to continue. Other “Apple-isms” that proved frustrating included a completely bespoke approach to exceptions and the system timer.

Reading the report, the biggest surprise about the Apple Silicon platform is how much of its lineage stems from older products. The boot process, as noted, is derived from that first used on iOS. The UART chip, used for serial communications, was made by Samsung – a company which, Martin notes, provided the SoC for the first iPhones. The I2C hardware was originally designed by now-Apple-owned PA Semi, with the design based on a PWRficient chip also used in the AmigaOne X1000.

This led to an unusual situation where an Amiga clone from 2010, running a derivative of an OS that reached its peak popularity in the late 1980s, played a role in documenting the internal machinations of the newest Macs.

Through painstaking investigative work, the Asahi Linux project has been able to bring a limited Linux environment to the Apple Silicon M1 platform. It’s far removed from being a workable, fully-fledged system, however. There’s no real display driver, for example, with the project instead using the basic firmware-provided framebuffer.

“As it is not a proper display driver, there is no way to change resolutions, handle display hotplug, or even put displays to sleep. It is sufficient for development and demos, but we will have to write a proper display controller driver in due course,” Martin wrote. Meanwhile, the GPU remains a black box, with reverse engineering work still in-process.

The Asahi Linux project isn’t the only effort to bring Linux to the Apple M1, with Corellium managing to boot a port of Ubuntu on the latest-and-greatest Mac Mini. This too is in early days, with support for graphics acceleration and networking conspicuously absent. ®

Similar topics


Other stories you might like

  • Prisons transcribe private phone calls with inmates using speech-to-text AI

    Plus: A drug designed by machine learning algorithms to treat liver disease reaches human clinical trials and more

    In brief Prisons around the US are installing AI speech-to-text models to automatically transcribe conversations with inmates during their phone calls.

    A series of contracts and emails from eight different states revealed how Verus, an AI application developed by LEO Technologies and based on a speech-to-text system offered by Amazon, was used to eavesdrop on prisoners’ phone calls.

    In a sales pitch, LEO’s CEO James Sexton told officials working for a jail in Cook County, Illinois, that one of its customers in Calhoun County, Alabama, uses the software to protect prisons from getting sued, according to an investigation by the Thomson Reuters Foundation.

    Continue reading
  • Battlefield 2042: Please don't be the death knell of the franchise, please don't be the death knell of the franchise

    Another terrible launch, but DICE is already working on improvements

    The RPG Greetings, traveller, and welcome back to The Register Plays Games, our monthly gaming column. Since the last edition on New World, we hit level cap and the "endgame". Around this time, item duping exploits became rife and every attempt Amazon Games made to fix it just broke something else. The post-level 60 "watermark" system for gear drops is also infuriating and tedious, but not something we were able to address in the column. So bear these things in mind if you were ever tempted. On that note, it's time to look at another newly released shit show – Battlefield 2042.

    I wanted to love Battlefield 2042, I really did. After the bum note of the first-person shooter (FPS) franchise's return to Second World War theatres with Battlefield V (2018), I stupidly assumed the next entry from EA-owned Swedish developer DICE would be a return to form. I was wrong.

    The multiplayer military FPS market is dominated by two forces: Activision's Call of Duty (COD) series and EA's Battlefield. Fans of each franchise are loyal to the point of zealotry with little crossover between player bases. Here's where I stand: COD jumped the shark with Modern Warfare 2 in 2009. It's flip-flopped from WW2 to present-day combat and back again, tried sci-fi, and even the Battle Royale trend with the free-to-play Call of Duty: Warzone (2020), which has been thoroughly ruined by hackers and developer inaction.

    Continue reading
  • American diplomats' iPhones reportedly compromised by NSO Group intrusion software

    Reuters claims nine State Department employees outside the US had their devices hacked

    The Apple iPhones of at least nine US State Department officials were compromised by an unidentified entity using NSO Group's Pegasus spyware, according to a report published Friday by Reuters.

    NSO Group in an email to The Register said it has blocked an unnamed customers' access to its system upon receiving an inquiry about the incident but has yet to confirm whether its software was involved.

    "Once the inquiry was received, and before any investigation under our compliance policy, we have decided to immediately terminate relevant customers’ access to the system, due to the severity of the allegations," an NSO spokesperson told The Register in an email. "To this point, we haven’t received any information nor the phone numbers, nor any indication that NSO’s tools were used in this case."

    Continue reading

Biting the hand that feeds IT © 1998–2021