Building the kernel requires the following dependencies:
- An i686 toolchain (especially
i686-elf-ld) grub, to create the bootable disk imagelibisoburn, needed to create the ISOmtoolsqemuto run it in QEMU (cargo run)
This section is optional. By default, the kernel will use the configuration in
default.build-config.toml
Before building, one can optionally configure the kernel by copying default.build-config.toml into build-config.toml:
cp default.build-config.toml build-config.tomlThe configuration specifies features to be enabled/disabled in the kernel.
The kernel can be built using the following commands:
cargo build # Debug mode
cargo build --release # Release modeThe default architecture is x86_64. To specify another architecture, add the following parameter to the build command: --target arch/<arch>/<arch>.json, where <arch> is the selected architecture.
The list of available architectures can be retrieved by typing the command:
ls -1 arch/QEMU is the preferred virtual machine to test the kernel.
To install QEMU, type the following command:
Ubuntu/Debian:
apt install qemuArch Linux:
pacman -S qemuA fully built operating system is required to run the system. This system must be present on a raw disk in the file qemu_disk at the root of the repository. The option -drive file=qemu_disk,format=raw is used on QEMU to reference the disk.
The kernel can be run using:
cargo run # Debug mode
cargo run --release # Release modeThe following command runs unit tests in QEMU:
cargo test --libThe documentation of the kernel's interface for modules can be built using:
cargo docThen, it can be accessed at target/<arch>/doc/kernel/index.html, where <arch> is the architecture the kernel has been compiled for.