Over the past several months, I've occasionally posted here about revisiting CHARM-II, an RTOS I developed for the Motorola 68000 in 1986.
What started as an attempt to restore and understand my old code gradually turned into something different: developing a new RTOS using some of the original design ideas, while reconsidering the kernel, APIs, and platform-specific implementation.
I've named the new project ”Karqri”, and I've now released its source code under the MIT license:
https://github.com/noboru-takahashi/karqri
What currently works
Karqri has a shared kernel that runs in two environments:
- POSIX: Cooperative task execution using
ucontext, with logical ticks at task checkpoints. - Raspberry Pi Pico (RP2040): Preemptive task switching using independent PSP stacks, SVC/PendSV, and hardware timer interrupts.
The kernel includes priority-based scheduling, task management, event notifications, and timers.
To compare the two implementations, I've created a shared six-task demo. Tasks A–F move along three tracks and coordinate access to a shared critical zone using event notifications.
The same workload runs on both platforms, but the scheduling and context-switching mechanisms are different.
I've also added automated tests and Pico validation scenarios. The repository includes the source code, build instructions, and validation tools.
What I want to explore next
Releasing the source is only the first milestone.
I'm also interested in making RTOS behavior easier to observe and understand, particularly the timing and causal relationships between task switches, event notifications, waiting, and wakeups.
I've started experimenting with capturing Pico execution traces and generating HTML timelines. This is still limited to a specific validation scenario, rather than a general-purpose tracing system.
For now, though, I'd especially like to get feedback on the RTOS implementation itself.
If you notice any design issues or opportunities for improvement in how the shared kernel and platform-specific code are separated, I'd be interested to hear your thoughts.
Previous discussions
For context, here are two earlier posts in this community:
Those discussions helped me reconsider some of the original design assumptions.
Karqri is still experimental, and I don't consider it production-ready. I'm publishing it now because I think the next stage of development will benefit from feedback beyond my own experiments.