A hobby x86_64 operating system written in Rust, featuring a UEFI bootloader, an async kernel, a custom build system, and much more to come.
This is the 5th iteration of HeliumOS, hence the name.
Developer documentation: pentos.yarml.com
- Dependencies
- Building
- Running in QEMU
- Creating Disk Images
- Building the Documentation
- Build Configuration
- Runtime Configuration
- Acknowledgements
The following tools must be installed manually before building:
cargo/rustupnasmmake
| Tool | Purpose |
|---|---|
qemu-system-x86_64 |
Required for quickly running PentOS on a VM (make run-* & make debug). |
gdb, tmux, & socat |
Required for debugging the kernel (alongside Qemu) (make debug). |
mtools, e2fsprogs, & sfdisk |
Required to create raw .img disk images (make img-*). |
VBoxManage |
Required to convert images to .vmdk or .iso format (make vmdk-* / make iso-*). |
PentOS depends on other tools, but those not listed above are autmatically managed by the build system itself.
A comprehensive list of all build dependencies can be found in (Cargo.toml).
Additionally OVMF is downloaded and managed automatically by the build system the first time you run make.
Run make once to bootstrap the build system and download OVMF:
make# Debug build
make build-bootloader-debug
make build-kernel-debug
make build-userbin-debug
# Release build
make build-bootloader-release
make build-userbin-releaseOutput locations:
- Bootloader:
target/uefi/{debug,release}/bootloader.efi - Kernel:
target/kernel/{debug,release}/kernel - user binaries
target/user/{debug,release}/*
These targets build everything automatically before launching QEMU.
# Run release build
make run
# Run debug build (no debugger attached)
make run-debug
# Run debug build with GDB + tmux (attaches GDB and a QEMU monitor)
make debugThe configuration Qemu uses for these commands can be found at the root Cargo.toml. The defaults are:
- 12 SMP Cores
- 8GB of RAM
- Resolution set to 1920x1080
These will create normal directories containing the system
make flat-release # run/release/flat
make flat-debug # run/debug/flatRequires mtools and parted.
make img-release # run/release/pentos.img
make img-debug # run/debug/pentos.imgRequires VBoxManage. Depends on the .img targets above.
make vmdk-release # run/release/pentos.vmdk
make vmdk-debug # run/debug/pentos.vmdkRequires VBoxManage. Also depends on the .img targets.
make iso-release # run/release/pentos.iso
make iso-debug # run/debug/pentos.isomake docThis generates rustdoc for the entire workspace under target/doc/. An index.html redirect to the pentos root crate is written automatically.
The hosted version of the developer documentation is available at pentos.yarml.com.
The following settings in the root Cargo.toml under [workspace.metadata.chef] control build-time behaviour:
| Key | Default | Description |
|---|---|---|
ovmf-version |
edk2-stable202511-r1 |
Version of the OVMF firmware to download. |
ovmf-source-template |
GitHub release URL | URL template used to fetch the OVMF tarball ($$ is replaced by the version string). |
ovmf-varsfd-path-template |
$$-bin/x64/vars.fd |
Path inside the tarball for the VARS firmware volume ($$ is replaced by the version string). |
ovmf-codefd-path-template |
$$-bin/x64/code.fd |
Path inside the tarball for the CODE firmware volume ($$ is replaced by the version string). |
install-bootloader |
/boot/efi/pentos.efi |
Destination used by make install for the bootloader EFI binary. |
install-kernel |
/boot/efi/pentos.kernel |
Destination used by make install for the kernel ELF binary. |
qemu-numcores |
12 |
Number of SMP cores used by Qemu. |
qemu-mem |
8G |
Amount of memory allocated to Qemu VM. |
qemu-resolution |
1920x1080 |
Maximm resolution supported by the Qemu VM. |
Kernel behaviour is controlled by compile-time constants in the config crate (config/src/). The crate is organised into modules:
config::topology— hardware topology limits (e.g. maximum number of supported CPUs, interrupt controllers, and stack sizes per hart).config::task— async executor limits (e.g. maximum number of concurrent urgent tasks).config::dev— device driver settings (e.g. PS/2 keyboard retry limits and event queue sizes).
As an example, config/src/topology/hart.rs exposes MAX_HART_COUNT (default 16), which determines the maximum number of CPU cores the OS will boot. The OS will panic at startup if more cores are detected than this constant allows.
Changing any constant in the config crate requires a rebuild of the kernel & bootloader.
The following libraries were not taken as direct Cargo dependencies, but code or design from them was copied and adapted into this repository:
- spin (MIT) - The
lib/spinlockscrate is heavily inspired by and contains code adapted fromspin. It providesSpinMutex,SpinRwLock, andSpinOnceprimitives tailored to the kernel environment. - futures (MIT/Apache-2.0) - The async stream in
system/klib/src/task/stream.rsin addition to other system in the future probably
PentOS is licensed under the GNU General Public License v3.0 or later.