Skip to content

Latest commit

 

History

History
75 lines (44 loc) · 1.64 KB

README.md

File metadata and controls

75 lines (44 loc) · 1.64 KB

Kernel

Build

The configuration file located at build-config.toml allows to specify which features have to be enabled in the kernel.

A default configuration is available in the file default.build-config.toml. If build-config.toml does not exist, the default configuration is used instead.

The kernel can be built using the following commands:

cargo build               # Debug mode
cargo build --release     # Release mode

The default architecture is x86. 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/

Run

With QEMU

QEMU is the preferred virtual machine to test the kernel.

To install QEMU, type the following command:

Ubuntu/Debian:

apt install qemu

Arch Linux:

pacman -S qemu

A 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 mode

Run unit tests

The following command runs unit tests in QEMU:

cargo test --lib

Documentation

The documentation of the kernel's interface for modules can be built using:

cargo doc

Then, it can be accessed at target/<arch>/doc/kernel/index.html, where <arch> is the architecture the kernel has been compiled for.