After four years, Rust-based Redox OS is nearly self-hosting
A better operating system thanks to Rust's combination of safety and performance?
By Tim Anderson 29 Nov 2019 at 17:13
118 SHARE ▼
Laptops running Redox, a new operating system written in Rust
The Redox OS, written in Rust and currently under development, is only "a few months of work away" from self-hosting, meaning that the Rustc compiler would run on Redox itself, according to its creator Jeremy Soller.
Soller, who is also a principal engineer at the Linux hardware company System76, based in Denver, USA, says that he is now running Redox OS permanently on one of his company's laptops, with "full support for the keyboard, touchpad, storage and Ethernet".
Soller says that a long-standing issue has been "to allow the compilation of Rust binaries on Redox OS".
This was nearly achieved in 2017 by participating in a Google Summer of Code (a Google-sponsored programme for open-source projects), but bug-fixing along with complications with dynamic linking for the Rustc compiler have delayed "the dream of self-hosting" – though Soller believes this is now close.
Redox does run, though, and Soller has shown it booting in three seconds with an NVMe (Non-Volatile Memory Express) drive, a time he says is "not fast enough".
What is Redox for? An online book explains the how and why. It is "a general purpose operating system and surrounding ecosystem written in pure Rust. Our aim is to provide a fully functioning Unix-like microkernel, that is both secure and free."
The book takes an opinionated look at current Unix-like operating systems. Linux, it says, has issues with legacy drivers, a bloated codebase and lack of memory safety; and the GPL2 is less permissive than the MIT licence used by Redox. BSD is preferred but "a single buggy driver can crash the system".
Redox benefits from the fact that the Rust language is designed for safety and attempts to avoid compromising performance. It also has an innovative philosophy which adapts the "everything is a file" idea in Unix to become "everything is a URL". According to the book:
With "Everything is a file" all sorts of devices, processes, and kernel parameters can be accessed as files in a regular filesystem. This leads to absurd situations like the hard disk containing the root filesystem / contains a folder named dev with device files including sda which contains the root filesystem. Situations like this are missing any logic. Furthermore many file properties don't make sense on these 'special files': What is the size of /dev/null or a configuration option in sysfs?
In contrast to "Everything is a file", Redox does not enforce a common tree node for all kinds of resources. Instead resources are distinguished by protocol. This way USB devices don't end up in a "filesystem", but a protocol-based scheme like EHCI. Real files are accessible through a scheme called file, which is widely used and specified in RFC 1630 and RFC 1738.
Redox will be a desktop operating system first, but both embedded and server uses are envisaged eventually.
Redox has a POSIX-compliant C library written in Rust, called relibc. It is Linux-compatible both at the syscall API level and at the syscall ABI (Application binary interface) level, subject to the same architecture. You can also run Redox applications on Linux. There is a shell called ion. There is a desktop environment called Orbital, and applications already include a calculator, file browser, image viewer, terminal emulator, 3D renderer, and a vi-like editor called Sodium.
The Orbital desktop in Redox (image from Redox site)
Arm technical director Robin Randhawa spoke at FOSDEM in February 2019 about porting Redox OS to Arm v8.0. Rust, he noted, is genuinely useful for implementing a microkernel. If Randhawa is successful, Redox will run on hardware like Raspberry Pi.
Reality check: the latest release of Redox is version 0.5, out in March 2019.
It is best described as experimental and not in line to replace any existing OS for the time being. Still, if Rust continues to grow in popularity, its characteristics of safety and unimpeded performance seem ideal for creating a new operating system, so perhaps Redox will become more prominent. ®
In Rust We Trust: Stob gets behind the latest language craze
Stob My, what beautiful curly braces you have
That Old Time 2018 IT songbook: Verity, Verity - give us your lyrics, do! We're half crazy, all for the love of you
Stob It's sing-along-a-Stob time
Everyday doings of a metropolitan techie: Stob's software diary
Stob Chronicles of Delphi scribe podcasts, er, scribbles her musings
Google defames Reg columnist Verity Stob
Auto-trawled headshot too AWFUL to contemplate
2001: A Stob Odyssey
Open the chuffing pod bay doors yourself, Dave
Brexit at the next junction: Verity's guide to key post-vote skills
STOB Breaking up is hard to do
Programmers' Question Time: Tiptoe through the tuples
Stob Addressing the pro-horticulture/anti-nerdiculture bias
Verity Stob faces execution, Wikipedia-style
Citation needed
CrowdStrike Falcon Complete
Guidance for taking any organization to the highest level of endpoint protection regardless of internal resources.
SANS Institute: Cloud Security Survey Results
Over 47 percent of surveyed organizations store sensitive business intelligence and IP in the cloud ... yet in 2018, a quarter of respondents realized security events due to poor configuration and insecure APIs.
63% Say Networks are Wrecking Office 365 Collaboration
TechValidate, on behalf of Zscaler, conducted a survey of 250 U.S. and European organizations that had deployed Office 365.