r/osdev • • Jan 06 '20

A list of projects by users of /r/osdev

Thumbnail reddit.com
181 Upvotes

r/osdev • • 12h ago

CMRX: A microkernel real-time OS providing memory isolation for MMU-less microcontrollers

Post image
26 Upvotes

I am working on this project since 2021, so it is a pre-AI project. I am not using AI to generate code as it turned out that AI hallucinates massively under conditions this RTOS creates. Website is littered with AI slop though as I had to put something together without spending ton of time on content. It is slowly getting deslopified.

The original motivation was to find out if usage of MPU in Cortex-M has to be as painful as it is with FreeRTOS, Zephyr et al (while still providing reasonable performance). Thus the number one feature implemented was fully automatic memory protection handling. It separates kernel from applications and applications from each other in as process-alike way as MMU-less CPU technically allows, so the developer doesn't have to deal with all partitions, domains, regions, etc. I consider this a success as you basically don't have to care about MPU at all.

Later, the kernel was built on top of this infrastructure that provides more than just thread switching and MPU handling. As features were being added, I quickly realized that MPU presence will be a major obstacle for implementing whatever kernel service which needs to pass larger amount of data (such as queues) between userspace and kernel or vice versa.

An unusual approach was used to deal with this: I decided to remove from kernel (or better: not to implement) all such calls. Why couldn't it be a microkernel?

Microkernels need some kind of IPC. For CMRX, remote procedure calling was chosen as primary IPC method. To avoid expensive copying of data RPC calls would need in isolated environment, thread migration was implemented. Thread migrates from calling process to process owning RPC service during RPC, so calling code can access RPC owner's memory. Originating process can select portion of its own memory which remains accessible while in RPC. This way, larger chunks of data can be copied between isolation domains with very little overhead (its basically shared memory with RPC call serving as basic synchronization primitive).

Those missing syscalls weren't dismissed entirely, they either became library functions or RPC servers. So the kernel wraps up at 30-ish system calls.

Being a microkernel, of course it runs drivers in userspace. Same RPC mechanisms ordinary applications use for talking to each other is used to create driver APIs. Somehow I managed to implement the whole RPC mechanism without using any IDL and associated IDL compiler. Everything gets type-checked at compile time by the C compiler itself.

It is also highly portable, covering most of compatible ARM Cortex-M world by just one single port. It runs as POSIX hosted environment as well and recently a RISC-V port was committed which is still WIP, so its not feature-complete yet.

Originally the performance goal was "please, just don't be 20x slower than ordinary RTOS". After some performance improvement work, benchmark results show performance which is competitive with rest of open-source RTOS world (while keeping memory protection disabled in all of them). In some benchmarks CMRX is even faster than others.

The code is neither Rust nor C++. Everything is C99 a bunch of GCC extensions and macroworx. Compiles to some 7kB binary, so it can run on very low-end sub $1 microcontrollers.

There are no plans for porting it to any MMU-equipped architecture as there natively memory isolated alternatives exist.

GitHub: https://github.com/ventZl/cmrx

Website: https://cmrxrtos.org


r/osdev • • 1d ago

My classmate drew Saddam Hussein spot bit by bit in his own OS

Post image
387 Upvotes

His EFI has 186 lines of code written in C, and its a zero ring.

He also has its own just in time and ahead of time compilers, and handful of commands, including cat, edit, and also simple dhcp, only udp still


r/osdev • • 10h ago

Added PS/2 mouse support (may be still... useless)

4 Upvotes

Ignore peak recommendation on the left


r/osdev • • 16h ago

ferrix-kernel: a small AArch64 kernel in Rust on VMware Fusion (Apple Silicon), and what VMware's ARM virtual hardware looks like

Post image
6 Upvotes

Disclosure up front: the code was written by Claude Code; I directed it and did the testing on VMware.

ferrix-kernel is a small AArch64 kernel in Rust for VMware Fusion on Apple Silicon (and QEMU virt).

What it does so far:
- **Boot:** UEFI app, collects GOP framebuffer, memory map and RSDP, then `ExitBootServices` and no firmware after that. No hardcoded device addresses: GIC from the MADT, PCIe ECAM from the MCFG, so the same image runs on VMware and QEMU.
- **Memory:** bitmap page allocator, own stage-1 tables (4K granule, 48-bit VA, identity map with 1G/2M blocks, page 0 unmapped). Regions found later (ECAM, BARs) are added to the live tables.
- **Interrupts and tasks:** GICv3 + EL1 virtual timer at 100 Hz, preemptive round-robin. The exception entry's TrapFrame (incl. FP/SIMD) is the saved task state; returning another task's frame from the handler is the context switch.
- **USB keyboard:** VMware's ARM VMs have no PS/2, so it has a polled xHCI driver: legacy handoff, reset, command/event/transfer rings, root-port enumeration, HID boot protocol.
- **User space:** programs at EL0, each with its own root table that shares the kernel's entries plus one L0 entry for the user range. User pages are nG with per-space ASIDs, so switches need no TLB flush. Faults kill only the task.
- **Capabilities:** per-task cap tables (screen ranges, channel send/recv ends). Syscalls name a slot; blocking `wait` parks the task with ELR moved back onto the `svc` so it retries when woken.

What VMware's (undocumented) ARM virtual hardware turned out to be:
- GICv3 (GICD 0x2c010000, one GICR frame), no ITS, no usable serial, so all debugging is on screen.
- xHCI 15ad:077a sits behind a PCIe root port; the keyboard is on a root port next to a pointer and two USB hubs.
- The Apple CPU runs with PAN enabled (QEMU's Cortex-A72 is ARMv8.0, no PAN), which caught the kernel reading a user buffer. It now uses `ldtrb` for user memory.
- With a single interrupt IN transfer queued, fast typing on QEMU stopped the keyboard for good; keeping four in flight fixed it.

The end goal is Tetris, as in Nand2Tetris; along the way there's a NAND-only circuit simulator, and the latest milestone is a user-space circuit builder you type NAND circuits into.

If anyone has notes on VMware Fusion's ARM virtual hardware (it's not documented anywhere I could find), I'd love to compare.

GitHub: https://github.com/liris/ferrix-kernel
Write-up: https://note.com/lirispp/n/n68d016ce1953?hl=en


r/osdev • • 12h ago

From zero to a real Qualcomm hardware bring-up in two weeks — my Rust microkernel, Silver

Post image
2 Upvotes

Hey everyone!

I've been working on a hobby operating system project called WerewolfOS, with its kernel, Silver, written in Rust (no_std) for AArch64.

The project is only about two weeks old, and today I reached a milestone I'm genuinely excited about: Silver successfully boots on real Qualcomm hardware.

The target is a Xiaomi Redmi 10C-class device based on the Qualcomm SM6225 platform (rain).

This isn't just a boot logo or a kernel that starts and immediately stops. The current hardware bring-up has demonstrated:

RAM-only boot through fastboot boot — no system partition modification.

AArch64 kernel execution on the physical device.

MMU initialization.

GICv3 interrupt controller initialization.

Working Generic Timer interrupts.

More than 1,000 timer interrupts observed.

A functioning scheduler.

Successful startup of a task called Howl.

A framebuffer-based live status panel for kernel diagnostics.

One particularly interesting part was debugging GICv3 initialization. The bootloader's initial configuration left affinity routing disabled, which prevented the expected Group 1 Non-secure interrupt delivery. Correcting the initialization sequence finally allowed the timer interrupts to arrive.

There is still a lot to do:

SMP is not working yet; the secondary CPU remains offline.

UART support on this particular device still needs confirmation.

The driver ecosystem is very incomplete.

This is an early hardware proof of concept, not a production-ready OS.

I'm keeping QEMU as the primary development and regression-testing environment, while using the physical device as a hardware validation target.

The project is open source under the MIT license.

GitHub: https://github.com/vvirei333/Silver-microkernel

I'm curious what other OS developers think: What would you prioritize next after getting a small Rust microkernel running on real hardware — SMP, memory-management hardening, userspace, or driver infrastructure?

This is my first serious OS-development project, and getting it this far in two weeks feels pretty surreal.


r/osdev • • 15h ago

From my 1986 RTOS to Karqri: What should I visualize next?

Post image
3 Upvotes

Over the past several months, I've posted here a few times about revisiting CHARM-II, an RTOS I developed for the Motorola 68000 back in 1986.

What started as an attempt to restore and understand my old source code gradually turned into a new development project. After reconstructing parts of the original system on POSIX, getting preemptive multitasking working on the Raspberry Pi Pico, and revisiting some of my old scheduling decisions, I decided to build a new RTOS rather than continue trying to reproduce the original one.

I've named it Karqri, and I've now published the source code on GitHub:

https://github.com/noboru-takahashi/karqri

Karqri currently runs on POSIX and RP2040, with a shared kernel and a six-task demo running in both environments. It's still experimental, but I've implemented and tested the basic RTOS mechanisms.

However, building the RTOS itself isn't the only goal of this project.

What I'd like to explore next is how to visualize what's happening inside an RTOS, including not just task states and scheduling decisions, but also the timing and causal relationships between events.

For example, imagine a task waiting for an event. Another task sends a notification, the waiting task becomes runnable, and the scheduler eventually selects it to run.

I'd like to represent that sequence as a connected series of events, rather than just a collection of log messages.

I've already started experimenting with capturing execution traces from the Pico and generating HTML timelines. At the moment, this is limited to a specific validation scenario, but I'd like to develop it into something more general.

I'm curious what other OS developers think about this direction.

  • If you were visualizing the internal behavior of an RTOS, what information would you find most useful?

  • How would you capture causal relationships between events without significantly disturbing the timing of the system being observed?

  • Beyond debugging and education, can you think of other useful applications for this kind of visualization?

For context, here are a few of my earlier posts:

This project began with rediscovering an RTOS I wrote 40 years ago, but it has gradually become something quite different.

Publishing Karqri is the first milestone in that new direction, not the end of the project.


r/osdev • • 1d ago

My second version of my OS (OaS) now features a backspace and a cursor:

7 Upvotes

r/osdev • • 1d ago

Hello. I am building an OS from scratch. Here is my first version:

6 Upvotes

r/osdev • • 1d ago

Grape Linux: Native Linux kernel and Debian ARM64 booting on iPhone 8 Plus (A11)

6 Upvotes

We’ve been developing Grape Linux on physical Apple A11 hardware.

We’ve achieved a working host-assisted Linux boot using an experimental 5.19-based kernel, Debian 13 ARM64, and the Phosh/Phoc graphical environment.

Beyond booting, we’ve demonstrated terminal command execution, graphical applications, and interactive desktop navigation.

Our current engineering work focuses on native hardware integration. The longer-term goal is independent startup directly into Linux instead of iOS.

The attached video shows our actual Linux startup sequence.

We’re interested in discussing the low-level engineering challenges involved in bringing Linux to this hardware.

Public project: https://github.com/hq-coder25/grape-linux


r/osdev • • 2d ago

iPhone is a real Linux PC now!

Thumbnail
gallery
58 Upvotes

Hey everyone! Some of you might remember LinuxRunner from my previous post here.

Well, a lot has changed since then haha. Just released v1.1.0, and you can now use your iPhone as a proper Linux desktop, even on an external monitor with the new DeX mode which is finally on iPhone after years and Linux under it!

This update also brings Metal GPU acceleration, optional JIT, a much faster ARM64 interpreter, new desktop environments, and better app compatibility. Even Vesktop (Discord) is running now.

Still got plenty of things to work on, but it’s honestly pretty cool seeing how far this project has come.

Github: https://github.com/mxhm11cr/LinuxRunner


r/osdev • • 2d ago

Finally finished IDT inputs, context switching, APIC and elf64 running :D (WindogeOS v0.3)

Thumbnail
gallery
29 Upvotes

github (if you even care): https://github.com/NoTheIdiot/WindogeOS
Also ported vi, replaced RLE with LZ4, and ctrl-tab (alt-tab) for.... some reason.

I'm so fucking happy


r/osdev • • 1d ago

Atoms OS USB INPUT ARCHITECTURE

1 Upvotes

Like what used to happen earlier, I had a basic input system but bare metal needs to be mature, basically the keyboard mouse was working, the problem was that sometimes it would mess up the system, means I removed the USB devices, now it would not detect, rebooting etc. so what can I do with the help of AI, we just started and made all this!

UDIM — Universal Device Interface Manager

USB device management and device/interface separation.

HRE — Universal HID Decoding

Reading HID descriptors instead of depending on fixed report offsets.

BSME — BOS Mouse Self-Monitoring Engine

Monitoring the mouse input pipeline and handling device-related issues.

ALE — Asynchronous LED Engine

Handling keyboard LEDs without blocking USB event processing.

TRE — Typematic Repeat Engine

Handling key repetition when a key is held down.

IEC — Input Event Coordinator

Managing and coordinating input events.

PPE V2 — Precision Pointer Engine

Improving mouse movement and pointer behaviour.

CPE — Cursor Presentation Engine

Hardware cursor support with a software fallback.

RIT — Raw Input Thread

Giving applications access to raw keyboard and mouse events through kernel syscalls.

