No description
Find a file
Hector Martin 1429c2a6e3 LICENSE: Fix copyright line
No years, please.

Signed-off-by: Hector Martin <marcan@marcan.st>
2022-03-07 23:59:25 +09:00
.github/workflows ci: add a m1n1 build CI job 2021-06-09 19:10:10 +09:00
3rdparty_licenses usb: add drivers/usb/dwc3/core.h from linux 2021-04-15 18:39:33 +09:00
artwork@35626c31f5 Initial commit 2021-01-15 04:03:35 +09:00
data Initial commit 2021-01-15 04:03:35 +09:00
dts dts: Update with current kernel devicetree, improve build 2021-03-15 02:26:31 +09:00
font fb console: add Source Code Pro font 2021-04-14 18:11:37 +09:00
proxyclient m1n1.hw.DART: coalesce continuos l2 ptes 2022-02-24 23:55:46 +09:00
src kboot: Hide the notch 2022-02-22 01:04:55 +09:00
sysinc string.h: Add toupper()/tolower() 2021-10-18 18:17:15 +09:00
tools tools/reg_filter.py: Tool to add IMPDEF sysreg names to a disasm 2021-11-16 17:18:09 +09:00
.clang-format hv: Move VM code to hv_vm.c 2021-05-04 15:38:17 +09:00
.editorconfig .editorconfig: trim trailing whitespace 2021-01-15 04:04:12 +09:00
.gitignore Add a few more temporary files to .gitignore 2021-08-03 13:52:31 +09:00
.gitmodules Initial commit 2021-01-15 04:03:35 +09:00
config.h main: Add RELEASE mode features 2022-02-22 00:30:54 +09:00
docker-compose.yml tooling: Add container setup for build environment 2021-02-18 16:14:15 +09:00
Dockerfile tooling: Add container setup for build environment 2021-02-18 16:14:15 +09:00
LICENSE LICENSE: Fix copyright line 2022-03-07 23:59:25 +09:00
m1n1-raw.ld heapblock: Remove payload_end logic for heap start 2021-12-17 22:26:54 +09:00
m1n1.ld Fix warnings when building/linking with clang/llvm 2021-11-08 13:53:04 +09:00
Makefile main: Add RELEASE mode features 2022-02-22 00:30:54 +09:00
README.md Focused on the Asahi Linux Contributors 2022-01-01 16:48:33 +09:00

m1n1: an experimentation playground for Apple Silicon

(And to some extent a Linux bootloader)

Building

You need an aarch64-linux-gnu-gcc cross-compiler toolchain (or a native one, if running on ARM64). You also need dtc (the devicetree compiler) and convert (from ImageMagick) for the boot logos.

$ git clone --recursive https://github.com/AsahiLinux/m1n1.git
$ cd m1n1
$ make

The output will be in build/m1n1.macho.

To build on a native arm64 machine, use make ARCH=.

Building on ARM64 macOS is supported with clang and LLVM; you need to use Homebrew to install the required dependencies:

$ brew install llvm imagemagick dtc

After that, just type make.

Building using the container setup

If you have a container runtime installed, like Podman or Docker, you can make use of the compose setup, which contains all build dependencies.

$ git clone --recursive https://github.com/AsahiLinux/m1n1.git
$ cd m1n1
$ podman-compose run m1n1 make
$ # or
$ docker-compose run m1n1 make

Usage

Our developer quickstart guide has more information on how to use m1n1.

To install on an OS container based on macOS <12.1, use m1n1.macho:

kmutil configure-boot -c m1n1.macho -v <path to your OS volume>

To install on an OS container based on macOS >=12.1, use m1n1.bin:

kmutil configure-boot -c m1n1.bin --raw --entry-point 2048 --lowest-virtual-address 0 -v <path to your OS volume>

Payloads

m1n1 supports running payloads by simple concatenation:

$ cat build/m1n1.macho Image.gz build/dtb/apple-j274.dtb initramfs.cpio.gz > m1n1-payload.macho
$ cat build/m1n1.bin Image.gz build/dtb/apple-j274.dtb initramfs.cpio.gz > m1n1-payload.bin

Supported payload file formats:

  • Kernel images (or compatible). Must be compressed or last payload.
  • Devicetree blobs (FDT). May be uncompressed or compressed.
  • Initramfs cpio images. Must be compressed.

Supported compression formats:

  • gzip
  • xz

License

m1n1 is licensed under the MIT license, as included in the LICENSE file.

  • Copyright The Asahi Linux Contributors

Please see the Git history for authorship information.

Portions of m1n1 are based on mini:

m1n1 embeds libfdt, which is dual BSD and GPL-2 licensed and copyright:

  • Copyright (C) 2014 David Gibson david@gibson.dropbear.id.au
  • Copyright (C) 2018 embedded brains GmbH
  • Copyright (C) 2006-2012 David Gibson, IBM Corporation.
  • Copyright (C) 2012 David Gibson, IBM Corporation.
  • Copyright 2012 Kim Phillips, Freescale Semiconductor.
  • Copyright (C) 2016 Free Electrons
  • Copyright (C) 2016 NextThing Co.

The ADT code in mini is also based on libfdt and subject to the same license.

m1n1 embeds minlzma, which is MIT licensed and copyright:

  • Copyright (c) 2020 Alex Ionescu

m1n1 embeds a slightly modified version of tinf, which is ZLIB licensed and copyright:

  • Copyright (c) 2003-2019 Joergen Ibsen

m1n1 embeds portions taken from arm-trusted-firmware, which is BSD licensed and copyright:

  • Copyright (c) 2013-2020, ARM Limited and Contributors. All rights reserved.

m1n1 embeds Doug Lea's malloc (dlmalloc), which is in the public domain (CC0).

m1n1 embeds portions of PDCLib, which is in the public domain (CC0).

m1n1 embeds the Source Code Pro font, which is licensed under the OFL-1.1 license and copyright:

  • Copyright 2010-2019 Adobe (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe in the United States and/or other countries.
  • This Font Software is licensed under the SIL Open Font License, Version 1.1.

m1n1 embeds portions of the dwc3 usb linux driver, which was BSD-or-GPLv2 dual-licensed and copyright