This project implements a custom bootloader designed to parse the entire root directory of a boot medium up to the ISO 9660 specifications limit to locate setup.ase
in a far better and more reliable than some OS bootloaders.
The make.py
script is a modular build system used to assemble, compile, link, and package the bootloader and related targets into an ISO image, including GPT/PMBR patching and optional QEMU emulation.
- Bootloader: A bootloader that scans the root directory to locate the setup file (
setup.ase
) and load it efficiently. - Setup.ase: The main OS setup binary, carefully assembled and linked.
- Build System: Python-based build automation for compiling assembly, C, and C++ sources, linking, creating bootable ISOs, and running in QEMU.
- ISO Support: Custom ISO9660 generation with GPT + Protective MBR patching to ensure wide compatibility.
- Emulation: Supports booting and testing with QEMU using various device types (
iso
,cdrom
,fdd
,hdd
).
- Fast and flexible root directory scanning bootloader
- Paged ISO Parsing which parses ISOs page by page
- Support to load a setup.ase binary which is limited to upwards of ~500KiB in raw content size
- Support for different boot mediums (FDD, HDD, ISO/CD-ROM, USB, etc) and different boot methods (BIOS MBR, BIOS GPT, UEFI)
- Modular build targets with flexible per-target configs
- Support for raw binary and ELF linked targets
- Custom linker script and includes directory usage
- Automated ISO image creation with GPT + PMBR patching
- Integrated QEMU emulation options with different boot devices
- Command-line flags for cleaning, debugging, selective builds, and minimal file operations
- Support for aligning individual files to align
boot.esp
to 1MiB (Required by some UEFI implementations)
/project-root
|
+-- build.py # Build automation script
+-- boot/ # Bootloader source code (assembly)
| +-- boot.asm
+-- setup/ # Setup OS sources (C, asm)
| +-- inc/flags.inc
| +-- initial/entry16.asm
| +-- initial/entry32.asm
| +-- linker.ld
| +-- smain.c
+-- custom_buildtools # Python toolkit for building
+-- iso/ # Folder for staging ISO contents (auto-generated)
+-- bin/ # Compiled binaries output (auto-generated)
+-- .temp/ # Temporary build objects (auto-generated)
+-- output.iso # Final bootable ISO image (auto-generated)
Run the build script from the project root:
python3 make.py
Option | Description |
---|---|
--only <name> |
Build only a specific target (e.g., setup or boot ) |
--clean |
Clean build output and temporary files before building |
--keep |
Keep the bin/ and .temp/ directories after build (don't clean) |
--no-build |
Skip the build step; only run ISO creation, emulation, etc. |
--iso |
Only generate the ISO image after build |
--debug |
Show detailed compile/link commands and progress |
--minimal |
Move built files instead of copying to reduce duplication |
--all |
Clean, build, create ISO, and run QEMU emulation |
--emul <type> |
Run QEMU with device type: iso , cdrom , fdd , hdd , none |
Example: Clean, build everything, make ISO, and run QEMU emulating a CD-ROM:
python3 make.py --all --emul cdrom
- setup: Main OS setup loader, linked from multiple sources.
- boot: Raw bootloader assembly binary that performs root directory parsing.
Targets are configured inside make.py
with options for first files, raw builds, linker scripts, and ISO paths.
- Python 3.x
- GCC toolchain (
gcc
,g++
) - NASM assembler
- QEMU for emulation/testing
- Provide a simple alternative with improved root directory parsing for better OS setup loading.
- Offer a reliable & easy build system to compile files fast
- Enable easy testing through QEMU emulation.
- Use binary search for a more efficient file search as ISO 9660 directories are alphabetically ordered and keep linear scan as a fallback.
This project is licensed under the GPLv2 license. See to the LICENSE file for more informnataion.
Feel free to contribute improvements or report issues!