To run the kernel, you need to have the following dependencies installed:
qemu
xorriso
rustc
andcargo
- You need to have the
x86_64-unknown-none
target installed, and nightly rust.rustup override set nightly rustup target add x86_64-unknown-none # This isn't strictly necessary, but it's a good idea to update installed toolchains rustup update
- You need to have the
Then, you can run the kernel with the following command from the root of the repository:
cargo run --bin bios_boot
The project is split into several crates:
kbuild
: A library for building the kernel. Used in build.rs and the test runner.kernel
: The main kernel crate.kproc
: Various procedural macros used in the kernel. Currently only contains thetest
macro.kerial
: A qemu serial driver for the kernel. Used for debugging.
Some other folders that appear in the root of the repository:
boot_cfg
: Configuration files for limine.boot_images
: ISO images generated by the build process.output
: Files generated bykserial
commands.tools
: Various python scripts used for debugging. Both scripts are currently old and unused.
All debugging is done through environment variables. The following environment variables are supported:
DEBUG
: If set, QEMU will wait for a debugger to attach on port 1234.QEMU_FLAGS
: Additional flags to pass to QEMU.VERBOSE
: Shows QEMU's invocation command.NO_DISPLAY
: Disables the graphical display in QEMU.KERNEL_MEM
: Sets the amount of memory to allocate for the kernel in QEMU.ISO
: Override the iso file to boot from.NO_EXIT
: Prevents QEMU from exiting after the kernel exits.REBUILD
: Forces a rebuild of the test binary. This will have no effect on the kernel itself, as the kernel is not build at runtime.
ALLOC_DEBUG
: If set, will print out information about memory allocations and deallocations.REINSTALL_LIMINE
: If set, limine will be re-downloaded from it's git repository and reinstalled.ARTIFACT_DIR
: The directory to store build artifacts in.- TODO: Rename this to
BUILD_DIR
or something.
- TODO: Rename this to
LIMINE_CONFIG
: The path to the limine configuration file.ISO_NAME
: The name of the ISO file to generate.ISO_ROOT
: The directory to store ISO files in.