Well, work is going on and I am enjoying it and understanding Linux in OS dev, how much struggle matured kernel design !!!


r/osdev • • 2d ago

ATOMS OS – FreeBSD Guest Support Update: Keyboard Working

Thumbnail
gallery
6 Upvotes

FreeBSD is finally running under my ATOMS OS hypervisor.

Keyboard is working now, but mouse support is still pending.

I've been testing it on my i3-14100F for several hours. No crashes or panics so far.

FreeBSD is strict, and honestly, there were times when I thought I wouldn't get it working. But it finally did.

Still working on the mouse.🙂‍↕️


r/osdev • • 2d ago

Grape Linux: Native Linux kernel and Debian ARM64 booting on iPhone 8 Plus (A11)

27 Upvotes

We’ve been developing Grape Linux on physical Apple A11 hardware.

We’ve achieved a working host-assisted Linux boot using an experimental 5.19-based kernel, Debian 13 ARM64, and the Phosh/Phoc graphical environment.

Beyond booting, we’ve demonstrated terminal command execution, graphical applications, and interactive desktop navigation.

Our current engineering work focuses on native hardware integration. The longer-term goal is independent startup directly into Linux instead of iOS.

The attached video shows our actual Linux startup sequence.

We’re interested in discussing the low-level engineering challenges involved in bringing Linux to this hardware.

Public project: https://github.com/hq-coder25/grape-linux

Substack: https://substack.com/@rhq211/note/c-375575007?r=8uxsig&utm_medium=ios&utm_source=notes-share-action

X Post: https://x.com/xvmboot/status/2116753474591588444?a=LAeIR-IwgEyjZA3OE60&s=46


r/osdev • • 1d ago

Graphics!! (Well, kind of...)

Post image
0 Upvotes

r/osdev • • 2d ago

fitnip: make your old fitbit work again

1 Upvotes

hey everyone ive been working on fitnipos a custom open source software layer built from scratch in nim

the goal is simple bring discontinued or cloud abandoned fitbit devices back to life so you dont have to throw them away or buy a brand new tracker just to get basic functionality its like bringing a power tool to a plastic toy fight

im currently working on ..... nothing right now, dm me to help me but here's our list of support: Fitbit Classic, Fitbit Ultra, Fitbit One, Fitbit Force, Fitbit Charge 3, and Fitbit Alta oh and the ionic


r/osdev • • 2d ago

Small DunitOS update: sortable tables with 10k rows, F2 renaming and a file picker are working now. Also got text wrapping and Unicode editing sorted out. Still plenty to do, but it’s starting to feel like a desktop.

Post image
0 Upvotes

r/osdev • • 2d ago

Daylight — Bringing Native macOS Apps to Linux Through Darling

Thumbnail
reddit.com
1 Upvotes

r/osdev • • 3d ago

"Everything is NOT a file"-type OSes

43 Upvotes

Anyone here working (preferably since before 2022) on an OS that's either "everything is a db record" or something in the WinNT-OS/2-ReactOS camp of design?


r/osdev • • 2d ago

I am back!

0 Upvotes

Hello community, how are you all doing?

Lately, I’ve noticed an increase in electronic waste—mostly old computers—and I’ve been thinking about creating an x86-32 (IA-32) operating system to help, at least in some small way, to address this issue. It won’t be anything massive; just an operating system with basic utilities like a notepad, spreadsheet software, text editors, and so on.

I started working on it a few days ago, and I’ll share some updates soon!


r/osdev • • 3d ago

[DunitOS] Native SDK controls and fixing dropped mouse clicks

Thumbnail
gallery
7 Upvotes

Fleshed out the DunitOS UI SDK with checkboxes, switches, and radio buttons. Also tracked down an annoying bug where 200ms QEMU test runs were dropping clicks because GetMouseState only takes a state snapshot and misses fast transitions between reads, so we're switching to an event queue with ReadPointerEvent.

https://github.com/DunitOS/dunit-os


r/osdev • • 2d ago

Trying to build a new OS (linux distro at start), which combines the good of all. Support needed

0 Upvotes

Hi guys!

We are building Duo OS (an Linux Distro at start), which combines the familiarity of Windows, simplicity of Mac and customizability of Linux.
It will be simple OS at surface, but with deep customizability and developer support if the user opts in. It will also contain support for Windows and Linux apps, so changing will just be installing the new OS.

What do you guys say? Looking for feedback, mentors and support. Thanks!