Updated Porting a workable Linux to Apple's new silicon is a modern-day Holy Grail for some. Sadly, it's not all sunshine and rainbows for those undertaking the quest.
Two outfits having a crack at it are Asahi Linux, which has the goal of getting a Linux functioning well enough on the silicon to the point where it could become a daily driver, and Corellium, a Florida-based company that sells virtual Arm-based devices running in the cloud (including iPhones.)
The latter was founded back in 2017 and its service has proven to be a boon for researchers, with features such an optional jailbreak "for any version".
With that experience under its belt, it was therefore not particularly surprising to see Corellium unveil a port of Linux to Apple's M1 silicon over the weekend.
Chris Wade, CTO of Corellium, went on to say: "All of @CorelliumHQ's Linux for M1 code will be released under a permissive open-source license and we are actively looking to upstream it into Linux."
The release, which Wade explained was for "advanced users only" due to its early beta state and lacking features such as USB, caused a few raised eyebrows among observers. Some were delighted to see it, but others pondered the apparent lack of a GNU General Public Licence (GPL).
Judge rules Corellium iOS research app 'fair use' in slap to AppleREAD MORE
You gotta have standards...
The work was officially welcomed by the Asahi Linux team, but project lead Hector Martin attracted the ire of Wade by noting in a now-deleted tweet that worries about upstream standards meant the work couldn't be used by Asahi (at least in its current state).
Messages from an exchange between Martin and Wade were then posted, in which the latter pointed out that the port had been undertaken "in our own time" and amid somewhat trying circumstances.
Wade was referring to the company's legal woes. Having attempted to acquire Corellium in 2018, Apple had gone on to sue the firm, alleging intellectual property infringement, and unleashed the lawyers the following year. Corellium has been fending off the iGiant ever since.
A judge ruled against the iPhone maker - albeit on only one of Apple's claims in the suit - earlier this month.
The Register has contacted both Wade and Martin to get their take on events and where they feel things are at now.
Wade told us the Corellium gang was keen to lend its expertise to porting efforts. "We have pretty unrivaled understanding of Apple SOCs," he said, "which we relied on to port Android to the iPhone previously, and we had already modelled the A14 chip for our iPhone 12 virtual devices, so we wanted to share that knowledge to give the community a boost in getting Linux running on these new M1 systems."
"We'd really like to thank the engineers at PongoOS and Asahi for their collaboration," he added, "and we hope our contributions help Asahi Linux come to life even faster. We plan on releasing the source today, along with a working version of Linux with SMP and USB support, which we will submit for upstream review."
For his part, Martin declined to comment further on Corellium, aside from noting that "they are free to submit their Linux changes for upstream inclusion directly to kernel subsystem maintainers, or to contact us to contribute."
Unlike the closed world of Apple's mobile chips, Martin added that "the M1 is an open system that allows users to run their own code at all privilege levels on the main CPU core cluster."
As such, no "jailbreaks" or similar techniques are needed.
However, where a bit of reverse engineering is needed (for example, the M1 GPU), Martin explained that third parties were required to follow "the 'clean-room' approach where contributors write documentation which is then implemented by someone else."
He directed us to Asahi Linux's copyright policies and told us "besides complying with all the relevant open source licenses and upstream requirements, we have strict policies regarding reverse engineering."
As for the project itself, he said: "We only became able to test our code last week when Apple released macOS 11.2 Beta 2... and so nearly all code from our project basically represents less than one week of development at this time."
However, "the road to Penguins on the screen will be measured in days," he added, "with a basic graphical environment following in a few weeks."
"I expect us to get much, much further than most people expect before 2021 is over."
As for the to and fro of the weekend, Martin was keen to get back to the grindstone. ®
One day of drama is more than enough for the next few months, so I've deleted all related tweets; the message has certainly reached those who needed to hear it.— Hector Martin (@marcan42) January 17, 2021
Now back to coding.
Updated at 12.55GMT on 20 January to add:
Chris Wade of Corellium got in touch to add that "our code is fully compliant with GPL." Those who fancy taking a look can find it on GitHub.