Moss: a Rust Linux-compatible kernel in 26,000 lines of code

https://news.ycombinator.com/rss Hits: 16
Summary

moss moss is a Unix-like, Linux-compatible kernel written in Rust and Aarch64 assembly. It features a modern, asynchronous core, a modular architecture abstraction layer, and binary compatibility with Linux userspace applications (currently capable of running most BusyBox commands). Features Architecture & Memory Full support for aarch64. A well-defined HAL allowing for easy porting to other architectures (e.g., x86_64, RISC-V). Memory Management: Full MMU enablement and page table management. Copy-on-Write (CoW) pages. Safe copy to/from userspace async functions. Kernel and userspace page fault management. Buddy allocator for physical addresses and smalloc for boot allocations and tracking memory reservations. Async Core One of the defining features of moss is its usage of Rust's async/await model within the kernel context: All non-trivial system calls are written as async functions, sleep-able functions are prefixed with .await . functions, sleep-able functions are prefixed with . The compiler enforces that spinlocks cannot be held over sleep points, eliminating a common class of kernel deadlocks. Process Management Full task management including scheduling and task migration via IPIs. Currently implements 51 Linux syscalls; sufficient to execute most BusyBox commands. Advanced forking capabilities via clone() . . Process and thread signal delivery and raising support. VFS & Filesystems Virtual File System with full async abstractions. Drivers: Ramdisk block device implementation. FAT32 filesystem driver (ro). devtmpfs driver for kernel character device access. libkernel & Testing moss is built on top of libkernel , a utility library designed to be architecture-agnostic. This allows logic to be tested on a host machine (e.g., x86) before running on bare metal. Address Types: Strong typing for VA (Virtual), PA (Physical), and UA (User) addresses. (Virtual), (Physical), and (User) addresses. Containers: VMA management, generic page-based ring buffer ( kbuf ), and wa...

First seen: 2025-11-28 10:40

Last seen: 2025-11-29 01:42