#x86-64 #kernel #qemu #no-std #image

no-std app cargo-image

Create qemu bootable x86_64 OS images

4 releases (2 breaking)

0.4.0 Aug 31, 2019
0.3.0 Aug 26, 2019
0.2.1 Aug 26, 2019
0.2.0 Dec 25, 2018
0.1.0 Dec 25, 2018

#76 in #qemu

MIT/Apache

12KB
195 lines

Cargo-image

Crates.io maintenance-as-is

An alternative to bootimage using cargo-sysroot.

The advantage of cargo-sysroot is that it's composable, eg other tools will work with it, even if they don't know about it, because it sets up cargo so that the normal commands like cargo build will work.

Like bootimage, this tool will combine your kernel with the x86_64 bootloader crate, so you can, well, boot it.

Usage

In your project directory, simply run cargo image.

The output image will be located at target/{your-triple}/debug/{your-binary-name}.bin. Your binary name will usually be the name of your project.

Details

The bootloader sysroot crates are compiled using cargo sysroot, and cargo sysroot will be called before building your kernel, to ensure everything is up to date.

Prerequisite

  • A nightly compiler.
  • A .cargo/config setup to build your target.
  • cargo-sysroot v0.6.0 or later.
  • bootloader v0.8.0 or later. Older versions are untested and probably won't work.
  • The llvm-tools-preview component via rustup.

Limitations

  • No attempt is made to follow the .cargo/config search path, eg this tool will not look in the parent directory like cargo would.

FAQ

  • Q: What about bootimage?
  • A: 🤷. It didn't work for my needs, so I wrote my own.

License

Licensed under either of

at your option.

Contribution

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.

Dependencies

~3–4MB
~72K SLoC