Skip to content

UnbreakableMJ/Zamak

Repository files navigation

Zamak Bootloader

License Rust

Zamak is a modern, high-performance bootloader written in Rust for x86_64 systems. Designed for reliability and simplicity, Zamak provides a Limine-compatible interface while supporting both UEFI and Legacy BIOS boot flows.

🚀 Features

  • Dual-Mode Booting: Seamless support for modern UEFI firmware and Legacy BIOS (MBR), including a hybrid boot image capability.
  • Symmetric Multiprocessing (SMP): Full implementation of the Limine SMP protocol. Discovery of secondary cores (APs) via MADT (BIOS) or MP Services (UEFI) and transitioning them to 64-bit Long Mode.
  • Limine Protocol: Implements the Limine boot protocol, providing kernels with memory maps, resolution-aware framebuffers, ACPI/SMBIOS pointers, and Higher Half Direct Mapping (HHDM).
  • Module Support: Load auxiliary files (like initramfs) from disk and pass them to the kernel.
  • FAT32 Support: Built-in read-only FAT32 driver for locating kernels and configuration files across directory hierarchies.
  • ELF64 Loader: Robust parsing and loading of 64-bit ELF kernel segments with protocol fulfillment directly in the loaded image.
  • Rust Powered: Leverage Rust's safety and modern tooling for low-level systems code, moving towards a "pure Rust" implementation.

📂 Project Structure

  • zamak-loader/: The UEFI entry point (zamak.efi).
  • zamak-bios/: The BIOS-specific Stage 1 (MBR) and Stage 2 (Rust) loaders.
  • libzamak/: Shared no_std library for protocol handling, ELF parsing, and configuration logic.

🛠 Building

Prerequisites

  • Rust Nightly
  • nasm (for BIOS Stage 1)
  • objcopy (binary generation)

Build UEFI Loader

cargo build -p zamak-loader --release

Build BIOS Image

make -f Makefile.bios clean all

This generates zamak_bios.img, a 1MB bootable disk image.

📝 Configuration

Zamak looks for a zamak.conf file on the boot volume. Example configuration:

TIMEOUT=5

:Zamak OS
    PROTOCOL=limine
    KERNEL_PATH=/boot/kernel
    CMDLINE=some_kernel_parameter=1

⚖️ License

Zamak is licensed under the GPL-3.0-or-later license. See LICENSE for details.


Zamak is a work in progress. Contributions and feedback are welcome!

About

Limine-compatible bootloader written in Rust

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors