OctoX is a radical Rust implementation of a very old OS for RISC-V
There's still life in the wider Version 6 Unix family – and 9front too
Not only are various editions of Version 6 UNIX, often known as V6 for short, still being maintained – but new ones continue to appear.
Version 6 UNIX arrived in 1975, and it was the first version of the new OS to see much widespread use outside of AT&T and a handful of research institutions. It's the OS documented in the famous "Lions book" [PDF], more formally known as A Commentary on the Sixth Edition Unix Operating System, and the origin of perhaps the most famous source code comment of all time:
/* * You are not expected to understand this. */
(If you don't know the Lions book, and want to see the source code next to the commentary, there's a more interactive web-text version on GitHub.)
Perhaps surprisingly for such a primitive system from the mid-1970s, several different modern OSes derived from V6 are still around and maintained today, mainly for students learning about operating system design. So don't get too excited just yet, OctoX is not some radical new OS. It's perhaps fairer to say it's a radical new implementation of a very old OS.
It springs from Xv6, which is the Massachusetts Institute of Technology's project to modernize V6 for its Operating System Engineering course. The snag is that V6 itself was implemented for the DEC PDP-11, and in a pre-standardized version of C to boot. After a few years, the boffins at MIT decided to rewrite V6 in ANSI C for modern x86 hardware, and the result was Xv6. Its source code is still available, but the x86 version has been superseded by a newer version for RISC-V.
These days, despite its legions of fans, C is often deprecated as a systems programming language, at least for new systems – a view described concisely by former Google researcher Cliff Biffle's 2019 essay Prefer Rust to C/C++ for new code.
A sign of its growing maturity is that people are completing significant projects in it. A recent example that impressed us is Andrea Bargi's rjvm, which as the author's detailed blog post explains, is a tiny, toy OpenJDK 7 Java virtual machine, written entirely in Rust.
Impressive as that is, operating systems are easier to understand and demonstrate. Another example Rust's growing suitability for ambitious projects is reimplementing Xv6 in Rust. One instance is rxv64, whose title is, in true Unix style, a very terse self-description: it's xv6, reimplemented in Rust (thus the "r" on the beginning), targeting x86-64 (the "64" on the end).
However, as its GitHub statistics illustrate,
rxv64 isn't a pure Rust project:
• Rust 77.9% • C 19.3%
• Assembly 2.7% • Shell 0.1%
Enter OctoX, whose stats illustrate a level of purity that excites a certain type of geek:
• Rust 100.0%
We also grinned wryly at this pithy description from Hacker News:
o8vm targets RISC-V, whereas rxv64 targets a legacy ISA.
As its author Hayato Ohhashi says: "This is a learning project for me, and I will not be accepting pull requests until I consider the implementation complete." As a demonstration and a proof of concept, though, it looks very impressive, if not terribly practical – but practicality is not the goal here.
- Debian 12.1 released with bug fixes aplenty and excitement still in short supply
- Want to live dangerously? Try running Windows XP in 2023
- Slackware wasn't the first Linux distro, but it's the oldest still alive and kicking
- Mint 21.2 is desktop Linux without the faff
Unix didn't end with V6, of course, it just seems to represent a sweet spot in size and complexity of OS design for many people, especially students. In 1979, V6 was followed by V7, the first version of Unix that was designed to be portable to different machine architectures. V7 was the direct ancestor of Microsoft Xenix, and it also led to two different ports for DEC minicomputers: its PDP-11 version, V7M, later led to DEC Ultrix, and the VAX version, UNIX/32V, led to the BSD family.
For some, V7 was the classic version of Unix, and after that is when it became bloated and commercial. In academia, its descendants, which borrowed extensively from BSD, were collectively known as "Research Unix" and became open source relatively recently.
The last version of Research Unix was V10. After that, the project moved on to Plan 9 from Bell Labs. That continues today in the form of 9front. Since we wrote about late 2022's "the Golden Age of Ballooning", the 9front developers have released a new version, "Don't Touch the Artwork". The Reg FOSS desk still feels that 9front's Plan 9 has a lot to teach the contemporary Linux and BSD world, and we recommend überhacker Drew DeVault's essay In praise of Plan 9, which came a week after our own article, for an insight into why. ®