basic-os

April 5, 2026 ยท View on GitHub

A minimal os to showcase the usage of bootloader.

Overview

The top level basic crate defines a workspace.

  • The kernel crate is a member of that workspace
    # in Cargo.toml
    [workspace]
    members = ["kernel"]
    
  • An artifact dependency is used add the kernel crate as a build-dependency:
    # in Cargo.toml
    [build-dependencies]
    kernel = { path = "kernel", artifact = "bin", target = "x86_64-unknown-none" }
    
    Enable the unstable artifact-dependencies feature:
    # .cargo/config.toml
    [unstable]
    bindeps = true
    
    Experimental features are only available on the nightly channel:
    # rust-toolchain.toml
    [toolchain]
    channel = "nightly"
    components = ["llvm-tools"]
    targets = ["x86_64-unknown-none", "x86_64-unknown-uefi"]
    

The basic create combines the kernel with bootloader, creates a bootable disk image and launches them.

See also basic-kernel.md in the kernel subdirectory.

Usage

Install dependencies:

$ sudo apt update && sudo apt install qemu-system-x86

Build:

$ cargo build

Run:

$ cargo run bios
$ cargo run uefi