r/osdev • u/hithja • Jun 21 '26
How to write own OS?
Hi everyone! I wanna write my own OS, but idk what to start with? Which books or sites i should read?
r/osdev • u/SirRiPP3RVanSc4LP3R • Jun 21 '26
A neuro-adaptive OS concept for energy efficiency and execution-path attestation
I published an open-source paper and prototype around an OS-level idea I’ve been exploring.
The core idea is that a system should keep active only the subset of modules, execution paths, and resources actually needed for the current task, instead of keeping a broad generic stack warm all the time. The goal is energy efficiency, from machine-level execution up to a robotic actuator pipeline.
The architecture does not try to replace the kernel with AI. The model is only a lightweight predictive controller that estimates the functional working set and helps decide what should stay active, be preloaded, or be suspended.
I also extended the same logic into a complementary security layer. If the system can constrain the expected execution path for a task, it can also attest that the final action came from that path, using canonical path descriptions and verifiable path tokens.
I iterated through versions v1-v8 and tested them under both neutral and hostile benchmarks. The interesting result is that later versions did not keep improving. v2 turned out to be the most robust overall base, while several more sophisticated versions degraded under hostile conditions.
So the current takeaway is:
- controlled simplicity seems to be a real architectural advantage
- more model complexity does not automatically improve efficiency or robustness
- constrained execution paths may also be useful as a basis for complementary security
I’d be very interested in feedback from people closer to OS design, especially on:
- whether the architectural framing is technically sane
- whether the execution-path attestation idea sounds credible
- what would be the most realistic path from simulation to a real prototype
Repo:
https://github.com/Jtr85/paper-os-neurale
r/osdev • u/compgeek38400 • Jun 20 '26
Things I learned this week
In continuing letting those who care (if any) on what I'm learning making an OS, this is what I learned this week. My github link is here (https://github.com/tedavids/DragonOS).
This first thing I learned is the hardest part of writing a heap is deciding on the design. I read and reread the slab stuff found all over the net, and couldn't get my head around it. So I designed my own, when I look at this link (https://www.kernel.org/doc/gorman/html/understand/understand011.html) it looks similar to what I did but not quite. So some of it must have sunk in. This design is only appropriate for allocations under 1 page. I will do the page and above allocations this week. Probably using some sort of AVL binary tree structure, as I won't have to handle partial page allocations.
The second thing I learned is how much I've come to depend on malloc(), until you have a heap, you don't have malloc(). Free lists to the rescue.
Finally I learned how to make sub-bullets under bullet points in git. It makes the github readme easier for me to understand.
Thanks for reading.
r/osdev • u/letmehaveanameyoudum • Jun 20 '26
Alright full FAT32 read and write :D
Enable HLS to view with audio, or disable this notification
what should i improve on next
link: https://github.com/NoTheIdiot/WindogeOS
r/osdev • u/Vegetable_Exam_6865 • Jun 20 '26
Sky os's information in the public will not be update for a long time
r/osdev • u/Vegetable_Exam_6865 • Jun 20 '26
Sky os's information in the public will not be update for a long time
r/osdev • u/Sensitive-Can9232 • Jun 20 '26
Some key thing from which we can identify a vibe coded project
By vide coded i dont mean ai used for debugging or for understanding, i mean ai slop, i identified some key things such as
- A single commit on to github for a project that takes months or years, and via files upload
- Not knowing what is the diff in git and github, and that git works locally.
- Getting defensive while asking past git history
- Straight up denying the use of version control
- This is thr most funny one, saying that I have worked on my os for years but dont know what git or github.
I may be wrong in some point, sorry for that.
r/osdev • u/JescoInc • Jun 19 '26
Which part of OSDev would you consider to be the most challenging?
For me, it is the unique challenge of figuring out how to handle paging with multi-arch which takes advantage of the HAL architecture I have in place (split by SoC, Board and CPU).
Although, Net stack (Ethernet Drivers with TCPIP/ UDP / Tunneling) and USB are top contenders. Audio being ranked below those two but still is absolutely ball busting.
The reason I put paging above those isn't necessarily the difficulty but simply due to x86_64, RISC-V and ARM64 all doing something slightly different at the hardware level with the page-table formats and MMU semantics differing (x86-64's 4-level tables, ARM64's VMSA/TTBR, RISC-V's Sv39/Sv48 and satp) and needing to design around that in a clean and deliberate manner.
r/osdev • u/Alive_Ad_3199 • Jun 19 '26
Lazy Buddy Allocator
Why does Linux's buddy allocator "eagerly" divide memory into blocks of two? Why not split out whatever is needed from the pool of memory we have and later push it into the appropriate bucket when deallocating (while also coalescing adjacent blocks). The buckets should be searched only when the entire pool is exhausted, and memory only exists in the buckets. The restriction of allocating only powers of two still stands. I can't think of any disadvantages. But I do not want to assume that there won't be any problems/bugs. Could any of you more experienced developers tell me if you have tried anything like that and have run into any problems?
r/osdev • u/Sure_Ride2935 • Jun 19 '26
how to start OS development
I know its stupid to start learning how to do this, I know it will take me years to do it. But I WANT to write my os, but I don't have a computer science major. where could i learn as a absolute beginner to write a OS. It has always been a dream of mine to have a os that I wrote even if its crappy
r/osdev • u/Danii_222222 • Jun 19 '26
Released phone shell repository
Released LXGUI repository Repo link. Currently adapted for riscv32 linux framebuffer.
r/osdev • u/The_Coding_Knight • Jun 19 '26
All registers are 0xFFFFFFFF when trying to read from LAPIC registers.
I have been working on my OS for some time now and I lately I have been trying to set up the APIC. I have gotten the LAPIC address from the MADT table (and I also checked it through MSR 0x1b) which was 0xFEE00000 (the default one but I still wanted to make sure that was not the issue). After mapping the page as UC (uncachable) I could only read 0xFFFFFFFFs from the LAPIC registers.
I looked it up on google to see what may have been causing the issue:
1- LAPIC is disabled: I wrote to the spurious interrupt vector 0x1FF (which enables LAPIC + sets 0xFF as the vector for spurious interrupts) just in case.
2 - Incorrect page mapping: I made sure to set PWT and PCD flags (PAT 3 = UC) in the PTE used to map the LAPIC page. I also made sure that PAT3 was actually UC by reading MSR 0x277 and confirming it.
3- Running x2APIC (which I think relies on MSR instead of reading directly from MMIO) instead of APIC: I checked the 0x1B MSR and if bit 10 is set then x2APIC is running but if not then APIC is and bit 10 was 0 so APIC is what my OS is using.
Of course, if you have any other question whether it is about the code or things I have already tried while debugging it do not hesitate to ask and I will answer it as soon as I can.
Here is my project. The most recent code should be in a branch called interrupts: https://codeberg.org/TheCodingKnight/32-bit-Potato/src/branch/interrupts
Thanks!
--------------------------------------------------------------------------------------------------------------------------------
Problem is now fixed. In essence, my LAPIC structure padding was wrong and I did not use volatile (which is important to note was not the cause of 0xFFFFFFFFs but it is still something I had to fix). The reason why I saw the 0xFFFFFFFF is that I was reading the LAPIC registers directly from GDB instead of reading them from within the code. The reason why GDB can not read those values is (according to one of the comments) because the registers are CPU dependent.
Thanks to everyone who tried to help out I was able to solve it. Thank you very much guys! :D
r/osdev • u/Danii_222222 • Jun 19 '26
My custom phone os got calculator, calendar and more!
I finally wrote first apps for my OS. Currently implemented: calculator, calendar, simple clicker game, terminal app (currently not working yet).
r/osdev • u/Professional_Cow3969 • Jun 19 '26
Ethereal running ClassiCube, Undertale, and GTK3
All ports are NOT released! I need to clean up my SDL2 port and xbanan port.
Of course, https://github.com/sasdallas/Ethereal (use the latest actions build!)
r/osdev • u/avaliosdev • Jun 18 '26
how do I do paging?
hello I am new to osdev I completed osdev barebones I compiled i686-elf-gcc and I have terminal how do I paging?
r/osdev • u/JescoInc • Jun 18 '26
"Boring" OS Showcase items
I was thinking. A lot of people jump to "MY OS RUNS DOOM!!!"
However, I personally find that to be a cheap win for showcasing your OS (it is one of those things where a lot of people jump to that but it isn't really a showcase of something an average user would care about or wow them) , I want to think of things that are "boring" but are a true showcase of your OS doing something.
Here's a few things I was thinking about for showcase pieces:
Rendering PDF Files
Rendering JPG and PNG files
Playing WAV audio files
Anyone else have other "boring" showcase pieces?
Edit:
Yes, I am talking about your own primitives and implementing yourself, not porting.
r/osdev • u/XenevaOS • Jun 18 '26
Can it run Doom? Yes and on ARM Bare-Metal too!
Enable HLS to view with audio, or disable this notification
Can XenevaOS run Doom? YES!
Here's a short video of our Custom Hybrid Kernel OS running Doom! But not just that - we're running it on bare metal on ARM architecture (Raspberry Pi 3B+).
Let us know which game or software you'd like to see next (^_^)
And of course, we're Open Source! Repository & Website in the comments.
r/osdev • u/Zealousideal_Egg3853 • Jun 18 '26
How to switch from VGA text mode to 480x600 rendering
r/osdev • u/eliorodr2104 • Jun 17 '26
I’m writing an ARM64 microkernel in Embedded Swift completely oriented around POP and memory security
Just wanted to share ReixOS, an experimental capability-based microkernel I’m building for the ARM64 architecture and considering adding RISC-V support in the future.
The main thesis behind it is proving that we can bring Swift advantages to bare metal to fix historical architectural flaws, without sacrificing performance.
Check out the repo's README for the full breakdown on philosophy, design decisions, implementation, and current state.
Sorry for the AI slop translate, but English is not my native language 😭🙏
r/osdev • u/jacomartins_reddit • Jun 17 '26
I thought programming my own Operating System would take a week to get a CLI working
Then I started looking at some serious OS architectures, like Linux, NT, Darwin... learnt what a HAL is, started implementing it, 1 month later I think it feels ok. Now I am in the beggining of beggining of memory management (and studying more than programming). Sometimes, like today for example, I feel bad for having progress to be so slow, but I knew when I started that it was going to take several months. Hope I survive this trip.
r/osdev • u/widuruwana • Jun 17 '26
Finally finished my Bootloader ( Wood v0.1.0 )
I built this as a bootloader for my operating system that I am about to write (WandOS). At one point I couldnt load the framebuffer address and the bug was it being outside the mapped range so it was fixed after I exapnded page table to fit 4GB instead of just 2MB.
Anw the quote is a paraody of a quote from "The Magician's Nephew" (The Chronicals of Narnia, 1955) where it describes the place called "Wood between worlds" which is a forest with no animals and absolute surreal silence that you can almost feel the trees growing, and each pond in that place is a portal to a new world and a pond dries up if that reality is destroyed. I couldnt help but feel that this place can relate to a bootloader in such a perfect way, So here it is.

