A minimal os to showcase the usage of bootloader.
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"]
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.
Install dependencies:
$ sudo apt update && sudo apt install qemu-system-x86Build:
$ cargo buildRun:
$ cargo run bios$ cargo run uefi