A policy for inclusion of Rust in the Linux Kernel
news.itsfoss.com
news.itsfoss.com
Background & Motivation
Linux is a monolithic kernel, making it difficult to incrementally introduce Rust without significant modifications. While Rust is being integrated into the kernel for drivers, deeper adoption requires a more fundamental shift. A full Rust-based fork would allow leveraging Rust’s safety features across core kernel components.
Key Goals 1. Process Management in Rust – Rewrite the scheduler and process handling to improve memory safety. 2. Synchronization Primitives – Implement mutexes, spinlocks, and RCU using Rust for safer concurrency. 3. Filesystem & VFS Layer – Enhance security and stability with Rust-based abstractions. 4. Kernel Drivers in Rust – Replace legacy C-based drivers with Rust implementations where feasible.
Challenges • Rewriting large portions of Linux is costly and time-consuming. • Ensuring compatibility between Rust and existing C subsystems. • Gaining support from the Linux development community.
Approach
Instead of a complete rewrite, a modular approach can incrementally introduce Rust subsystems, ensuring compatibility while leveraging Rust’s benefits. Although existing Rust-based kernels like Redox OS are not yet competitive, a forked Rust-Linux could lay the foundation for a safer and more maintainable kernel.
That's one of the biggest reasons why alternative kernels either remain fringe or fail.
Initiatives such as NetBSD's Rump kernel but for Linux may provide a bridge to Linux's drivers but it's brittle. There's already LKL - the Linux Kernel Library project with similar aims but not much traction.
But there's a huge difference between "let's make it easier for driver writers to write correct drivers by using Rust in the OS we all already use" and "let's create a whole OS and convince driver writers to write drivers for it and then users to use it".
I genuinely doubt Torvalds (even a young version of him) could build a new competing OS in modern times, and have it succeed.
Linux succeeded in a much, much simpler world. What needs to succeed now is something that compares not to the initial Linux, but to the Linux 30 years later, with mountains of effort piled up on top. That is no longer something that can be achieved by any single person, no matter how motivated.
Companies depend on Linux and want to improve their products, not rebuild a massive codebase from scratch.
Once that's internalised, those 'someone's may either align or be the outliers that don't matter in the greater scheme.
That said: To appreciate the value Rust provides there is going to be some experience driven knowledge gain needed but the efforts underway should help.
We’ll see what happens!