Corellium announces its port of Linux to M1 chips

Corellium has presented a version of Linux adapted to run on newer Apple computers equipped with the chip M1, the Linux kernel variant compatible with the Apple M1 chip is released under the GPLv2 license, and patches have been submitted for inclusion in the main kernel.

Corellium has extensive experience in migrating from Linux to Apple chips used on mobile devices such as the iPhone. In the early stage of the migration, testers were encouraged that many of the Apple M1 components are based on technologies already used by Apple in other SoCs.

But in the process of writing drivers, it became clear that not everything is so simple and the Apple M1 chip includes many non-standard solutions. Linux support for ARM 64-bit SoCs is based on common building blocks and firmware interfaces, but the Apple M1 hardly uses typical solutions.

For example, in conventional ARM SoCs, the activation of the CPU cores is done through the PSCI (Power State Coordination Interface) provided by the firmware and on Apple M1 it requires manipulation of the MMIO register.

In this stage, Corellium developers got ahead of the Asahi Linux project, founded by Héctor Martin to port Linux to systems with the Apple M1 chip, which until now has been limited to reverse engineering and experimenting with a bootloader. However, the key goal of Asahi Linux is not just to boot Linux, but to provide full support for power management mechanisms and to use the capabilities of the Apple M1 GPU, which uses a specific set of instructions.

Corellium patches are limited to providing boot and support for specific features of M1 chips related to SMP mode, timers, interrupts, idle state handling and initialization.

The Asahi Linux representatives welcomed the release of Corellium patches and they expressed their willingness to provide peer review assistance to accelerate mainstream adoption of the Linux kernel.

Additionally, Alyssa Rosenzweig (from Collabora who develops the Panfrost GPU Mali driver) has also been said to have published a second report on reverse engineering and developing open source drivers for the Apple M1 GPU.

At the current stage, an initial prototype of the controller has been prepared, which can draw triangles using the GPU. For M1 GPUs, the first vertex and fragment shaders are also hand-coded. The kernel driver IOKit is used to interact with the GPU.

The Apple M1 also uses its own AIC interrupt controller (Apple Interrupt Controller), which for the most part it is incompatible with standard ARM GICs and a different mechanism for binding interrupts from a timer. In addition, to organize the interaction between multiple processors, separate registers are used that control IPI (inter-processor interrupts).

To boot into a Mac Mini M1 computer with an Apple M1 chip, a ready-to-use rootfs image is prepared, built on the basis of the Ubuntu build for Raspberry Pi.

To install, the image must be copied to a drive USB, connect this unit to the USB-C port and start the computer in 1TR mode (Recovery OS) by pressing and holding the Power button while booting. After the command line appears, you need to run the linuxsetup.sh script, which will install the kernel and configure the environment.

This is when Linux will start running, whereas to return macOS, you must run the command "bputil -n" in 1TR mode.

Ready build supports USB, I2C and DART, it is suggested to use external USB adapter for network, while graphics hardware acceleration and extended peripherals are not yet supported. Bluetooth support requires writing a new driver due to the use of a non-standard PCIe-based protocol.

Source: https://corellium.com


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.