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

  • DuckDuckGo tries to explain why its browsers won't block some Microsoft web trackers
    Meanwhile, Tails 5.0 users told to stop what they're doing over Firefox flaw

    DuckDuckGo promises privacy to users of its Android, iOS browsers, and macOS browsers – yet it allows certain data to flow from third-party websites to Microsoft-owned services.

    Security researcher Zach Edwards recently conducted an audit of DuckDuckGo's mobile browsers and found that, contrary to expectations, they do not block Meta's Workplace domain, for example, from sending information to Microsoft's Bing and LinkedIn domains.

    Specifically, DuckDuckGo's software didn't stop Microsoft's trackers on the Workplace page from blabbing information about the user to Bing and LinkedIn for tailored advertising purposes. Other trackers, such as Google's, are blocked.

    Continue reading
  • Despite 'key' partnership with AWS, Meta taps up Microsoft Azure for AI work
    Someone got Zuck'd

    Meta’s AI business unit set up shop in Microsoft Azure this week and announced a strategic partnership it says will advance PyTorch development on the public cloud.

    The deal [PDF] will see Mark Zuckerberg’s umbrella company deploy machine-learning workloads on thousands of Nvidia GPUs running in Azure. While a win for Microsoft, the partnership calls in to question just how strong Meta’s commitment to Amazon Web Services (AWS) really is.

    Back in those long-gone days of December, Meta named AWS as its “key long-term strategic cloud provider." As part of that, Meta promised that if it bought any companies that used AWS, it would continue to support their use of Amazon's cloud, rather than force them off into its own private datacenters. The pact also included a vow to expand Meta’s consumption of Amazon’s cloud-based compute, storage, database, and security services.

    Continue reading
  • Atos pushes out HPC cloud services based on Nimbix tech
    Moore's Law got you down? Throw everything at the problem! Quantum, AI, cloud...

    IT services biz Atos has introduced a suite of cloud-based high-performance computing (HPC) services, based around technology gained from its purchase of cloud provider Nimbix last year.

    The Nimbix Supercomputing Suite is described by Atos as a set of flexible and secure HPC solutions available as a service. It includes access to HPC, AI, and quantum computing resources, according to the services company.

    In addition to the existing Nimbix HPC products, the updated portfolio includes a new federated supercomputing-as-a-service platform and a dedicated bare-metal service based on Atos BullSequana supercomputer hardware.

    Continue reading

Biting the hand that feeds IT © 1998–2022