Skip to content

Repository files navigation

██╗     ███████╗ ██████╗ ███╗   ██╗
██║     ██╔════╝██╔═══██╗████╗  ██║
██║     █████╗  ██║   ██║██╔██╗ ██║
██║     ██╔══╝  ██║   ██║██║╚██╗██║
███████╗███████╗╚██████╔╝██║ ╚████║
╚══════╝╚══════╝ ╚═════╝ ╚═╝  ╚═══╝

▐▀ - ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▌

The Bootloader of [Cudane], a Flicker-Free Replace Written in [Rust], It acquires the [BGRT] motherboard logo and the [GOP] frame buffer without ever calling set_mode, then chainloads any \EFI\*.efi boot entry — its own kernel included — with the screen untouched and zero flicker.

  • [Version]: [0.7.0]

▐▄ - ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▌

Contents

Table of Contents


Overview

Overview

  • Chainloader — every boot entry on the ESP is auto-discovered from \EFI\<vendor>\*.efi and written to \EFI\leon\entries.jsonc; any of them can be chainloaded via LoadImage/StartImage
  • Flicker-free handoff — never calls GOP set_mode, so the graphics hardware is never re-initialized and the firmware logo is never cleared
  • BGRT acquisition — ACPI 2.0 RSDP → XSDT signature walk → BGRT parse with BMP validation
  • GOP frame buffer capture — the current mode's buffer is lifted out untouched
  • Optional gop-ui feature — adds a feature-gated GOP framebuffer renderer scaffold for the bootloader, currently used to draw a placeholder splash before the text-mode menu
  • Boot config — \EFI\leon\boot.toml is written by lbt config set and parsed + validated by the loader at every boot (a broken file yields defaults, never a blocked boot)
  • Geometry record — every boot records the real geometry + resolved config as \EFI\leon\bootinfo.json for host tooling
  • EFI-stub kernel — lbl-kernel is a plain UEFI application that acquires GOP + BGRT itself and never receives a handoff blob
  • Shared ABI — common/ is the single source of truth for the pixel formats, frame buffer geometry, BGRT metadata, and the boot.toml parser
  • Ultra-silent logging — errors go to \var\logs\leon\log.md (capped at 64 KiB), nothing ever touches the screen
  • lbt build tool — discover ESPs and boot entries, author + preview splash themes, run plugins and TUIs (a keyboard-driven boot-manager menu ships as the default), manage the boot config (Python/cps engine is an opt-in cargo feature)
  • Dual architecture — amd64 and arm64 from a single host
  • Five build front-ends — Make, Ninja, Meson, Cargo, and a CMake toolchain, all with auto-detected architecture

Architecture

Architecture

┌──────────────────────────────────────────────────────────────┐
│                      lbl  (chainloader)                      │
│                                                              │
│       ┌──────────┐   ┌──────────┐   ┌────────────────┐       │
│       │   BGRT   │   │   GOP    │   │ boot.toml      │       │
│       │   find   │   │  capture │   │ (shared parser)│       │
│       └────┬─────┘   └────┬─────┘   └────────────────┘       │
│            │              │                                  │
│       ┌────┴─────┐   ┌────┴─────┐   ┌────────────────┐       │
│       │ RSDP →   │   │ current  │   │ discover       │       │
│       │ XSDT →   │   │  mode    │   │ \EFI\*\*.efi → │       │
│       │ BGRT+BMP │   │ (no set_ │   │ entries.jsonc  │       │
│       └──────────┘   │  mode)   │   │ + geometry dump│       │
│                      └──────────┘   └────────────────┘       │
└─────────────────────────────┼────────────────────────────────┘
                              |
                              | menu (optional)
                              │ LoadImage / StartImage
                              │ BootPolicy::BootSelection
                              ▼
┌──────────────────────────────────────────────────────────────┐
│           lbl-kernel  (EFI stub, no handoff blob)            │
│                                                              │
│     acquires GOP + BGRT itself     exit_boot_services()      │
│     validates the memory map       marker + halt             │
└──────────────────────────────────────────────────────────────┘
Component File Purpose
BGRT src/firmware/bgrt.rs ACPI 2.0 RSDP discovery, XSDT walk, BGRT parse, BMP header validation
GOP src/firmware/gop.rs Capture the current mode's frame buffer without set_mode
Boot pipeline src/boot/mod.rs run() — config → discover → record → menu → chainload
Entries src/boot/entries.rs Scan \EFI\<vendor>\*.efi, write \EFI\leon\entries.jsonc (JSONC)
Config src/boot/config.rs Read + validate \EFI\leon\boot.toml (best-effort defaults)
Menu src/boot/menu.rs Optional splash = true menu; boxed/colored frame sized to the text mode, timeout countdown bar, default_entry, any-entry boot
Chainload src/boot/image.rs LoadImage/StartImage of any entry via its device path
Geometry record src/record/dump.rs Write \EFI\leon\bootinfo.json (geometry + resolved config)
Logger src/logger/mod.rs Capped Markdown log, silently dropped on failure
Shared ABI common/src/geometry.rs Framebuffer / Bgrt / PixelFormat structs
Boot config parser common/src/boot_config.rs no_std parser for boot.toml, shared with lbt
Kernel kernel/src/{gop,bgrt,memmap,marker,main}.rs EFI-stub kernel — self-acquires GOP + BGRT, EBS, marker, halt
Build tool lbt/ Host tool — ESP/boot-entry discovery, themes, plugins, boot config

Boot

Boot

1. Capture the GOP frame buffer
   current_mode_info() is queried; set_mode is never called, so the
   graphics hardware is never re-initialized.

2. Locate and validate the BGRT
   ACPI 2.0 RSDP (config table) -> XSDT signature walk -> BGRT parse
   -> BMP header validation (dimensions).

3. Read and validate the boot configuration
   \EFI\leon\boot.toml (written by `lbt config set`) is parsed with the
   shared leon_common::boot_config parser. A missing or broken file
   yields defaults and is logged; it never blocks the boot.

4. Discover boot entries
   Every \EFI\<vendor>\*.efi on the boot volume becomes an entry, written
   as JSONC to \EFI\leon\entries.jsonc.
   Additionally, Leon scans common `/boot` locations (`/boot`, `/boot/efi`,
      `/boot/EFI`) for standalone EFI binaries and EFI-stub kernels. Detection
      is now stricter:
      - `.efi` files are accepted only after verifying a valid PE/COFF header
         (`MZ` DOS header + `PE\0\0` signature).
      - ELF files are considered only if their first 64 KiB include the ASCII
         marker `EFI stub` (case-insensitive), a reliable sign the kernel was
         built with the EFI stub support.
      Files passing these checks are added as candidate boot entries so kernels
      installed to `/boot` are detected even when not present on a mounted ESP.

5. Record the geometry
   The live frame buffer + BGRT geometry and the resolved config are
   written to \EFI\leon\bootinfo.json for host tooling.

6. Choose an entry
   With `splash = true` a menu appears; otherwise (or on timeout) the
   `default_entry` is booted, falling back to the first discovered entry.

7. Chainload
   The chosen image is loaded with LoadImage and started with StartImage
   (BootPolicy::BootSelection), still without touching the screen. The
   EFI-stub kernel then does its own GOP/BGRT acquisition, calls
   exit_boot_services() itself, draws a marker, and halts.

Every step is silent. If any step fails, the error is appended to the log file and the CPU parks in a spin loop — the screen is never touched.


BGRT

BGRT

The Boot Graphics Resource Table is how the firmware tells software where the motherboard logo is on screen and where its raw image lives in memory. Leon only reads it; the logo memory is never touched.

RSDP:   find the ACPI 2.0 GUID entry in the EFI configuration table
        -> verify the 'R' signature -> require revision >= 2

XSDT:   read the XSDT address at RSDP offset 24
        -> scan the 64-bit table pointer array for the "BGRT" signature

BGRT:   parse status, image_type, image_address, offset_x, offset_y

BMP:    validate the "BM" magic at image_address, read width/height/bpp,
        sanity-check against the 16 KiB (16384 px) limits

If the firmware simply has no logo, find() returns None quietly — a perfectly valid silent boot.

Field Type Description
image_address u64 Physical address of the raw BMP logo
offset_x i32 Logo X offset on screen
offset_y i32 Logo Y offset on screen
image_width u32 Logo width in pixels
image_height u32 Logo height in pixels
status u8 BGRT status byte (bit 0 = DISPLAYED)
image_type u8 BGRT image type (0 = bitmap)

The kernel (and the separate splash project) can call bgrt.rect() to get the logo's on-screen bounding box (x0, y0, x1, y1) and position UI elements relative to it.


GOP

GOP

The Graphics Output Protocol provides the frame buffer. The golden rule of a silent handoff is never call set_mode — calling it forces the graphics hardware to re-initialize, blanks the screen, and destroys the firmware logo.

1. find_handles::<GraphicsOutput>()          -> first GOP device
2. open_protocol_exclusive::<GraphicsOutput> -> open it
3. current_mode_info()                       -> resolution, stride, format
4. gop.frame_buffer()                        -> base + size (untouched)

Only the current mode is queried and lifted out. If no GOP device exists or the frame buffer is not usable (e.g. BltOnly with a zero buffer), boot fails silently to the log.

Variant Value Description
Rgbx 0 24-bit RGB, 32-bit stride, last byte unused
Bgrx 1 24-bit BGR, 32-bit stride (most common on UEFI)
Bitmask 2 Custom; color masks describe the layout
BltOnly 3 Not directly drawable; only BLT

Entries

Entries

Leon is a chainloader in the systemd-boot style: it does not hardcode a kernel path, it discovers boot entries on the ESP at every boot.

1. Open the boot volume via the Simple File System protocol
2. Walk the \EFI\ directory: every <vendor>\*.efi becomes an Entry
3. Write them as JSONC to \EFI\leon\entries.jsonc:
   \EFI\leon\kernel.efi           -> the Leon kernel itself
   \EFI\Microsoft\Boot\bootmgfw.efi -> Windows Boot Manager
   \EFI\systemd\systemd-bootx64.efi -> another bootloader
   ...
4. Boot the entry chosen by the menu / default_entry / first

Chainloading is done with the standard UEFI protocol — no manual PE loading:

1. Open the DevicePath protocol on the entry's loaded image device
2. Keep the volume nodes, append the entry's media file path node
3. LoadImage with BootPolicy::BootSelection
4. StartImage — the loaded image runs, the screen is never touched

Because the entries file is written every boot, lbt discover and theme previewing always see what this firmware actually exposes. The kernel at \EFI\leon\kernel.efi is just one of those entries.


Kernel

Kernel

lbl-kernel is a plain UEFI application — an "EFI stub" — built for x86_64-unknown-uefi and aarch64-unknown-uefi with uefi 0.39. It receives no handoff blob; it acquires everything it needs from firmware itself after being chainloaded.

efi_main():                 # #[entry], no arguments in uefi 0.39
  capture_gop()             # current mode, frame buffer untouched
  find_bgrt()               # RSDP -> XSDT -> BGRT -> BMP dimensions
  mask_interrupts()         # cli on x86_64, msr daifset on aarch64
  exit_boot_services()      # MemoryMapOwned, validated before trust
  draw_marker()             # 16x16 px in a corner that avoids the logo
  halt()                    # hlt on x86_64, wfi on aarch64
  • GOP and BGRT acquisition mirrors the bootloader's (the geometry module in common/ is shared), so the stub proves the bootloader's flicker-free handoff end-to-end
  • The memory map returned by exit_boot_services() is validated before anything is trusted: a non-empty map must have a real descriptor pointer, a descriptor size at least size_of::<MemoryDescriptor>, and a total byte range that fits in u64
  • The marker is green (0x2e, 0xcc, 0x71) and is placed by free_corner(), which picks a corner that does not intersect bgrt.rect(); write_pixel() honors the Bgrx / Rgbx byte order
  • The panic handler black-boxes the message and parks the CPU — there is no console

The real kernel maps the physical frame buffer into its own virtual address space without clearing it and hands it to the display pipeline.


Logging

Logging

