Skip to content

Instantly share code, notes, and snippets.

@willnode
Last active May 31, 2025 22:07
Show Gist options
  • Save willnode/88da35d0c0542276b4631746d8fc3de1 to your computer and use it in GitHub Desktop.
Save willnode/88da35d0c0542276b4631746d8fc3de1 to your computer and use it in GitHub Desktop.
Build Redox OS in MacOS Apple Silicon

This is a way to compile Redox OS in MacOS Apple Silicon using Podman.

WIP -- This gist is being updated to match with the book but specifics to MacOS Apple Silicon for top DX. For native bootstrap follow another gist (also WIP)

Clone

cd ~/Document
git clone https://gitlab.redox-os.org/redox-os/redox
cd redox
git submodule update --init --recursive
./podman_bootstrap.sh -d

Setup .config

Set arch target. Write this to ./.config:

PODMAN_BUILD?=1
ARCH=x86_64
CONFIG_NAME=desktop-minimal
PREFIX_BINARY=1
REPO_BINARY=1

The PREFIX_BINARY and REPO_BINARY will make the build speed so much quick.

Switch to my branch

An open MR is requested. Meanwhile you can switch to this branch to make podman working.

git remote set-url origin https://gitlab.redox-os.org/willnode/redox
git checkout patch-make-macos

Running the build

Run make to run build, run make qemu to run it.

For running aarch64 arch, the correct firmware is this:

-		FIRMWARE=/usr/share/AAVMF/AAVMF_CODE.fd
+		FIRMWARE=/opt/homebrew/opt/qemu/share/qemu/edk2-aarch64-code.fd

Also if you like to prefer x64 UEFI:

-		FIRMWARE=/usr/share/OVMF/OVMF_CODE.fd
+		PFLASH0=/opt/homebrew/opt/qemu/share/qemu/edk2-x86_64-code.fd
@thynus
Copy link

thynus commented Feb 16, 2025

I am going to try this out on an m3 macbook air. Thank you for putting this together! I am going to replace all the brew statements with port and see what happens.

= = = = = = =
sudo port install coreutils

bootstrap.sh not available using
native_bootstrap.sh

sh ./native_bootstrap.sh -d -e qemu

---> Configuring osxfuse
---> Building osxfuse
Error: Failed to build osxfuse: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_fuse_osxfuse/osxfuse/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug.
Error: Processing of port osxfuse failed

= = = = = = =

Any ideas on how to get past this point? osxfuse is version 3.8.3 but I would need version 4.8.3 (macOS 14.7) which requires security changes in my recovery environment.

@thynus
Copy link

thynus commented Feb 19, 2025

= = = = = = =
switching to ARM Ubuntu:

relibc does not compile; known problem with ARM hosts.

= = = = = = =

@willnode
Copy link
Author

Hello guys, I actually no longer recommends this approach. Please try running virtualized ubuntu if you can. I might will update this approach if i got some time.

@willnode
Copy link
Author

Updated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment