Prerequisites
This guide assumes you have:- Homebrew installed
- Xcode or Xcode Command Line Tools installed
The Command Line Tools alone are sufficient - you don’t need the full Xcode application.
Setup with Homebrew
1
Configure Xcode Command Line Tools
If you have the full Xcode application installed, set your command line tools to use Xcode’s tools:
Skip this step if you only have the Command Line Tools installed.
2
Install core dependencies
3
Install filesystem support
Choose one of the following options:
- Option 1: fuse + ext2
- Option 2: genext2fs
4
Install debugging tools (Apple Silicon only)
For kernel debugging on Apple Silicon Macs:
This provides a native build of GDB that can cross-debug x86-64 code.
5
Install newer compiler (Xcode 14.2 or older)
If you have Xcode 14.2 or older, install a newer host compiler:
- LLVM 18
- GCC 13
Xcode 14.3 or later is known to work without additional compilers.
Setup with Nix
If you have Nix installed, you can enter a devshell with all dependencies:Build and Run
Once all dependencies are installed:Refer to the main Build System Overview for detailed build instructions.
Platform Notes
Apple Silicon vs Intel
- Apple Silicon
- Intel
- Both native aarch64 and x86_64 builds are supported
- Rosetta 2 should be disabled to build native aarch64 version
- Use
x86_64-elf-gdbfor debugging x86-64 kernel
macfuse Installation
CMake Version Notes
Homebrew ships bleeding-edge CMake versions, which should work fine. However: If Homebrew doesn’t offer CMake 3.25.x+ on your platform:$PATH.
Xcode Compatibility
If you have the full Xcode installed, keep it updated to avoid CMake compatibility issues with GCC.
Troubleshooting
macfuse Not Working
If you get permission errors:- Check System Settings for enabled kernel extensions
- Ensure you’ve restarted after installation
- Try reinstalling:
CMake Build Issues
If you encounter CMake errors:Compiler Version Issues
Verify your compiler versions:QEMU Launch Failures
If QEMU fails to start:Architecture-Specific Builds
To build for a specific architecture:- x86_64
- aarch64
Next Steps
Advanced Options
Explore build customization and CMake options
Build System Overview
Learn more about the SuperBuild system