Nothing is ever printed to the screen. The only place a boot error shows up is the unified log file on the boot volume:

\var\logs\leon\log.md
  • Records are appended, Markdown list style, one line per boot error
  • The file is kept below a hard 64 KiB cap — once a new line would exceed it, the oldest lines are dropped down to a line boundary, so the log stays bounded and always ends with the most recent errors
  • A log that is not valid UTF-8 is discarded and restarted rather than corrupted
  • Directories are created on demand
  • If the log cannot be written (no filesystem, no permission, boot services gone), the error is dropped silently — silence wins over everything
  • The kernel/init chain continues the same file at the same path on the real root filesystem, giving one continuous boot-to-desktop log

Installation

Installation

Leon is a pure-Rust UEFI application pair — a chainloading bootloader and an EFI-stub kernel — installed onto the ESP.

# Stage a bootable ESP tree under build/esp (auto-detects arch)
make stage

# Install onto a mounted ESP (also installs docs/man pages)
make install DESTDIR=/mnt/esp

# Build a FAT16 ESP image (requires mtools) -> build/leon-esp.img
make esp

# Boot under QEMU/OVMF (amd64) or QEMU/AAVMF (arm64)
make qemu

On real hardware the bootloader must use the UEFI-canonical removable-media name — BOOTX64.EFI on amd64, BOOTAA64.EFI on arm64 — so it is found automatically by the firmware. The kernel lives at EFI/leon/kernel.efi and is discovered as a regular boot entry; every other entry on the ESP is chainloadable too.

The bootloader reads its configuration from EFI/leon/boot.toml on the same volume. lbt config set timeout 5 writes the config to ~/.config/leon/boot.toml and mirrors it onto every mounted EFI System Partition, so the next boot picks it up.


Binaries

Binaries

Artifact Architecture Description
target/<uefi-target>/release/lbl.efi amd64 / arm64 Chainloading bootloader PE32+ image
kernel/target/<uefi-target>/release/lbl-kernel.efi amd64 / arm64 EFI-stub kernel PE32+ image
target/<musl-target>/release/lbt host Build tool, python variant (make lbt) — themes, plugins, TUIs
target/lbt-core/<musl-target>/release/lbt host Python-free static-pie variant (make lbt-core)
build/esp/EFI/BOOT/BOOTX64.EFI amd64 Staged, UEFI-canonical boot file
build/esp/EFI/BOOT/BOOTAA64.EFI arm64 Staged, UEFI-canonical boot file
build/esp/EFI/leon/kernel.efi both Kernel as a discovered boot entry
build/leon-esp.img both FAT16 ESP image (make esp)

lbt is a std (host) binary built for the ecosystem target (x86_64/aarch64-unknown-linux-musl) and lives outside the ESP: make stage, make esp, and make qemu build only the bootloader + kernel and never need it (or its cps git dependency). Two variants of the same crate share the binary name lbt but land in separate target dirs — make lbt builds the python variant (themes/plugins/TUIs) into target/, make lbt-core the python-free static-pie variant into target/lbt-core/ — so neither can overwrite the other. Don't run a python-gated subcommand on the lbt-core binary: lbt theme …/lbt plugin …/lbt tui … are only compiled in the python variant and report error: unrecognized subcommand 'theme' on the python-free one.

The python variant ships a default, keyboard-driven boot-manager TUI — lbt/tuis/leon_menu.py, embedded in the binary and materialized to ~/.config/leon/tuis/ on first use. lbt tui (or lbt tui run) launches it against the configured default (falling back to the shipped menu); lbt tui run <name> launches a registered TUI; lbt tui list lists registrations from t.desc; lbt tui apply <name> persists a TUI as the default in ~/.config/leon/python.toml. The menu is pure stdlib (no curses), uses the full keymap (arrows/hjkl, PgUp/PgDn, Home/End, 1-9/0, / search, n/N, Tab/Shift+Tab, resize, Enter/space boot preview, q/Esc/Ctrl+C quit), and receives live framebuffer + BGRT geometry, discovered boot entries, and the boot config through LEON_* environment variables.

Release profile:

