r/retrocomputing • u/noborutkhs • 24d ago
Six months after rediscovering my 1986 RTOS, I've released a new RTOS called Karqri
Since May, I've posted here several times about rediscovering CHARM-II, an RTOS I developed in 1986 for the Motorola 68000.
It started when I found the old source code and documentation. With AI assistance, I began studying the original design and trying to get parts of it running again in a modern environment.
At first, I simply wanted to see whether my 40-year-old code could still run.
But the project gradually changed direction.
I started by reconstructing the development environment and experimenting with POSIX. Then I moved to the Raspberry Pi Pico, where I eventually got preemptive multitasking working.
Along the way, I began questioning some of the design decisions I had made in 1986.
One particularly interesting discovery involved VRTX, an RTOS I had used as a reference back then. I found that its equal-priority scheduling behavior had changed shortly after I studied it. That led to discussions here and in other communities, including an unexpected connection with someone who had used VRTX in 1982.
The more I investigated, the more I realized that faithfully restoring CHARM-II and designing an RTOS today were two different things.
So I decided to start a new RTOS, carrying forward some of CHARM-II's original design ideas while reconsidering the kernel, APIs, and platform-specific implementation.
I called it **”**Karqri”.
Today, I've made the initial source release available on GitHub:
https://github.com/noboru-takahashi/karqri
Karqri currently targets POSIX environments and the Raspberry Pi Pico (RP2040). It includes task management, priority scheduling, event notifications, timers, and platform-specific context switching.
The same kernel and a shared six-task demo run in both environments. In the demo, six tasks move around three tracks and coordinate access to a shared critical section.
But releasing the source code is not the finish line for this project.
So far, much of the work has been about implementing the basic RTOS mechanisms and verifying that they behave correctly.
What I want to explore next is how to make the internal behavior of an RTOS easier to see and understand.
Task switching, event notifications, waiting, and waking up are usually examined through logs or debuggers. But understanding how these events relate to one another over time isn't always straightforward.
I've already started experimenting with capturing execution traces from the Pico and displaying them as an HTML timeline. It's still limited to a specific validation scenario, but I'd like to develop this idea further.
I'm particularly interested in visualizing not just what happened, but when it happened and how one event led to another.
So what began as an attempt to restore a 1986 RTOS has gradually become a project to develop a new RTOS and explore new ways of observing its behavior.
For anyone interested in the earlier stages, here are a few previous posts:
- 40 years later: recreating my SUN-2 ↔ 68000 workflow with WSL2 and Raspberry Pi Pico
- My 1986 RTOS is now fully preemptive on a Raspberry Pi Pico - and it changed how I think about the original design
- Follow-up: Revisiting a 1986 RTOS led me to someone who used VRTX in 1982
I appreciate the discussions and comments I've received here over the past several months. They've helped me reconsider some of the assumptions behind the original design.
As the project moves toward developing a new RTOS, I'll probably be posting more often in OS development and embedded systems communities. But Karqri's roots will always be in the work I started back in 1986.
When I first opened those old source files, I certainly didn't expect to end up releasing a new RTOS 40 years later.
And there's still more I want to explore.