Asahi Linux progress: Apple Silicon OS works – though it's 'rough around the edges' and has no GUI acceleration

Fascinating project but will it ever be practical?


Developer Hector Martin has reported on progress with Asahi Linux, a port for Apple Silicon Macs, and said that the OS now works but with some limitations, notably a lack of accelerated graphics.

In his August progress report, Martin talks further about the challenges of porting Linux to a platform that was created by Apple for the sole purpose of running its own operating systems.

He calls the M1, the Arm-based SoC (System on a Chip) used in the Mac Mini and iPad Pro, "a massive reverse engineering challenge." Rather than attempting to disassemble the macOS drivers, Martin created a hypervisor to sit between macOS and the M1 hardware, for the purpose of "transparently intercepting and logging hardware access."

Python code running on a separate machine can control the hypervisor.

One of the complications, Martin discovered, is that Apple added a co-processor to the display controller (DCP). He said that Apple "took half of their macOS C++ driver, moved it into the DCP, and created a remote procedure call interface so that each half can call methods on C++ objects on the other CPU! Talk about overcomplicating things."

The reverse engineering enabled Martin and his team to "implement enough of the interface to finally send display buffer swaps to the display. This allows us to implement tear-free graphics with double-buffering, hardware mouse pointer acceleration, framebuffer scaling and compositing, and more."

The DCP presents a complication since the exact interface of this firmware "changes every macOS version."

This means, Martin said, that Asahi Linux will have to support only specific firmware versions, though he is confident that "this firmware is per-OS, not per-system."

The first version of Asahi Linux is expected to support the firmware that comes with macOS 12 "Monterey", currently in preview. He added that it is not possible to replace the firmware with custom code "as it is loaded by iBoot before it hands control to the OS, and it is signed by Apple."

Applied math/s student Alyssa Rosenzweig, who describes herself as "a graphics developer passionate about software freedom," is working on a Gallium driver for the M1 GPU. A Gallium driver would enable OpenGL and OpenCL support as this is part of the Gallium framework.

Another member of the team, Sven Peter, has been working on the Linux driver for the M1's IOMMU (I/O Management Unit). Peter's driver enables USB and PCIe to work "with minimal additional patches and drivers."

Martin reports that "it's already possible to use Asahi Linux as a development machine with a (non-accelerated) GUI, although things are still rough around the edges." Patches are being submitted to the Linux kernel. Martin said that the next step is to "tackle the GPU kernel driver."

Corellium, the company with which Apple recently settled a copyright lawsuit over its virtual iPhone service, also has a Linux port for M1. After a public disagreement in January, the two teams posted conciliatory tweets and now appear to be cooperating.

Last weekend, Rosenzweig submitted "a PCIe driver for the internal bus on the Apple M1" to the Linux kernel mailing list. "It's based on the work of Marc Zyngier, Mark Kettenis, and Stan Skowronek (Corellium)," she said, adding: "I've started using Linux on M1 as my workstation for Panfrost development, so this should have 40 hours of testing by this time next week," Panfrost being an open-source driver project for Arm Mali GPUs.

As developer Marc Zyngier noted, though: "Without specs, this thing is impossible to properly review." There is already a version 2 of the patch.

The work on Asahi Linux is fascinating and educational for those interested in the workings of modern hardware. It is also dependent on Apple continuing to allow booting unsigned kernels on Apple Silicon Macs, which the Asahi team take as evidence that "unlike iOS devices, Apple does not intend to lock down what OS you can use on Macs."

Combined with the dependence on Apple firmware that can change, and the general difficulty of building an OS on hardware the specification for which is reverse engineered, it is obvious that the team face considerable challenges. At the same time, in a world of app stores tightly controlled by giant corporations, the significance of open-source operating systems has never been greater. ®


Other stories you might like

  • Google sours on legacy G Suite freeloaders, demands fee or flee

    Free incarnation of online app package, which became Workplace, is going away

    Google has served eviction notices to its legacy G Suite squatters: the free service will no longer be available in four months and existing users can either pay for a Google Workspace subscription or export their data and take their not particularly valuable businesses elsewhere.

    "If you have the G Suite legacy free edition, you need to upgrade to a paid Google Workspace subscription to keep your services," the company said in a recently revised support document. "The G Suite legacy free edition will no longer be available starting May 1, 2022."

    Continue reading
  • SpaceX Starlink sat streaks now present in nearly a fifth of all astronomical images snapped by Caltech telescope

    Annoying, maybe – but totally ruining this science, maybe not

    SpaceX’s Starlink satellites appear in about a fifth of all images snapped by the Zwicky Transient Facility (ZTF), a camera attached to the Samuel Oschin Telescope in California, which is used by astronomers to study supernovae, gamma ray bursts, asteroids, and suchlike.

    A study led by Przemek Mróz, a former postdoctoral scholar at the California Institute of Technology (Caltech) and now a researcher at the University of Warsaw in Poland, analysed the current and future effects of Starlink satellites on the ZTF. The telescope and camera are housed at the Palomar Observatory, which is operated by Caltech.

    The team of astronomers found 5,301 streaks leftover from the moving satellites in images taken by the instrument between November 2019 and September 2021, according to their paper on the subject, published in the Astrophysical Journal Letters this week.

    Continue reading
  • AI tool finds hundreds of genes related to human motor neuron disease

    Breakthrough could lead to development of drugs to target illness

    A machine-learning algorithm has helped scientists find 690 human genes associated with a higher risk of developing motor neuron disease, according to research published in Cell this week.

    Neuronal cells in the central nervous system and brain break down and die in people with motor neuron disease, like amyotrophic lateral sclerosis (ALS) more commonly known as Lou Gehrig's disease, named after the baseball player who developed it. They lose control over their bodies, and as the disease progresses patients become completely paralyzed. There is currently no verified cure for ALS.

    Motor neuron disease typically affects people in old age and its causes are unknown. Johnathan Cooper-Knock, a clinical lecturer at the University of Sheffield in England and leader of Project MinE, an ambitious effort to perform whole genome sequencing of ALS, believes that understanding how genes affect cellular function could help scientists develop new drugs to treat the disease.

    Continue reading

Biting the hand that feeds IT © 1998–2022