I would like to introduce genrt,
an experimental operating system for AArch64 written primarily in Rust.
The active target is currently a single-core QEMU virt machine with a
Cortex-A72 CPU and GICv2. The kernel is written mostly in Rust, early boot and
context-switching code use AArch64 assembly, and userspace programs are
freestanding C executables.
genrt is a research and learning project focused on explicit ownership, bounded
runtime structures, reproducible testing, and deterministic kernel mechanisms.
It is not yet a hard real-time or latency-certified operating system.
Current state
The current release includes:
- a high-half EL1 kernel with a low-linked pre-MMU bootstrap;
- separate TTBR1 kernel mappings and process-owned TTBR0 address spaces;
- a preemptive single-core Round-Robin scheduler;
- IRQ-return context switching and one-shot timer deadlines;
- bounded thread, process, file-descriptor, and timed-event storage;
- EL0 processes loaded from static AArch64 ELF files;
- fork, execve, waitpid, and lower-EL fault isolation;
- a read-only CPIO newc initramfs;
- an interactive /init shell and separate echo, cat, ls, and pwd programs;
- machine-readable QEMU integration contracts and reproducible release bundles.
intended to claim complete Linux or POSIX compatibility.
Some design choices
The scheduler, timed-event paths, and interrupt handlers use preallocated
storage and do not grow containers or allocate memory at runtime. User memory
is copied eagerly during fork; there is currently no copy-on-write or demand
paging.
Blocking operations use generation-tagged wait tokens so that stale timeouts or
duplicate wakeups cannot affect a later wait performed by a reused thread slot.
Architecture-specific register access, MMU setup, exception entry, GIC, timer,
and UART code are kept under the AArch64 layer. The generic kernel code works
with architecture-neutral scheduler, process, memory, and filesystem
abstractions.
The next major milestone is a deliberately restricted SMP model:
- one immutable home CPU per thread;
- one local run queue per CPU;
- no migration, work stealing, or dynamic load balancing;
- deterministic process placement;
- explicit CPU ownership of userspace address spaces;
- no general userspace TLB shootdown during the first SMP milestone.
The tagged release is available here:
genrt v0.1.0-alpha.2
The release bundle contains the kernel ELF, DTB, initramfs, checksums,
manifests, and a RUN.md file with the QEMU command.
On a supported Arch Linux or Ubuntu host, the source build can be started with:
Code: Select all
git clone https://github.com/redeemed-sis/genrt.git
cd genrt
git checkout v0.1.0-alpha.2
./scripts/setup/install-deps.sh
cargo xtask run-aarch64
Code: Select all
ls
pwd
cat /etc/banner
echo hello
exit
Code: Select all
cargo xtask ci
I would be interested in feedback on:
- the IRQ-return preemption and trap-frame handoff model;
- TTBR0/TTBR1 ownership and process address-space lifetime;
- the generation-tagged wait and one-shot deadline design;
- the proposed static-affinity SMP model;
- the QEMU contract-testing approach;
- unclear or unjustified architectural assumptions in the documentation.
"good first issue" for people who would like to explore the codebase.
Questions and draft pull requests are welcome.
Current limitations
The project is still experimental. Some of its main limitations are:
- single-core execution only;
- QEMU virt is the only active platform;
- no writable filesystem or persistent storage;
- a deliberately small userspace ABI;
- one userspace thread per process;
- no libc, dynamic loader, signals, sockets, or mmap;
- no FP/SIMD context ownership;
- no measured worst-case interrupt or scheduling latency.
Thanks for taking a look.