[profile.release]
panic = "abort"      # No unwinding
lto = true           # Link-time optimization
opt-level = "z"      # Optimize for size
codegen-units = 1    # Single codegen unit
strip = true         # Strip debug symbols

Building

Building

Leon ships five build front-ends. All of them auto-detect amd64/arm64 from the host and select the correct UEFI target. No external clang/lld is required — the rust-lld bundled with rustup links the UEFI targets.

ARCH UEFI target Boot file QEMU
amd64 x86_64-unknown-uefi BOOTX64.EFI qemu-system-x86_64 + OVMF
arm64 aarch64-unknown-uefi BOOTAA64.EFI qemu-system-aarch64 + AAVMF

Both the bootloader and the kernel target the same UEFI target for a given architecture.

Rust targets:

rustup target add x86_64-unknown-uefi
rustup target add aarch64-unknown-uefi
rustup target add x86_64-unknown-linux-musl   # host `lbt`
rustup target add aarch64-unknown-linux-musl  # host `lbt`

The bootloader and kernel are UEFI applications (*-unknown-uefi); the host tool lbt follows the ecosystem convention (*-unknown-linux-musl, /system prefix, clang/llvm). make lbt links against a static musl CPython that make python provisions (musl + CPython 3.14 built from source into $(PREFIX), /system by default). The python-free lbt-core target has no such requirement.

Make

make build                    # bootloader + kernel + lbt (python), auto arch
make python                   # provision static musl CPython into $(PREFIX)
make install-pyo3-config      # install lbt/pyo3-musl-config.toml to /etc/lbt
make lbt-core                 # python-free lbt only (no CPython needed)
make stage                    # ESP tree at build/esp (bootloader + kernel only)
make install DESTDIR=/mnt/esp # staged install onto a mounted ESP
make ARCH=arm64 build         # cross-build for arm64
make test                     # generic host tests (workspace, default features)
make clippy                   # lint everything with -D warnings
make qemu                     # boot under QEMU/OVMF or AAVMF
make esp                      # FAT16 ESP image (mtools)
make clean

make build/make lbt compile lbt too. lbt: cps-update python, so each run first fetches cps (a git dependency pinned in Cargo.lock) into $HOME/.cargo/git/cps (clone if missing, then fetch origin + checkout of CPS_REF) and provisions the static musl CPython via scripts/build_python.sh into $(PREFIX) (/system by default; no-op when $(PREFIX)/lib/libpython3.14.a already exists). Both lbt variants honor PROFILE (default release, the same profile the bootloader and kernel build). make stage/install/esp/qemu deliberately skip lbt and only produce the ESP tree.

The pyo3 build config for the shared cps tooling is committed at lbt/pyo3-musl-config.toml (the same keys scripts/build_python.sh resolves — a static, shared-free CPython 3.14). To ensure consistent musl builds the committed and installed TOML now sets build_flags=-C target-feature=+crt-static so cargo/pyo3 links with a static CRT. make install-pyo3-config (also part of make install) copies it to /etc/lbt/pyo3-musl-config.toml, the system-wide location cps searches, DESTDIR-aware so it stages cleanly.

