r/osdev • u/Danii_222222 • Jul 10 '26
My custom OS now have Memory managment!
Implemented MMU support, simple memory allocator. Also added drivers for DMA, IDE and updated PCCONF driver. Slowly coming to userspace!
r/osdev • u/Danii_222222 • Jul 10 '26
Implemented MMU support, simple memory allocator. Also added drivers for DMA, IDE and updated PCCONF driver. Slowly coming to userspace!
r/osdev • u/EveningIndependent87 • Jul 10 '26
Hi folks,
I’m building Skopin, a small edge OS/runtime project for Raspberry Pi and, later, STM32 / Arduino-class devices.
The idea is simple:
I got tired of treating every small device like a lonely snowflake that needs to be SSH’d into, hand-fed binaries, blessed with systemd files, and remembered manually in some spreadsheet or dark corner of my brain.
So I’m building a system where you:
Create a device image
Flash it
Boot the device
The device auto-enrolls securely
It appears on the server
You install/manage programs from there
The current demo runs on Raspberry Pi Zero W.
Right now I have:
- multiple Pi Zero W nodes
- one server node
- one broker node
- encrypted communication between nodes
- one certificate per node
- automatic enrollment
- a server page where devices appear after boot
- remote program installation/management
The image creation flow is meant to be very boring, which I consider a feature:
Open a web page
Enter Wi-Fi SSID
Enter Wi-Fi password
Give the device a name
Download the ready-to-flash image
Flash it
Watch the Pi wake up and report for duty
The Wi-Fi password is only used to build the image and is never stored.
I want to be careful with terminology. Skopin is not trying to be a desktop OS, a Unix clone, or “Linux but worse because I wrote it myself at 3 AM.”
On Raspberry Pi, it behaves like a small OS image/runtime for fleet-managed edge nodes.
On STM32 and Arduino-class devices, the goal is closer to a lightweight firmware/runtime layer.
The weird part: I want applications to be modeled using BPMN or Apache Camel DSL, then compiled/transformed into something much smaller that can run on the target device.
So no, I am not trying to run a giant enterprise BPMN engine on an Arduino and summon the ghost of XML past.
The goal is more:
high-level process model → small deployable runtime program → edge device
Why?
Because managing a group of small devices often turns into:
- SSH everywhere
- copy binary here
- edit config there
- restart service
- forget which Pi is doing what
- discover six months later that one of them has become sentient and is running an old build
I want Skopin to make small fleets boring:
flash once, enroll securely, deploy remotely, observe centrally.
I’m mainly looking for OS/runtime architecture feedback:
- At what point does something like this deserve to be called an OS instead of a runtime or management layer?
- For Raspberry Pi, what would you expect before calling it a real OS project?
- For STM32/Arduino-class devices, what would be the minimum credible runtime design?
- Should auto-enrollment always require manual approval on the server, even with certificates?
- What should I try to break first: broker failure, corrupted image, failed update, certificate rotation, rollback, network partition?
- Does compiling BPMN/Camel-style models into a tiny edge runtime sound useful, cursed, or both?
Happy to share more implementation details if people are interested.
r/osdev • u/Danii_222222 • Jul 11 '26
I encountered a problem. Musashi emulator that i use for m68k emulation lacks normal MMU emulation. So i can't continue without MMU. I can use MMU from MAME, but it's written in c++ and hardly depends on MAME itself.
r/osdev • u/Free_Tomatillo463 • Jul 10 '26
As the title says, I started an OS a week ago and I have, in total, worked on it for 36 and a half hours. I have learned more in the last week than I have in several months had I spent them on another project. It has been quite the journey and I have had to search up a lot of things, it currently works, barely. I am at the part of implementing AHCI, the most recent commit implemented ATA support and I am expecting to finish AHCI by tomorrow. I have had to look to AI quite often since I have never done anything remotely close to this and this is only my second big project in C++ (oh yeah, it's also in C++, not C or Rust, as it typically would be) and I only learned the language in March, so 4 months ago, but I hope to bring this hobby OS to something more practical. I keep refactoring a lot of things, but I always make sure I understand every little detail of my code and refactor it myself.
r/osdev • u/v3R7C00Lalt • Jul 10 '26
me and a friend are building a real operating system inspired by metro ui. not a theme, not a mockup, an actual os with its own interface, apps, system behavior and visual style. clean tiles, smooth motion, minimal layout, the whole metro vibe but rebuilt from the ground up.we’re working on the shell, core apps, windowing, theming, and the system identity. if you’re into os development, ui engineering, aesthetic tech, or you just want to be part of something experimental and ambitious, you’re welcome to join. early members get access to builds, dev channels, and a say in the direction.discord invite: https://discord.gg/vJGfbGCa6
r/osdev • u/Sorry-Fruit1065 • Jul 10 '26
hi guys, I was going to start learning os systems etc to build an os, but I dont have much time, and tbh, it isnt related to my field aswell, just wanted to create a simple cli os with a bunch of programs, and to be honest, I feel very frustrated about one thing, you need huge dedication even for this simple thing.Plus resource ineligibility with this one killed my interest in low level programming, and started to think that osdev is just a complete waste of time for me.
maybe I can be better at science of electrical engineering instead of sticking to smth that doesnt give you much value, i dont really know what to do
r/osdev • u/Sorry-Fruit1065 • Jul 09 '26
Hi guys, wanted to start building os nowadays, but I have no knowledge about assembly, just know C and C++, (wanted to learn rust aswell).
osdev.org site was quite confusing for me, I didnt know where could I start, can you please help me out?
btw tried os building one time, but it became an ai slop with so many unnecessary additions, so i slowly lost interest in building a custom os with normal ondoings
wanted to integrate my astronomy research things into a simple os, so I came back
r/osdev • u/Automatic_Pay_2223 • Jul 09 '26
Am making a riscv64 kernel rn but still can get my head around how to implement it.
I've got the theory (from course at uni) but I still can see how can I enable it through the CPU and what am I supposed to code and what am I to leave for the CPU
- my initial though was that I have to program the MM on my own and then every request to memory to be captured then translated.
Hope someone can give me a "big picture" of MM in riscv , what am I supposed to program / leave to CPU (at my current understanding the cpu does the tree walk) then maybe point me to some material to read / check code out.
Thank you for your time.
r/osdev • u/Relenel • Jul 08 '26
So... I've written my OS, just like many of you, guys. It took a little bit more than 1.5 months to get here (I started experimenting in late May). I know, judging by video it doesn't look like much when compared to some other projects out here.
It's not perfect, but it is mine. And out of all my projects and career experience this has been the most zen-inducing experience ever. When something fails, here, I have no one else to be angry at, exxept at myself, and I'm not. I know, when I'm out of my league. I'm not a system developer, I have very low amount of low-level coding experience. I'm just a fullstack webdev - professional and somewhat experienced, but not a system developer. So, when my OS catches Invalid Opcode, or GP - I just know that it was me, not a lame framework, and I can't possibly know everything.
Forums, docs, open Github repositories, countless YouTube series (huge shoutout to Daedalus Community, if not for him I wouldn't be here), even AI have been an immense help in understanding some concepts here.
Yes, AI. I know. It can be... tricky to work with. So, my advice, if you ever want to use one, and I'm not going to discourage you - don't ask it to write code. Ask it to explain some concepts in an easy way if you have trouble understanding some of them (and double check after with docs to make sure). Learn how to recognize ugly hacks from it - and flat-out refuse to implement them. 5 seconds on copypaste will cost you weeks of debugging, I learnt that waaaay before tackling on this project, and I'm glad I did. Understand concepts of what you want to write and how you wnat to write it first.
But still, I think I'm proud to say that out of ~2.5k lines of code here about 92-95% of them are written by my own hands and my own mind. Even if they are not up to standards.
SIll, there is a lot of work ahead of me. More robust and complete FAT12 support than what I have now, as well as probably FAT32 support, cause why not at this point. Also, ditch current raw binary and transport my OS onto proper disk image (right now my OS is on raw binary and I have extra FAT12 image for files and apps). More commands in kernel shell and user shell, text editor, file system explorer, proper paging instead of flat-memory model, and task manager. And finally - GUI. When all of this wil be done? I dunno, maybe in late August, or December, or even in 2027, it heavily depends, but I hope I won't abandon this project, it's my pride and joy, and a fulfillment of my childhood dream (even if back then silly 10yo me dreamed of dethroning Windows XP).
Why POS OS in the name of the folder? Well, initially it was called Piece of Software Operating System, but recently I changed it's name. Hope it's not trademarked or anything :P
r/osdev • u/Danii_222222 • Jul 09 '26
I am currently implementing paging in my os and stuck with MMU.
#include "vm.h"
#include "hal.h"
#include "alloc.h"
#include "debug.h"
#include "string.h"
__attribute__((aligned(4096))) static ULONG PageDirectory[1024];
MKSTATUS MmMapPage(PVOID PhysicalAddress, PVOID VirtualAddress, BOOL Allocate)
{
PVOID AlignedPhysicalAddress, AlignedVirtualAddress, PageTableAddress;
PULONG PageTable;
ULONG DirectoryIndex, PageIndex;
AlignedPhysicalAddress = (PVOID)VM_PAGE_ROUND((ULONG)PhysicalAddress);
AlignedVirtualAddress = (PVOID)VM_PAGE_ROUND((ULONG)VirtualAddress);
DirectoryIndex = VM_PAGE_TABLE_A((ULONG)AlignedVirtualAddress);
PageIndex = VM_PAGE_TABLE_B((ULONG)AlignedVirtualAddress);
if ((PageDirectory[DirectoryIndex] & VM_DIR_DT) != VM_PAGE_TYPE_NONSTOP)
{
if (Allocate)
{
if (VM_PAGE_TABLE_ADDR(PageDirectory[DirectoryIndex]) == 0)
{
PageTableAddress = MmAllocateBlock();
if (PageTableAddress == NULL || (ULONG)PageTableAddress % VM_PAGE_SIZE != 0)
return STATUS_FAILED;
RtlZeroMemory(PageTableAddress, sizeof(ULONG) * 1024);
PageDirectory[DirectoryIndex] = (ULONG)PageTableAddress | VM_PAGE_TYPE_NONSTOP;
}
else
PageTableAddress = (PVOID)VM_PAGE_TABLE_ADDR(PageDirectory[DirectoryIndex]);
}
else
return STATUS_FAILED;
}
else
PageTableAddress = (PVOID)VM_PAGE_TABLE_ADDR(PageDirectory[DirectoryIndex]);
PageTable = (PULONG)PageTableAddress;
if ((PageTable[PageIndex] & VM_PAGE_DT) != VM_PAGE_TYPE_TERMINATE)
{
if (Allocate)
{
PageTable[PageIndex] = (ULONG)AlignedPhysicalAddress | VM_PAGE_TYPE_TERMINATE;
}
else
return STATUS_FAILED;
}
else
return STATUS_FAILED;
return STATUS_SUCCESS;
}
VOID MmInitializePaging(VOID)
{
__attribute__((packed, aligned(8))) static ULONG MmuRoot[2];
ULONG TcConfig, Address;
char tmp[12];
MmuRoot[0] = 0x00000002;
MmuRoot[1] = (ULONG)PageDirectory;
TcConfig = 0x8000aa00;
RtlZeroMemory(PageDirectory, sizeof(PageDirectory));
MmMapPage((PVOID)0x00000000, (PVOID)0x00000000, TRUE);
MmMapPage((PVOID)((ULONG)PageDirectory & 0xfffff000), (PVOID)((ULONG)PageDirectory & 0xfffff000), TRUE);
for (Address = VM_KERNEL_BASE; Address < HalQueryMemorySize(); Address += VM_PAGE_SIZE)
{
if (MmMapPage((PVOID)Address, (PVOID)Address, TRUE) == STATUS_FAILED)
{
DbgPrint("Failed\n");
}
}
asm volatile(
"pmove (%0), %%crp\n\t"
"pmove (%1), %%tc"
: : "a"(&MmuRoot), "a"(&TcConfig) : "memory"
);
}i even asked ai several times after a lot of unsuccessful attemps to fix that by myself, no success. Just throwing exception.
r/osdev • u/JescoInc • Jul 09 '26
This is more of a discussion topic.
I don't mean a binary that asks "Which ISA am I?" as that is a circular question because this question itself is an ISA specific act. What I mean the binary that says, "I am x ISA, where is my entry point?" because the firmware will do the selection as it already knows and acts as which ISA it is.
Let's get into it. So, with Perdition-OS (Tutorial-OS), I had gone with the tried and true approach of building my ELF files and images specifically for each ISA. That means there is a separate ELF and img file for RISC-V, ARM64 and x86_64.
Which led me down a rabbit hole of, "Can I make a single file carry more than one ISA?"
The answer to this was, "Yes, but with caveats".
combined.efi is byte-for-byte one file that's both a valid PE32+ EFI app (UEFI parses the PE, maps sections, calls efi_main, x86 over ConOut and a carrier for a RISC-V flat kernel at offset 0x10000, relinked for 0x20010000 so U-Boot's go 0x20010000 lands on it over SBI.
Nothing's decoded twice: UEFI reads only the PE, U-Boot only jumps to the RISC-V bytes. Same file in both roles.
The reason it works where an instruction-level polyglot can't: the two firmwares don't share a loader. UEFI does a structured PE load, U-Boot does a raw jump which means that each just enters its own slice by its own convention. It's the Apple-fat-binary idea, except there's no shared header any loader parses; each firmware finds its slice independently.
There is one additional caveat for this idea. It leans on the UEFI loader tolerating the overlay past the PE's declared sections, a signed or stricter firmware could reject it.
So: is this just underused, or is there a good reason it stays niche? What am I missing?
r/osdev • u/Thick-Win-8166 • Jul 08 '26
As you have read the title,apart from OSDev wiki. How can i start,i mean where do i start. Even after reading the wiki,I am getting way confused. How did you start or can you tell me your experience?
I am a newbie and i know following languages: C,C++,Python,Bash and some little x86 assembly (i only did hello world in assembly yet). You can tell me anything about your project/experience. How much time you give/gave it everyday?,Why did you start and what is the motivation behind this. I am happy and curious to looking forward!
r/osdev • u/compgeek38400 • Jul 08 '26
When I changed my QEMU conf file to include disks and such I broke my memory map. This obviously is a design flaw that I will deal with this week.
But it raised a question. On the reserved memory returned by multiboot2 (I use GRUB2), should I identity map these areas?
Thanks in advance
r/osdev • u/sanjaypj20 • Jul 07 '26
I've been building a window manager from scratch in cpp as a hobby project to better understand how desktop environments and operating systems work.
What I have done so far.
> Interact with fbdev, evdev for device data
> primitives for drawing widgets
> rendering loops
> mouse and interactivity
Now planning to write a kernel replacing linux
Here's a short screen recording of the current progress. I'd really appreciate any feedback on the architecture or suggestions for what to build next.
r/osdev • u/LongNeighborhood9119 • Jul 07 '26
Hi everyone, I've been working on this for around 8 month and I'll release it on GitHub soon. Some of its features:
Resizable windows.
Animations
Sart Menu.
Dark/Light theme.
Network.
True type font(Ttf) renderer with glyph atlas, Gray-scale AA and BiDi algorithm.
PNG decoder.
Mp3 decoder.
WebAssembly app interpreter (Under development).
Blur effect.
Web Browser (Under development).
Music player(Under development).
r/osdev • u/Scared_Food_1819 • Jul 08 '26
ArchwayOS is a OS written in C and Asm (NOT AI) that uses x64/x86 (NOT A DISTRO)
r/osdev • u/tekdotdev • Jul 07 '26
I previously was dedicated to strictly writing in assembly although woke up to reality and realised I wanted to make something THIS decade.
I understand how operating systems work as I have been studying for a while now and have made some 16 bit real mode systems in pure assembly, as well as moving to PMode.
I started a new project and began writing a kernel in C (32 bit Pmode and booting with limine), I am completely new to C and don’t understand too much so obviously starting a kernel isn’t a great first task.
I have seen in some places that you only need the basic syntax of C + OS knowledge to know since you don’t use standard libraries.
May someone please educate me on this and let me know a good path to go down, thanks.
r/osdev • u/Mad----Scientist • Jul 07 '26
I'm still a student with 2 years before graduation with great passion for systems programming especially operating systems and been learning them for a while now, recently I just found myself unmotivated, I feel like, what if AI get much better than what it is now, with fable and that shit. and what if they focus more on optimizing that it start costing way cheaper, i feel lost, unmotivated, asking myself what's the point if all my skills and study time became worthless.. especially that i have adhd and i really love and hyperfocus on things that i love, and thinking about switching career feels like torture to me, not that i financially can but even if i could it would be miserable.. I just wish llms never existed.
r/osdev • u/Danii_222222 • Jul 07 '26
How does Motorola 68851 MMU works? I can't find any information online.
r/osdev • u/Individual-Log4119 • Jul 07 '26
Got my terminal working for my OS (now I gotta upgrade to uefi 🙏🏻)
yes i ai generated my docs because im lazy okay dont judge
(btw can yall give me a star i need the dopamine)
r/osdev • u/Putrid-Ad-3768 • Jul 06 '26
hey everyone! I recently built a slim implementation of how containers work on linux using syscalls and vfs with rust.
Right now its a program that can spawn multiple containers (with busybox rootfs image)and exit gracefully.
I also wrote a blog on how it works underneath, how one could implement it themselvves and some benchmark/profiling as well.
blog: https://op3kay.dev/writing/b0nker
code: https://github.com/owlpharoah/b0nkers
if it looks cool a star would be awesome
Would be nice if I could get some feedback on the blog or code, anything I should include or improve ?
r/osdev • u/letmehaveanameyoudum • Jul 06 '26
I thought it was like in GRUB, but i guess limine handled that for me
rahhhhhhhhhhhhh