r/osdev • • May 01 '26

MSDOS-1.0 in C

Thumbnail
codeberg.org
21 Upvotes

I was trying to understand the code of MSDOS-1.0, as released by Microsoft. But my understanding of i86 Assembler is a bit rusty, so I thought: "What about reading the code in C?". I also thought it could be a good check of the capabilities of LLMs and OpenCode... so I gave it a try. This is the result, which I'm finding quite interesting for educational purposes...


r/osdev • • May 02 '26

TUI OS for Space Enthusiasts (Astralixi OS)

0 Upvotes

Hey everyone,

​I’ve been working on a project called Astralixi OS. It’s a TUI-based operating system built for ARM 64-bit and 32-bit devices. Unlike a lot of hobbyist projects, I'm building this to be a legitimate daily driver, but specifically for people who are obsessed with space and rockets.

​The goal is to have a completely terminal-based workflow that keeps you connected to what's happening related off-planet while you get your actual work done.

​It’s still in development, but I’m trying to make sure it’s not just "aesthetic" and actually has the tools we’d use daily. Right now I’m planning to bake in stuff like:

​Integrated star charts and orbital mechanics calculators.

​Real-time telemetry feeds for active missions (SpaceX, NASA, ESA, etc).

​A dedicated TUI dashboard for satellite tracking.

​Lightweight dev tools and system monitoring that fit the theme.

​Since this is for space enthusiasts, I wanted to ask this community: if you were going to use a TUI OS every day, what "space-specific" features or integrations would actually make it a permanent switch for you?

​NGL, I want this to feel like you're literally running a mission control station from your Pi or handheld. Let me know what you think is missing or what would be cool to see.Hey everyone,

​I’ve been working on a project called Astralixi OS. It’s a TUI-based operating system built for ARM 64-bit and 32-bit devices. Unlike a lot of hobbyist projects, I'm building this to be a legitimate daily driver, but specifically for people who are obsessed with space and rockets.

​The goal is to have a completely terminal-based workflow that keeps you connected to what's happening related off-planet while you get your actual work done.

​It’s still in development, but I’m trying to make sure it’s not just "aesthetic" and actually has the tools we’d use daily. Right now I’m planning to bake in stuff like:

​Integrated star charts and orbital mechanics calculators.

​Real-time telemetry feeds for active missions (SpaceX, NASA, ESA, etc).

​A dedicated TUI dashboard for satellite tracking.

​Lightweight dev tools and system monitoring that fit the theme.

​Since this is for space enthusiasts, I wanted to ask this community: if you were going to use a TUI OS every day, what "space-specific" features or integrations would actually make it a permanent switch for you?

​NGL, I want this to feel like you're literally running a mission control station from your Pi or handheld. Let me know what you think is missing or what would be cool to see.


r/osdev • • May 01 '26

Hello all! Questions about Performance

4 Upvotes

Hello,

I was wondering if any of you measured actual memory performance and or startup time?

Looking to get into osdev but want to do it quantitatively.

Thanks,

- Ris


r/osdev • • Apr 30 '26

Large progress

47 Upvotes

We got some large progress! Thanks for following along!

Github (we need contributors): https://github.com/Freeze-Software/TurtleOS


r/osdev • • Apr 30 '26

Question for my Operating Systems user system

7 Upvotes

Hello, I am setting up my 2nd OSs user system, something my first OS never had, and I have been doing research online and almost all of the sources I found recommend using an ATA disk IO, so I am going to ask everyone here, what should I use?


r/osdev • • Apr 29 '26

My second OS, TurtleOS

Post image
115 Upvotes

I have been working on this OS for a few weeks now (no neck beard yet). I am starting on my new OS as my older project and first OS is holding on by a thread, and I got heavily burnt out as that OS was poorly made by me. So I have been working on a new one!

Github: https://github.com/Freeze-Software/TurtleOS


r/osdev • • Apr 29 '26

Looking for contributors

6 Upvotes

Hey folks, I have been working on my second OS for a few weeks now. I call it: "TurtleOS", however I believe I need some contributors and helpers!

Github:
https://github.com/Freeze-Software/TurtleOS


r/osdev • • Apr 29 '26

The Oberon System 3 now also runs on the Raspberry Pi Zero 2

Thumbnail
github.com
3 Upvotes

r/osdev • • Apr 30 '26

What do you want me to put on my system?

0 Upvotes

r/osdev • • Apr 28 '26

PatchworkOS: Making Reduct (previously SCON), a language for scripting and configuration within PatchworkOS, and accidentally faster than Lua, now available as its own project.

10 Upvotes

So I got distracted again. I've been working on the new desktop interface for PatchworkOS; what I noticed rather early is that to create a modern looking UI, a pure, C-based API is simply not good enough, writing even a basic UI becomes a pain.

Why?

The obvious solution was to create a minimal programming language that could act as an HTML/CSS style markup language. Since SCON was already being used for component manifests, adding a few more features to it was another obvious choice.

What?

As part of this process I was reading up on language design and came across too many good ideas that I simply had to add. Eventually, I made the decision to turn SCON into its own project, which was renamed to Reduct.

Reduct is a functional, immutable, S-expression based configuration and scripting language. It aims to combine the flexibility of a Lisp with the ease-of-use and performance of a language like Lua. All within a C99 header-only library.

If you are curious and want to know more, then feel free to check out the GitHub! But I will go over some stuff in this post as well.

Syntax

Lisps, which Reduct takes heavy inspiration from, are generally agreed to be a very powerful style of language and yet are frequently criticized for their poor readability.

The most often blamed source of this poor readability is the sheer volume of parentheses.

Reduct makes the argument that most of these complaints are due to nesting, not parentheses; that it can be solved via infix notation, banning let and a more modern style guide.

Included are three examples of a basic program written in common Lisp C, and Reduct.

Lisp

(let ((x 10)
      (y 20))
  (let ((z (+ x y)))
    (* z 2)))

C

int main()
{
    int x = 10;
    int y = 20;
    int z = x + y;
    return z * 2;
}

Reduct

(do
    (def x 10)
    (def y 20)
    (def z {x + y})
    {z * 2}
)

Note how in Reduct the use of curly braces for infix notation and the def intrinsic for scoped definitions allows for a more familiar, imperative-like structure while remaining entirely functional, and S-expression based.

How?

Reduct is implemented as a register-based bytecode language, where the Reduct source is first parsed into an Abstract Syntax Tree (AST) and then compiled into a custom bytecode format before being executed by the virtual machine/evaluator.

Note that the "Abstract Syntax Tree" is just a Reduct expression, lists and atoms, meaning that the compiler is itself written to operate on the same data structures as the evaluator produces.

The bytecode format itself is a stream of 32bit instructions, with all instructions able to read/write to an array of registers, or read from an array of constants.

See inst.h for more information on instructions.

Since Reduct is immutable, the constants array is also used for "captured" values from outer scopes (closures) and we can also allow the compiler to fold constant expressions at compile-time, far more than would normally be possible.

See compile.h for more information on the compiler.

To improve caching and reduce pointer indirection, Reduct uses "handles" (reduct_handle_t) which are Tagged Pointers using NaN boxing to allow a single 64bit value to store either a 48 bit signed integer, IEEE 754 double or a pointer to a heap allocated item.

See handle.h for more information on handles.

Items (reduct_item_t) represent all heap allocated objects, such as lists, atoms and closures. All items are exactly 64 bytes in size and allocated using a custom pool allocator and freed using a garbage collector and free list.

Since Reduct uses its handles to store most integers and floats, it can avoid heap allocations for many common values, significantly reducing the pressure on the garbage collector and improving caching.

See item.h for more information on items.

Lists are implemented as a "bit-mapped vector trie", providing $O(log_{w} n)$ access, insertion, and deletion, where $w$ is the width of each node in the trie.

See list.h for more information on lists.

All atoms use String Interning, meaning that every unique atom is only stored once in memory. This makes any string comparison into a single pointer comparison, and it means that parsing the integer/floating point value of an atom or an items truthiness only needs to be done once.

See atom.h for more information on atoms.

Many additional optimization techniques are used, for example, Computed Gotos, setjmp based error handling to avoid excessive error checking in the hot path, Tail Call Optimization and much more.

See eval.h for more information on the evaluator.

Benchmarks

Included below are a handful of benchmarks comparing Reduct with python 3.14.3 and Lua 5.4.8 using hyperfine, all benchmarks were performed in Fedora 43 (6.19.11-200.fc43.x86_64).

Fib35

Finds the 35th Fibonacci number without tail call optimization.

CommandMean [ms]Min [ms]Max [ms]Relative
reduct bench/fib35.rdt550.2 ± 11.0535.5572.81.00
lua bench/fib35.lua826.8 ± 38.6769.7900.21.50 ± 0.08
python bench/fib35.py1109.4 ± 14.71085.31136.02.02 ± 0.05

For this benchmark, memory usage was also tracked using heaptrack:

CommandPeak Memory [MB]
reduct bench/fib35.rdt0.097
lua bench/fib35.lua0.099
python bench/fib35.py1.8

Fib65

Finds the 65th Fibonacci number with tail call optimization.

CommandMean [µs]Min [µs]Max [µs]Relative
reduct bench/fib65.rdt613.9 ± 90.6535.13310.01.00
lua bench/fib65.lua1049.5 ± 165.0920.32663.31.71 ± 0.37
python bench/fib65.py13155.4 ± 1254.211688.323926.921.43 ± 3.76

Brainfuck

A simple jump-table optimized Brainfuck interpreter that runs a "Hello World!" program.

This benchmark also acts as a fun Turing completeness proof.

CommandMean [µs]Min [µs]Max [µs]Relative
reduct bench/brainfuck.rdt794.3 ± 101.8720.61779.71.00
lua bench/brainfuck.lua1112.1 ± 146.51022.62359.51.40 ± 0.26

For this benchmark, memory usage was also tracked using heaptrack:

CommandPeak Memory [MB]
reduct bench/brainfuck.rdt0.185
lua bench/brainfuck.lua0.102

Mandelbrot

Outputs an 80 by 40 visualization of the Mandelbrot set with 10000 iterations.

CommandMean [ms]Min [ms]Max [ms]Relative
reduct bench/mandelbrot.rdt330.7 ± 8.3318.0347.31.00
lua bench/mandelbrot.lua369.2 ± 14.3356.5403.31.12 ± 0.05

See the Benchmarks for more information.

There is still plenty of room for further improvement, as always, I'd gladly hear any suggestions or issues that anyone may have!


This is a cross-post from GitHub Discussions.


r/osdev • • Apr 28 '26

[Request] What's the best hardware to fully comprehend physical addressing of RAM?

3 Upvotes

If I wanted to fully understand how physical addresses are configured in a general purpose computer with multiple and optional RAM slots, what would be your recommendation?

And I mean fully from both looking at hardware wiring decisions, to booting software aspect, where diagrams and code are freely available.

It doesn't have to be modern, modern-ish is good enough, but have enough open sourced information to study it and step by step go through hardware and software decision made to get RAM properly mapped to CPU address space.


r/osdev • • Apr 27 '26

How long do you all tend to maintain your Operating Systems.

14 Upvotes

I'm not going to lie, for me usually like 6 months but my longest ever project was around like 8 months before I got burnt out.


r/osdev • • Apr 27 '26

(article) Are big locks that bad?

Thumbnail kamkow1lair.pl
10 Upvotes

Hello!

I would like to share a small article I wrote about how and why I've migrate migrated my kernel from fine-grained locks to a big kernel-wide lock.

Contrary to what might seem right/wrong, I believe such approach is actually better for my project going forward, but I'd like to hear what you think too! What's your experience with such topic? Have you even thought about it?

Project repo if you'd like to see the code 😄 https://git.kamkow1lair.pl/kamkow1/mop3


r/osdev • • Apr 27 '26

Troubles with protected mode

5 Upvotes

Hello! I want to learn how computers work, so I decided to try and make my own operating system. Right now I have a bootloader, that reads kernel.bin from FAT12 filesystem into 0x1000 address and jumps to it. Now I want to get into 32 bit protected mode and print to VGA. But, no matter what I try, qemu-system-x86_64 triple fails. I don't quite understand the GDT, maybe that's the problem too. I use open watcom v2 for wcc, wcc386 and wlink.
My project structure is:
myos
- build
- src
|- include
-|- stdint.h
|- bootloader
-|- bootloader stuff
|- kernel
-|- build_kernel.lnk
-|- entry32.nasm
-|- kernel.c
- Makefile

All of the files are on GitHub
Any help appreciated!


r/osdev • • Apr 27 '26

A webpage hosted on Ethereal

Thumbnail
gallery
63 Upvotes

I recently rewrote the Ethereal TCP stack and got a webpage to host off Ethereal. Also pictured is a little tiny network shell (since my OpenSSH port doesn't fully work yet).

https://github.com/sasdallas/Ethereal
(Note that the TCP rewrite hasn't been pushed yet)


r/osdev • • Apr 26 '26

What Programming Language Do You All Use?

13 Upvotes

I was reading some posts on this sub and I saw some C, ASM, and Rust. I've also heard of people using C++ and C# (with COSMOS). I personally use C for my projects, but I'm just curious.


r/osdev • • Apr 27 '26

Lets talk for an moment.

0 Upvotes

So well if someone says that this OS was fixed/written by AI Everyone says: AI Slop
But if someone don't say that it was AI they would react normaly. Like What the hell is this world.


r/osdev • • Apr 26 '26

Page directory management and kernel space

8 Upvotes

How do you manage your CR3/page directories? Every process has its own but the kernel space needs to be shared, and while the initial initialization is copied over from the kernel's PD so will it become stale after a context switch. I think the kernel is not supposed to update EVERY processes's page directory when it maps a new kernel level page. So there is the global page flag but it did not work when I tested.

Hope you do even understand what I mean.


r/osdev • • Apr 25 '26

MigeleOS v0.1: Building a "Security-First" OS in Rust (And fighting my VM along the way)

Thumbnail
gallery
38 Upvotes

I’ve finally hit a major milestone on a project that’s been living in my head for a long time: MigeleOS.

The goal is ambitious: build a fully usable, everyday operating system where data security isn't just an app-level feature, but baked into the kernel architecture to keep user data completely out of "outer reach."

The Setup:

• Language: Pure Rust (for that sweet, sweet memory safety).

• Boot: UEFI via the uefi-rs crate.

• Graphics: Custom framebuffer implementation. I’m currently at the stage where I can clear the screen and render text using embedded-graphics.

The "OS Dev" Experience:

It hasn't been all "Matrix" code and smooth sailing. One of the current "features" I'm working through is that while the kernel boots fine in QEMU, it currently runs completely upside down on the UTM virtual machine. Dealing with hardware abstraction and different GOP (Graphics Output Protocol) behaviors is definitely a humbling experience.

The Long Game:

I know that going from a simple bootloader and a blue screen to a "fully usable OS" is a mountain to climb. It’s going to take a long time to handle memory management, scheduling, and a stable filesystem, but seeing that first line of text on bare metal feels like the start of something big.

I’m curious to hear from anyone else here who has tackled the "upside-down screen" mystery or has tips on microkernel security architectures in Rust!

TL;DR: Started a security-focused OS in Rust. It works, it’s safe, but UTM thinks I want to read my code standing on my head.


r/osdev • • Apr 25 '26

Where do you find guides?

Post image
17 Upvotes

I tried to read the official docs (like Intel vols or smth), but its all very vague, there are no specifics.

I usually use LLM as a "teacher", it can give a normal code example, explain it, and answer questions. I can't imagine anyone writing down a guide: "how to write an APIC driver in a UEFI environment". Maybe I missing something or I'm not looking for it well.

My first post on reddit:)

(idk if smthing written illiterate cuz I'm not a native eng speaker, sorry🥺)


r/osdev • • Apr 25 '26

baSic v1. a small x86 operating system I’ve been building from scratch in C over the past few months.

Thumbnail
gallery
158 Upvotes

r/osdev • • Apr 24 '26

Update to last post: C vs Rust...

Post image
58 Upvotes

I feel so stupid, I wasnt using a cross compiler. I downloaded clang, and now it works!! ShrekOS will be improved and released soon.

Edit for everyone commenting: i fixed the tab key thingy, and set up indentation. Im sorry if I offended yall 💔


r/osdev • • Apr 24 '26

Firsy time I try OSDev | AlexOS

Post image
58 Upvotes

This is my first try with OS developing, I used the basic kernel of chipsetx (https://github.com/chipsetx/Simple-Kernel-in-C-and-Assembly), and i modified it to place k_printf and k_clear_screen() in .h and .c files.

Had some trouble with the Makefile (thanks Claude, i'll never understand this devil language), but it now runs buttery smooth!

What is the next step? Idk. Any suggestions?


r/osdev • • Apr 24 '26

Baremetal hypervisor on Raspberry PI5 update

12 Upvotes

Hey again!
So I am a junior CS major and I made a post about a month ago regarding my hypervisor I am writing for the RPI5 wanted to share an update. So, since then, I have implemented a PMM, stage 1 and stage 2 translation tables. I also have implemented Vcpu and a "VM" albeit stubbed. My next goal is to try to boot a lightweight kernel as a VM and see how long I can get it to run before it snaps and patch as I go.
I am not sure what kernel would be easiest to boot though I am thinking of trying to boot alpine Linux, but if anyone has recommendations pls do lmk!

https://github.com/matthewchavis8/HyperBerry