Linux for macOS M1: What the Asahi Linux team did in January-February 2021 (part 2)

I continue to translate the report of the Asahi Linux project.





Let's play with iron

m1n1 comes from mini , a minimal skin I developed for the Nintendo Wii. mini helped me a lot with experiments and as a basis for BootMii (for those who own a Wii and understand what's what - mini is what is actually running on the ARM CPU while you are in the BootMii menu).





Okay, so what does this have to do with the Apple Silicon bootloader?





Well, mini was a small and fairly simple program that could work directly with hardware and run straight on a 32-bit ARM system without any libraries or other dependencies. This is a good base for expanding functionality, so we ported it to AArch64 and Apple Silicon, and called the port m1n1.





What turned out to be much more important, m1n1 inherited a killer feature from mini: since mini was launched on an additional processor that needed to be controlled from the main processor, it has a built-in RPC running through the serial port. This means that we can control mini and m1n1 from another computer right during operation. m1n1 allows using Python scripts running on another machine to manipulate the hardware on the target m1 Mac. You can even do it right from the interactive terminal ! To be honest, this is rather a universal tool for experimenting with hardware, which, by pure coincidence, also acts as a Linux bootloader in our case.





m1n1 Apple . , , x86 Rosetta. Apple-specific CPU . , . , , , Linux .





M1 Mac Mini m1n1 7 , , ( BSOD :) ). m1n1 , : m1n1, kmutils, .





m1n1 Apple ARM, , (, ), .





m1n1, . - , macOS . , Apple, , , , . - nouveau, nvidia gpu - Linux , .





, - , . M1 mac? :)





UART!

, . , UART , , . CPU, , .





, - RS-232 COM , . ( ) , , , .





M1 ?





, M1 , - USB-C ! , , USB-PD. USB-PD (Power delivery) Type C . USB , , , - , , , DisplayPort, , , . Type C . , ( ), DFU recovery mode, (I2C).





vdmtool: , Arduino, USB-PD PHY . , , , . : , USB-PD PHY, Type C, 1.2 UART , .





: m1 - ! , , Type C (SuperSpeed / USB3.0) macvdmtool. m1 , . API , , .





, , mac m1 - :) USB-PD , . , , , , Android . USB-PD , , , . , ! - , 1 .





, , : , 150/c. M1 , , USB , ( iPhone), USB- (CDC-ACM), . USB, Type C ( CtoA) . USB , - . - , - . m1n1, , : Type C UART USB . , , Linux, .





We'll be adding this to m1n1 in the coming weeks, so stay tuned!





<To be continued>








All Articles