All Projects → rust-osdev → Bootimage

rust-osdev / Bootimage

Licence: other
Tool to create bootable disk images from a Rust OS kernel.

Programming Languages

rust
11053 projects

Labels

Projects that are alternatives of or similar to Bootimage

homebrew-i386-elf-toolchain
Homebrew formulas for buildling a valid GCC toolchain for the i386-elf target.
Stars: ✭ 62 (-80.69%)
Mutual labels:  osdev
pedigree
The Pedigree Operating System
Stars: ✭ 48 (-85.05%)
Mutual labels:  osdev
ucore
uCore Operating System Lab
Stars: ✭ 30 (-90.65%)
Mutual labels:  osdev
KnutOS
An x86_64 hobbyist OS written in C and Assembly
Stars: ✭ 16 (-95.02%)
Mutual labels:  osdev
utero
The Operating System (for x86_64) written in Crystal as much as possible
Stars: ✭ 55 (-82.87%)
Mutual labels:  osdev
nightingale
A small operating system where I experiment and learn osdev.
Stars: ✭ 86 (-73.21%)
Mutual labels:  osdev
poplar
Microkernel and userspace written in Rust exploring modern ideas
Stars: ✭ 217 (-32.4%)
Mutual labels:  osdev
Halt
OS where everything is immutable! (Experimental)
Stars: ✭ 265 (-17.45%)
Mutual labels:  osdev
Sigma
Abandoned overcomplicated Microkernel using modern x86_64 features
Stars: ✭ 36 (-88.79%)
Mutual labels:  osdev
RocketOS
RocketOS is a Unix based OS that uses legacy BIOS and GRUB and is written in C17. It is being developed for educational purposes primarily, but it still is a serious project. It is currently in its infancy.
Stars: ✭ 23 (-92.83%)
Mutual labels:  osdev
barebones
Barebones multiboot kernel for beginners
Stars: ✭ 126 (-60.75%)
Mutual labels:  osdev
SanderOSUSB
32 bit singletasking C kernel
Stars: ✭ 52 (-83.8%)
Mutual labels:  osdev
MandelbrotOS
A community driven OS by the youth
Stars: ✭ 172 (-46.42%)
Mutual labels:  osdev
yuzaos
An operating system written in C++, MSVC
Stars: ✭ 23 (-92.83%)
Mutual labels:  osdev
octox
xv6-riscv like OS written in Rust
Stars: ✭ 18 (-94.39%)
Mutual labels:  osdev
stoomboot
An x86 real mode multiboot-ish ELF bootloader
Stars: ✭ 19 (-94.08%)
Mutual labels:  osdev
Fukuro
Simple microkernel (early stage)
Stars: ✭ 18 (-94.39%)
Mutual labels:  osdev
Rusty Hermit
RustyHermit - A Rust-based, lightweight unikernel
Stars: ✭ 268 (-16.51%)
Mutual labels:  osdev
LudOS
A toy monolithic kernel written in C++
Stars: ✭ 38 (-88.16%)
Mutual labels:  osdev
Einherjar
colorForth computing environment for amd64 and PowerPC Macs.
Stars: ✭ 20 (-93.77%)
Mutual labels:  osdev

bootimage

Creates a bootable disk image from a Rust OS kernel.

Installation

> cargo install bootimage

Usage

First you need to add a dependency on the bootloader crate:

# in your Cargo.toml

[dependencies]
bootloader = "0.6.4"

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.

Building

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.

Running

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.

Testing

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

Configuration is done through a through a [package.metadata.bootimage] table in the Cargo.toml of your kernel. The following options are available:

[package.metadata.bootimage]
# The cargo subcommand that will be used for building the kernel.
#
# For building using the `cargo-xbuild` crate, set this to `xbuild`.
build-command = ["build"]
# The command invoked with the created bootimage (the "{}" will be replaced
# with the path to the bootable disk image)
# Applies to `bootimage run` and `bootimage runner`
run-command = ["qemu-system-x86_64", "-drive", "format=raw,file={}"]

# Additional arguments passed to the run command for non-test executables
# Applies to `bootimage run` and `bootimage runner`
run-args = []

# Additional arguments passed to the run command for test executables
# Applies to `bootimage runner`
test-args = []

# An exit code that should be considered as success for test executables
test-success-exit-code = {integer}

# The timeout for running a test through `bootimage test` or `bootimage runner` (in seconds)
test-timeout = 300

# Whether the `-no-reboot` flag should be passed to test executables
test-no-reboot = true

License

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].