Variable Default Description
ARCH host (amd64/arm64) Override the target architecture
PROFILE release Cargo profile
DESTDIR Staged install root
PREFIX /system Install prefix
SYSROOT / Build root (the actual root, never a rootfs dir)
CPS_DIR $HOME/.cargo/git/cps Seed clone for the cps git dependency (CPS_REF pins the rev)
PY_PREFIX $(PREFIX) Prefix the static musl CPython is provisioned into
PY_DESTDIR Staging root for the provisioned CPython (when PY_PREFIX isn't writable); PYO3_CONFIG derives from $(PY_DESTDIR)$(PY_PREFIX)

Ninja

ninja -f build.ninja                    # build + stage ESP tree under builddir/
ninja -f build.ninja builddir/install   # copy the staged tree to builddir/install

Ninja has no -D override; edit DESTDIR/PREFIX at the top of build.ninja to target another root.

Meson

./gen-cross.sh                              # generate cross.txt for host arch
meson setup builddir --cross-file cross.txt
meson compile -C builddir                   # lbl.efi + lbl-kernel.efi + lbt
meson install -C builddir

The Meson lbt target is a host cargo build for the musl target (plus lbt-core for the python-free variant); like the Makefile it pulls cps in as a git dependency, so the machine needs network (or the same cargo git rewrite).

Cargo (direct)

cargo build --target x86_64-unknown-uefi --release
cargo build --target aarch64-unknown-uefi --release

CMake toolchain

cmake -B build -DCMAKE_TOOLCHAIN_FILE=toolchain.cmake -DCMAKE_SYSTEM_NAME=Generic

The CMake file performs the same arch detection and exposes LEON_UEFI_TARGET for any future C component. pkgconfig.sh is a passthrough exposing the unified /system convention (PKG_CONFIG_SYSROOT_DIR=/, PKG_CONFIG_LIBDIR=/system/lib/pkgconfig) — Leon itself has no C dependencies.


Filesystem

Filesystem

EFI/
├── BOOT/
│   ├── BOOTX64.EFI        # lbl chainloader (amd64)
│   └── BOOTAA64.EFI       # lbl chainloader (arm64)
└── leon/
    ├── kernel.efi         # EFI-stub kernel (a discovered boot entry)
    ├── boot.toml          # boot config (written by `lbt config set`)
    ├── entries.jsonc      # discovered boot entries (written every boot)
    └── bootinfo.json      # geometry + resolved config record (every boot)

var/
└── logs/
    └── leon/
        └── log.md         # unified boot log (Markdown, capped at 64 KiB)

The bootloader cannot reach the installed OS's real /var/logs before the kernel boots, so the log is written to the ESP and continued by the kernel/init chain on the real root filesystem.


Testing

Testing

# Lint everything (bootloader + kernel + lbt, both feature modes)
make clippy
make ARCH=arm64 clippy

# Cargo, all targets, deny warnings
cargo clippy --all-targets --target x86_64-unknown-uefi -- -D warnings
cargo clippy --all-targets --target aarch64-unknown-uefi -- -D warnings

# Host-side unit tests
cargo test -p lbt            # CLI, discovery, geometry, boot-config parity
cargo test -p lbt --features python
cargo test -p leon-common    # the shared no_std boot.toml parser

# Format check
cargo fmt --check

The lbt test suite includes a parity test that feeds everything lbt config set serializes through the bootloader's own leon_common::boot_config parser, so the host-written file and the loader's reader can never drift apart — including the single-quoted TOML literal strings the serializer emits for backslash-heavy paths like \EFI\leon\entries.jsonc.

Runtime verification:

Method Command What it verifies
QEMU/OVMF make qemu Silent chainload to the kernel marker under emulation
QEMU/AAVMF make ARCH=arm64 qemu The same on arm64
Real hardware make install DESTDIR=/mnt/esp Firmware logo preserved end-to-end

Structure

Structure

Leon/
├── Cargo.toml              # Workspace (lbl v0.7.0, edition 2024)
├── LICENSE                 # MIT License
├── PROMPT.md               # Design blueprint
├── README.md               # This documentation
├── t.desc                  # Shipped cps descriptor (registers the default TUI)
├── common/
│   └── src/
│       ├── lib.rs          # Re-exports the shared ABI
│       ├── geometry.rs     # Framebuffer / Bgrt / PixelFormat shared ABI
│       └── boot_config.rs  # Shared no_std parser for \EFI\leon\boot.toml
├── lbt/
│   ├── Cargo.toml          # Leon Build Tool (host, std; `python` feature)
│   ├── pyo3-musl-config.toml  # Committed pyo3 config, installed to /etc/lbt
│   ├── tuis/
│   │   └── leon_menu.py    # Default keyboard-driven boot-manager TUI (embedded)
│   └── src/
│       ├── main.rs         # Slim entry: clap -> Command dispatch
│       ├── cli.rs          # info / discover / theme / plugin / config / tui
│       ├── discovery.rs    # ESP + boot-entry discovery (lsblk / mount table)
│       ├── geometry.rs     # Geometry + sysfs/BMP/dump parsing (host mirror)
│       ├── boot_config.rs  # Host boot.toml model + sync to mounted ESPs
│       ├── python.rs       # ~/.config/leon/python.toml + cps engine init
│       └── commands/       # info / discover / theme / plugin / config / tui
├── src/
│   ├── main.rs             # Module wiring + uefi_main
│   ├── boot/
│   │   ├── mod.rs          # run(): config -> discover -> record -> menu -> chainload
│   │   ├── config.rs       # Read + validate \EFI\leon\boot.toml
│   │   ├── entries.rs      # \EFI\*.efi discovery -> entries.jsonc (JSONC)
│   │   ├── image.rs        # LoadImage / StartImage chainloading
│   │   └── menu.rs         # Optional splash menu (boxed, colored, countdown bar)
│   ├── firmware/
│   │   ├── bgrt.rs         # ACPI RSDP/XSDT/BGRT + BMP dimensions
│   │   └── gop.rs          # Frame buffer capture (no set_mode)
│   ├── record/
│   │   ├── mod.rs          # Geometry record module
│   │   └── dump.rs         # Writes \EFI\leon\bootinfo.json
│   └── logger/
│       └── mod.rs          # Silent, capped Markdown logger
├── kernel/
│   ├── Cargo.toml          # lbl-kernel v0.7.0 (uefi 0.39, EFI stub)
│   ├── .cargo/config.toml  # Per-target rustflags (x86-64-v3 / generic)
│   └── src/
│       ├── main.rs         # EFI-stub kernel entry
│       ├── gop.rs          # GOP capture (mirrors bootloader)
│       ├── bgrt.rs         # BGRT discovery (mirrors bootloader)
│       ├── memmap.rs       # Memory map validation after EBS
│       └── marker.rs       # Green marker + free_corner(), honors Bgrx/Rgbx
├── docs/
│   ├── lbt.1               # Man page for the build tool
│   ├── lbl.1               # Man page for the bootloader
│   └── leon-common.7       # Man page for the shared ABI + boot config
├── Makefile / env.mk       # Make front-end (auto arch; UEFI + musl)
├── build.ninja             # Ninja front-end
├── meson.build             # Meson front-end (lbl.efi + lbl-kernel.efi + lbt)
├── gen-cross.sh / cross.txt# Meson cross-file generator
├── toolchain.cmake         # CMake arch detection
├── pkgconfig.sh            # /system pkg-config passthrough (no C deps)
├── .cargo/config.toml      # Per-target rustflags (rust-lld)
└── scripts/
    ├── run_qemu.sh         # QEMU/OVMF or QEMU/AAVMF boot
    └── make_esp.sh         # FAT16 ESP image (mtools)

Dependencies

Dependencies

Crate Version Purpose
uefi 0.39 Boot services, GOP, config tables, Simple File System, LoadImage/StartImage, global allocator (bootloader + kernel)
leon-common 0.7.0 Shared Framebuffer/Bgrt/PixelFormat ABI + the boot.toml parser (workspace)
cps git (rev pinned in Cargo.lock) Theme/plugin engine used by lbt, gated behind the opt-in python feature
pyo3 Python bindings for cps, also gated behind the python feature
clap / anyhow / toml / serde_json lbt CLI, config serialization, and JSON output

The bootloader depends only on uefi and leon-common. The kernel depends on uefi and leon-common (default-features = false, keeping the boot.toml parser which needs alloc out of its code). lbt's python feature is opt-in: cargo build -p lbt links zero Python/pyo3 code, while make build and make clippy build the full tool.


Contributing

Contributing

Leon on [[GitHub]]. Issues and pull requests are welcome.

git clone https://github.com/Mapuse/Leon.git
cd Leon
make build
make clippy

Follow existing code style. No comments unless requested. Silence rules apply: the bootloader never prints to the screen, and every failure path must route through the log file.


Credits

[Leon] is part of the [Cudane] ecosystem.

  • [Cudane] — The Distribution.
  • [Cesar] — The Init System.
  • [MCX] — Package Manager.

License

MIT License ─ See [LICENSE] for More Details.

About

The Bootloader of Cudane, a Flicker-Free Bootloader That Configurable For Any Machine.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages