Building from Source
This guide walks through building Aeolos from source, giving you a complete development environment for kernel hacking.Prerequisites
Required Tools
Aeolos requires a modern Linux distribution with the following packages:- Debian/Ubuntu
- Fedora/RHEL
- Arch Linux
GCC
C compiler for kernel code (gnu2x standard)
NASM
Assembler for SMP trampoline code
xorriso
ISO 9660 image creation tool
mtools
Utilities for manipulating disk images
Optional: QEMU for Testing
Clone the Repository
Clone with submodules
Aeolos uses git submodules for third-party dependencies (Limine bootloader and SAF archive tools).If you already cloned without
--recursive, initialize submodules:Build Process
Complete Build
The simplest way to build everything:- Build the SAF tools (
thirdparty/saf) - Compile the kernel (
kernel/kernel.elf) - Generate kernel symbols
- Package the initrd (
image/boot/initrd.saf.gz) - Create the bootable ISO (
os.iso)
The build process uses a two-pass linking approach to embed kernel symbols for debugging.
Understanding the Build
The rootMakefile orchestrates the build:
Kernel Compilation
The kernel is built from C and assembly sources in Compiler flags (from These flags ensure:
kernel/:kernel/Makefile):- Freestanding environment (no standard library)
- No position-independent code
- Kernel code model for higher-half addressing
- No red zone (required for interrupt handlers)
- No x87/MMX/SSE (kernel shouldn’t use FP)
SMP Trampoline
The 16-bit real mode trampoline for starting secondary CPUs:This binary blob is embedded in the kernel for SMP initialization.
Symbol Generation
After initial linking, the This generates
gensym tool extracts symbols:_symbols.gen which is compiled and linked back into the kernel, enabling runtime symbol lookup for debugging.Initrd Creation
The initial ramdisk is created from files in The SAF (Simple Archive Format) file is compressed with gzip and loaded by the bootloader.
initrd/:Kernel Structure
The kernel source tree is organized as follows:Build Targets
The Makefile provides several targets:Running in QEMU
Themake run target builds and tests the OS:
Boot Configuration
The Limine bootloader is configured viaimage/boot/limine.cfg:
Stivale2 Protocol
Modern boot protocol with clean handoff to the kernel
Framebuffer Mode
800x600x32 graphical mode for terminal output
Kernel Module
Compressed initrd loaded as a boot module
No Timeout
Boots immediately without menu
Development Workflow
Rebuild
You can often omit
make clean for incremental builds, but use it if you encounter linking issues.Troubleshooting
Build fails: command not found
Build fails: command not found
Missing build dependencies.Solution: Install all required packages from the Prerequisites section.
Submodules are empty directories
Submodules are empty directories
Git submodules weren’t initialized.Solution:
Linking errors about undefined references
Linking errors about undefined references
Symbol generation might have failed.Solution: Clean and rebuild:
ISO won't boot in QEMU
ISO won't boot in QEMU
The image might be corrupted or bootloader not properly installed.Solution: Ensure xorriso and mtools are installed, then:
Changes to initrd files not appearing
Changes to initrd files not appearing
The initrd needs to be regenerated.Solution: Remove the old initrd:
Advanced: Custom Kernel Configuration
You can modify the kernel build by editingkernel/Makefile:
Debug Symbols
Add debug symbols for GDB:Optimization Levels
Change from-Og (debug-friendly) to -O2 (optimized):
Memory Configuration
Adjust QEMU memory allocation in rootMakefile:
CI/CD Build
The GitHub Actions workflow builds Aeolos automatically:os.iso artifact.
Next Steps
Run Aeolos
Test your build in QEMU
Architecture Overview
Learn about the kernel internals
The kernel entry point is
kmain() in kernel/kmain.c. Start there to understand the initialization sequence and modify OS behavior.