Tool to create bootable disk images from a Rust OS kernel.
Tool to create bootable disk images from a Rust OS kernel.
Creates a bootable disk image from a Rust OS kernel.
> cargo install bootimageFirst you need to add a dependency on the bootloader crate:
# in your Cargo.toml
[dependencies]
bootloader = "0.9.8"Note: At least bootloader version 0.5.1 is required since bootimage 0.7.0. For earlier bootloader versions, use bootimage 0.6.6.
If you want to use a custom bootloader with a different name, you can use Cargo's rename functionality.
Now you can build the kernel project and create a bootable disk image from it by running:
cargo bootimage --target your_custom_target.json [other_args]The command will invoke cargo build, forwarding all passed options. Then it will build the specified bootloader together with the kernel to create a bootable disk image.
To run your kernel in QEMU, you can set a bootimage runner as a custom runner in a .cargo/config file:
[target.'cfg(target_os = "none")']
runner = "bootimage runner"Then you can run your kernel through:
cargo xrun --target your_custom_target.json [other_args] -- [qemu args]All arguments after -- are passed to QEMU. If you want to use a custom run command, see the Configuration section below.
The bootimage has built-in support for running unit and integration tests of your kernel. For this, you need to use the custom_tests_framework feature of Rust as described here.
Configuration is done through a [package.metadata.bootimage] table in the Cargo.toml of your kernel. The following options are available:
…Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
No open issues yet, or sync has not completed.