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
kernelcrate is a member of that workspace# in Cargo.toml [workspace] members = ["kernel"] - An artifact dependency is used add the
kernelcrate as abuild-dependency:
Enable the unstable artifact-dependencies feature:# in Cargo.toml [build-dependencies] kernel = { path = "kernel", artifact = "bin", target = "x86_64-unknown-none" }
Experimental features are only available on the nightly channel:# .cargo/config.toml [unstable] bindeps = true# 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.
- A cargo build script is used to create a bootable disk image (
build.rs). basiclaunches the images in QEMU.
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