RISC OS Merlin
Introducing Merlin: A Modern Kernel for a Classic Legacy.
In the realm of operating systems, few hold the historical and architectural significance of RISC OS. Originally developed by Acorn for the ARM architecture in the 1980s, RISC OS pioneered a lightweight, fast, and responsive desktop experience on early ARM-based machines. While the modern computing landscape has evolved considerably, the RISC OS community continues to explore ways to preserve, modernise, and build upon this legacy. | ![]() |
One such initiative is the Merlin Project. Merlin is a new operating system kernel (for now, and hopefully later a full OS), written mostly in Rust (there are a few portions still written in assembly language), designed to be a drop-in replacement for the original RISC OS kernel. It embraces memory safety, modularity, and portability while maintaining binary and behavioral compatibility with legacy RISC OS software.
Project Progress | |||
---|---|---|---|
Open Issues | 31 | ||
Closed Issues | 7 | ||
Progress | 18% | ||
Why Merlin?
The traditional RISC OS kernel is largely implemented in ARM32 assembly, has no security, offers no parallelism, and follows no standardised calling convention like APCS or SysV. This presents challenges for portability, safety, and long-term maintenance, as well as hinders adoption of modern computing paradigms. With Merlin, I aim to:
- Modernise the kernel using a memory-safe language
- Abstract hardware through a flexible HAL architecture
- Introduce parallelism to support threads and multi-core CPUs
- Maintain full compatibility with 26-bit and 32-bit RISC OS modules and applications
- Build the version of RISC OS I always wished for—evolved, modern, but respectful of its roots
Merlin is a personal journey as much as a technical one: an homage to the operating system where many of us, including myself, learned the fundamentals of computing. It’s not about saving RISC OS, but about celebrating and extending it in the way many of us imagine it could have become. And it’s also a lot of fun to work on this project!
What Does Merlin Stand For?
The original RISC OS project was called Arthur, an acronym for ARM on Thursday. Following this unusual tradition, RISC OS Merlin stands for: Modern Execution Runtime with Legacy INterface. In both cases, the names also reference British mythology. Given the magic Merlin brings to RISC OS, I think it’s a fitting name! 🙂
Design and Architecture
At its core, Merlin is a monolithic kernel influenced by microkernel principles. It supports multiple execution contexts, a modern syscall dispatcher, and SWI compatibility to preserve the RISC OS programming model. Key ABI components include:
- legacy_abi: Supports classic RISC OS SWIs and modules
- merlin_abi: A modern, POSIX-compatible C ABI for portable software
- private_abi: Internal calls used by the kernel and its subsystems
Each ABI serves a distinct purpose and operates within separate namespaces to avoid collisions:
- legacy_abi: traps and forwards RISC OS SWI calls (or emulated traps) into Merlin’s legacy dispatcher
- merlin_abi: provides stable, POSIX-style syscalls for modern applications and drivers
- private_abi: internal kernel ABI, not exposed to user space, used for module-to-kernel and service messaging
Merlin executes legacy RISC OS software inside isolated virtual machines (USRVM26, USRVM32, OSVM26, OSVM32) using a built-in ARM26/ARM32 emulator called RARMulator. This mechanism preserves 26-bit and 32-bit module compatibility across modern CPUs (including non-ARM targets like PPC, MIPS, RISC-V or x86), while maintaining safety and isolation. The user perceives no difference between applications running natively or in emulation.
Features
- Modular Syscall Table: Unified interface for SWI and modern syscalls
- Memory Protection: Dynamic areas, RMA, and per-process MMU mappings. Merlin supports an optional MMU at build time, making it suitable for IoT and embedded use cases
- Safe Concurrency: Thread-safe primitives like KernelMutex and KernelAtomic
- Dynamic Modules: Loadable at runtime, with isolated syscall spaces
- Multi-platform Support: Runs on ARM (32/64-bit), RISC-V, x86, and others
- Hardware Acceleration: Support for various acceleration techniques, including GPU and modern CPU features
Influences
Merlin draws architectural inspiration from multiple sources:
- Original RISC OS — Especially its per-platform builds, ROM image architecture, vector calls and chains, and modular design
- IBM OS/2 — For its modularity, subsystem flexibility, and dual-personality environment
- Microsoft Windows NT — For its layered architecture and HAL abstraction
- Linux and BSD — For kernel internals, concurrency models, and tooling inspiration
Merlin still ships in “ROM Images” like original RISC OS, though without the 4MB size limitation. The traditional format is supported for compatibility, but the image can grow beyond it, enabling instant system availability after boot.
Merlin also preserves the original design choices that made RISC OS so hackable: a modular architecture and extensible kernel via vectors and vector chains. A module can augment or override existing OS features, not just add new ones.
A Platform for Exploration
Merlin isn’t just about retro-computing. It’s a platform for experimenting with modern OS concepts while honoring one of computing’s most elegant environments. Whether you’re passionate about kernel internals, emulation, hardware abstraction, or simply want to test ideas RISC OS never realised; Merlin offers a unique, exciting space for exploration.
Merlin’s modularity, ABI flexibility, and MMU-optional configuration make it a great fit for:
- IoT and embedded platforms where lightweight performance is essential
- Retro-computing environments requiring 26/32-bit software compatibility
- Educational or experimental systems studying OS design
Detailed Tasks and Status Updates
More details on the project’s progress can be found here (Note: the Merlin repository is currently private, therefore all the Issues and project planning are also private).
Project’s Public Repositories
While Project Merlin is not yet public, some of its essential Rust crates (dependencies) are already open source. The list below will be updated as the number of them changes:
- Merlin’s Macros: This crate provides custom procedural macros used internally by the kernel to reduce boilerplate, ensure compile-time checks, and maintain no_std compliance.
Please note: Merlin avoids 3rd-party dependencies as much as possible, favoring in-house implementations for maximum control and auditability. It’s implemented as no-std.
Latest Test Logs updates
You can download zip files containing the latest test logs (in text format) for the most stable test build so far, so you can have a detailed view on the progresses and how testable RISC OS Merlin is: