适配apple M1 en.jpg

We have exciting news to share: In the recently released deepin V23 beta version, the deepin operating system is officially compatible with Apple Mac mini M1!

The Mac mini M1 is a mini desktop computer chip released by Apple in November 2020. It features an 8-core M1 processor with a maximum clock speed of 3.2GHz, two Thunderbolt ports, two USB 3.0 Type A ports, HDMI 2.0, and a 3.5mm headphone jack. As it shares the same processor as the Macbook Air M1 and Macbook Pro M1, this adaptation also lays the foundation for future porting work on these two machines.

Today, we will take you on a journey through the selection of the Apple M1 adaptation plan, the adaptation process, and the preparations for the adaptation work. Let's explore our adaptation journey together!

Choice of Adaptation Scheme

Due to the Mac M1 machine using a different boot system than the regular x86_64 compatible machines, porting a standard PC operating system onto it requires resolving the boot system issue. Developing a custom solution for this proved too complex, as it would involve in-depth research into the Mac M1's boot system and even reverse engineering crucial hardware drivers. As a result, we chose to utilize the already mature and proven Asahi Linux project to drive our adaptation efforts.

Asahi Linux is a project and community dedicated to adapting Linux to the Apple Silicon platform. Within this community, several Linux distributions have already been successfully adapted, including Alpine Linux, Debian, Fedora, Gentoo, Ubuntu, and more. For specific details, please refer to: https://github.com/AsahiLinux

docs(https://github.com/AsahiLinux/docs/wiki/SW%3AAlternative-Distros)

WeChat Image_20230705094213.png

Adaptation Process

In order to let everyone understand what our adaptation has done, first of all, we will introduce the process of using the Asahi Linux project to install and start Linux on the Apple Silicon platform:

Step 1

First, run the installation script on Mac OS. This installation script will pull the installation configuration and rootfs installation package, partition the remaining disk space, and flash the bootloader (m1n1 and UBoot) and rootfs for the subsequent installation process.

Step 2

Then, turn it off and start it again, and enter the flashed startup item. At this time, the work of setting the installed Linux distribution as the default startup item will be performed.

Step 3

After restarting the computer, the system will enter the flashed bootloader, which is m1n1. m1n1 will load the bootloader of the next UEFI system according to the settings, usually UBoot. UBoot will decide whether to start the operating system directly or start Grub according to the configuration file. From here, the subsequent process is similar to the normal UEFI system.

Step 4

Finally, depending on the installation method of different distributions, the first startup may enter the configuration wizard. For example, the official ArchlinuxARM will boot into their specially customized calamares installer.

Adaptation Work Preparation

For the current deepin M1 adaptation project, the deepin community team has comprehensively considered the Asahi Linux official installer and The existing deepin arm64 software warehouse, after combining the m1-debian project and the deepin-m1 project that justforlxz did before, has done the adaptation work on the basis of the m1-debian project.

To port deepin to the m1 platform, the following preparations need to be completed:

1. Provide the Linux installation script executed on the Mac;

2.Build a file server that provides installation scripts, installation configuration and rootfs. (optional http or ftp);

3.bootloader (m1n1+uboot);

4.Kernel with M1 Mac related drivers;

5.Mesa adapted to M1 GPU;

6.Package/update some key packages.

Because Apple M1 is also an ARM architecture, we can still use the existing deepin arm64 warehouse. For the key components mentioned in the above preparations, we need to package and build warehouses separately. For example, the kernel and Mesa used by M1. Currently, the deepin-m1 project has been publicly released on GitHub, and interested friends can try it out. If you want to install directly on Mac, you can also use https://ci.deepin.com/repo/deepin/deepin-ports/deepin-m1/deepin.install script directly.

Adapt to the future goals of M1

DDE desktop environment is one of the core projects of Deepin. How to provide a friendly interactive experience on the Mac M1 device like other machines is the core goal of our future adaptation. At present, in order to solve the problem of starting the system and desktop environment, deepin-m1 SIG has packaged M1-related components by itself, and provided our deepin-m1 installation script and installation warehouse.

At the current stage, although the deepin system has been able to start normally on the Mac Mini M1, it has not yet reached the stage of daily use, and there are many adaptation problems. For example: the system lacks software applications, there is no setup wizard for the first startup, sound and GPU hardware acceleration are not available, etc. We are currently actively working on these issues.

We also sincerely hope that the adaptation of deepin can inject new vitality into the Apple Silicon project and even the Linux ecosystem on ARM, and we also look forward to friends who are interested in deepin-m1 or deepin-arm transplantation to join our SIG and communicate with us. Let's work together to improve the open source software ecosystem.

deepin-m1 SIG entry: https://github.com/deepin-community/deepin-m1

Finally, I am very grateful to the developers of deepin-related SIGs, and thank you very much for your assistance and support in the Asahi Linux and m1-debian projects. It is precisely because of your contributions to open source and participation in open source that deepin is getting better and better. Thank you again!

In the next article, we will focus on the problems solved by the adaptation process, and welcome your attention.

Leave a Reply