
no_std Rust framekernel OS for x86_64 and aarch64 with hardware-isolated Ring-0 protection domains, capability-based security, and Linux ABI compatibility.
A framekernel with first-class Linux compatibility.
Not Another Rust Frame Kernel is a no_std Rust operating system
for x86_64 and aarch64. NARF combines a small Ring-0 trusted computing
base (TCB) with a kernel organized into protection domains, then
exposes both a native interface and a Linux-compatible userspace
interface. The goal is to contain kernel faults without giving up the
shared-memory performance of a monolithic kernel or the software
ecosystem built around the Linux ABI.
GPL-2.0-or-later. See LICENSE.
A framekernel is a kernel architecture in which a small trusted core — the frame — establishes the system's protection rules, while the rest of the kernel runs in hardware-isolated domains. The frame handles the operations that must be globally trusted: bootstrapping the machine, entering and leaving protection domains, dispatching traps, scheduling work, and managing memory protection.
A framekernel occupies a middle ground between familiar kernel models:
| Model | Where kernel services run | What must be trusted |
|---|---|---|
| Monolithic kernel | One privileged address space | The whole kernel, including every in-kernel driver |
| Microkernel | Separate user processes and address spaces | A small kernel; service calls cross address-space boundaries |
| Framekernel | One privileged address space split into hardware-enforced domains | The frame; isolated services remain outside the TCB |
Sharing an address space preserves direct calls and shared-memory data paths. Hardware domains prevent “runs in Ring 0” from meaning “may read or overwrite the entire kernel.” The result is a small security boundary without requiring a process and page-table switch for every kernel service.
NARF's frame consists of frame/, the memory domain manager, the
capability core, and the executor core; security-model/ defines that
trusted boundary. Drivers and other kernel subsystems execute at Ring
0 / EL1. On the x86_64 backends, domain protection prevents them from
freely accessing the frame or one another; the aarch64 design applies
the same boundary with MTE tags.
NARF turns that architecture into a complete system with three connected mechanisms:
Domain backends. NARF defines up to 16 protection domains. On
x86_64, boot-time feature detection selects PKS on supported
Intel systems or PCID-tagged page tables on AMD and older Intel
systems. The aarch64 design maps the same contract to MTE tags.
See
docs/DOMAIN_BACKENDS.md.
The async executor is the scheduler. Syscalls, IRQ work, and
driver tasks are a mix of stackless Rust Futures and stackful tasks.
Direct context transfer lets a caller donate its remaining time slice
to a callee, avoiding a second scheduling round trip.
Narf-Ring carries data across boundaries. Shared-memory rings transfer ownership of buffers instead of copying their bytes. The domain system constrains access, and the executor wakes the receiving task.
Linux compatibility is a supported userspace contract, not an
afterthought or a claim that NARF is internally Linux. NARF implements
a growing Linux ABI surface directly on its native process, VFS,
networking, device, and async primitives. That surface
includes Linux syscall numbers and semantics, dynamic ELF loading for
musl, familiar interfaces such as epoll/eventfd/timerfd, and Linux
device ABIs including fbdev, evdev, uinput, and DRM/KMS. Composable
container and cgroup personalities add namespaces and the cgroup-v2
hierarchy.
This compatibility is delivered as the composable linux-compat
personality and is enabled by default in the userspace crate. A
NARF-native build can omit it with --no-default-features, and CI
checks the native, Linux-compatible, container, and cgroup feature
combinations independently.
The important boundary is deliberate: Linux programs see the ABI they
expect, while NARF retains isolated kernel domains and an async-first
implementation underneath. See
docs/PERSONAS.md for feature composition and
docs/DESKTOP_LINUX_PLAN.md for the
end-to-end compatibility track.
Prebuilt native packages are the recommended installation path and do not require a Rust toolchain. Download the package for your distribution from a NARF release, then install it with the distribution's package manager:
VERSION=0.5.0
# Debian or Ubuntu
sudo apt install "./narf-kernel_${VERSION}_amd64.deb"
# Fedora or another RPM-based distribution
sudo dnf install ./narf-kernel-${VERSION}-*.x86_64.rpm
# Arch Linux
sudo pacman -U "./narf-kernel-${VERSION}-1-x86_64.pkg.tar.zst"
Packages are produced for x86_64/amd64 and aarch64/arm64. Each installs a
versioned kernel in /boot and an isolated UEFI
payload on the mounted EFI System Partition. It integrates with UEFI GRUB,
systemd-boot/BLS, rEFInd, and CachyOS Limine; the GRUB generator retains a
direct Multiboot2 path for legacy BIOS. Run sudo narf-uefi status before
rebooting. Keep your distribution kernel installed and configured as the
default until you have validated NARF on the machine.
To build and install a native package from a NARF checkout, install the optional Cargo frontend and let it detect the host package manager:
cargo install --path build/cargo-narf
cargo narf detect
cargo narf install --version 0.5.0 --dry-run
cargo narf install --version 0.5.0
cargo narf install builds a native package and delegates installation to
apt/dpkg, dnf/rpm, or pacman; it never copies files directly into
/boot. Gentoo output is generated as an overlay-ready ebuild rather than
installed automatically because overlay registration is host policy.
The x86 packager builds a native single-file EFI image containing its kernel,
initramfs, and command line. Pass --cmdline or --initramfs to customize it.
--limine-efi /path/to/BOOTX64.EFI explicitly selects legacy packaging.
Native packages support x86_64 UEFI/legacy BIOS and aarch64 UEFI. Their loaders
are cryptographically bound to the exact configuration and kernel. A
distribution can sign during package construction, or an administrator can run
sudo narf-uefi install --sign-with-sbctl with an existing enrolled sbctl
policy. Published project artifacts remain unsigned because the project does
not hold each machine's private key. See
UEFI Secure Boot and
packaging/README.md for key-policy boundaries, ESP detection,
boot-manager integration, package creation, removal, and recovery commands.
CachyOS users should also read
Booting NARF from CachyOS: it separates the
supported QEMU/USB and GRUB alternate-boot workflows from the not-yet-supported
goal of running the installed CachyOS root as NARF userspace.