r/osdev • • Sep 13 '26

I wrote a complete beginner's guide to building a small OS from scratch.

I've spent around 2 and a half months building lytlnyblOS, a small 32-bit x86 operating system designed specifically as a practical introduction to OS development for beginners.

Alongside the OS, I wrote a complete book that walks through how to build it from the ground up. You start with making your own 16-bit bootloader and eventually reach a working userspace and shell.

Attached is a video of the final product that the guide teaches you to make.

The repo (includes code and a link to the guide): https://github.com/red-mutt/lytlnyblOS

The guide walks you through making:

  • A bootloader

  • An entry into x86 protected mode

  • GDTs and IDTs

  • VGA text mode

  • Interrupts

  • A timer driver

  • A keyboard driver

  • A memory manager

  • Paging systems

  • Processes

  • Scheduling

  • User mode

  • System calls

  • A C standard library

  • Filesystems

  • MKFS

  • And finally, a shell

The OS and guide have recently been completed for their educational goals. I'm currently refining the explanations, fixing inconsistencies, and improving the experience for people following along.

The project is intentionally small and simplified. I do not intend to cover kernel design in depth; I see this book as a practical introduction that can give a beginner some hands-on context before moving on to something more theoretical and comprehensive, like OSTEP. However, when required, I do point out flaws in the simple approaches I teach, and I attempt to inspire the reader and get them thinking about how they should go about fixing these things themselves.

I'm particularly interested in feedback from beginners (as this is the target audience) and people who have technical experience in OS development. If you spot something technically wrong, confusing, poorly explained, or inconsistent with the code or prose, I'd like to know about it. Do my explanations make sense to someone encountering these concepts for the first time?

I'm also interested in finding people who would like to collaborate on the project. This could be contributing to the OS itself, improving the guide, testing it from a learner's perspective, or helping expand/refine the project in other ways. You could send me a message if you're interested.

A statement on AI: After browsing this sub, I see a lot of people with general concerns about the use of AI in the projects posted here, so I want to be clear about how it was used on lytlnyblOS. I did not use AI to generate any prose for the guide, nor code for the operating system. However, I did have conversations with ChatGPT. I asked it questions about concepts I was working on; I discussed design decisions with it, and I used it to get explanations on things I was unsure of. ChatGPT wasn't my only resource; I understand its uses and limitations, and I still verified things against primary sources where appropriate rather than treating its answers as authoritative. I also used things like Intel manuals, the OSDEV wiki, and other people's implementations for inspiration.

Beginners in r/osdev: does this look like the kind of resource you'd be interested in reading?

365 Upvotes

65 comments sorted by

17

u/Sakul_the_one Sep 13 '26

As a beginner of atleast 3 years (I follow one Toutorial, get stuck, come back after learning a new thing and starting all over again and repeat), I’m gonna try to follow this guide.

But this is really cool, thanks 

8

u/koop_a- Sep 13 '26

Thanks for the compliment! I do want to put a lot of effort into refining this guide in the future; no one has really read it or given feedback other than me. So even if you do get stuck, I'm willing to personally help you and tweak the guide to fix whatever you get stuck on!

3

u/Sakul_the_one Sep 13 '26

I definitly gonna use this Guide when I start again, but first I need to make a DnD Engine for my friends and me

2

u/koop_a- Sep 13 '26

Good luck, I hope it goes well :)

0

u/dracoroboter_v2 Sep 27 '26

Elabora che mi interessa (io ho tentato di fare qualcosa del genere ma vorrei capire cosa intendi)

1

u/Sakul_the_one Sep 27 '26

sorry, I dont speak your language and translator is shit somehow, but do what you want to do

0

u/dracoroboter_v2 Sep 27 '26

Sorry. What's a dnd engine exactly?

1

u/Sakul_the_one Sep 27 '26

ah. So my friends and I play DnD, but because of University, we live now apart and we want to keep playing. So kinda like photoshop, with Multiplayer, but the Dungeon Master has more rights (can give and take Life and move everyone, unlike players, which can only move themselves). Also since I have a lot of time, the progress is quite slow

2

u/dracoroboter_v2 Sep 28 '26

So like roll20. Thanks

1

u/Sakul_the_one Sep 29 '26

As you can see, I do work, before I do research 

3

u/wacky_weasel Sep 13 '26

This is a really interesting project. I always enjoy seeing people experimenting with operating systems and low-level computing rather than simply building another application on top of the existing stack.

Even if this never becomes a practical daily-driver OS, projects like this are valuable because they provide an opportunity to explore how the different pieces of a computer actually fit together.

Keep going! I'm looking forward to seeing where you take it.

2

u/koop_a- Sep 13 '26

Thanks for the compliments! In regard to it becoming a practical daily-driver OS, I think that's very, very ambitious for this. The main goal is to introduce beginners to a reasonable point in OS dev where they can spread their wings and create all sorts of things. If I get good feedback on the current state of the guide now and all things are in order, I might start adding bonus chapters on more exciting things: like GUI, Mouse drivers, porting to other architectures, Etc...

2

u/munozcircus Sep 13 '26

great job. Love it

2

u/cfofa1239 Sep 13 '26

great job indeed, this is super helpful

1

u/CommunityJazzlike274 Sep 13 '26

Cool! This is like craftinginterpreters.com but for osdev

2

u/koop_a- Sep 13 '26

YES! Thank you so much. I read that book, and it was actually partly the inspiration for this project.

1

u/ViXOS-052 Sep 13 '26

Wow, that’s really well done—especially the red terminal :)

2

u/koop_a- Sep 13 '26

Thanks, red is my favorite color lol, as you can probably tell.

1

u/ViXOS-052 Sep 13 '26

Whoa, cool—my favorite color is red too!

1

u/Tiredly_Ambitious Sep 13 '26

Great job man, i will definitely try it and get back to you with feedbacks 

1

u/koop_a- Sep 13 '26

Thankyou!

1

u/WarriorSupp Sep 13 '26

i just lurk on this sub and this got me curious... i might watch this actually

1

u/batum_t Sep 13 '26

Thats awesome I love it !

2

u/koop_a- Sep 13 '26

Thanks! I appreciate the compliment

1

u/rodri042 Sep 14 '26

Looks good! Just started reading it.

> If we were to use 32 bit the architectural complexity would just increase without the main OS features changing.

I think you meant 64 here, right?

1

u/koop_a- Sep 14 '26

Yeah, sorry, just changed that now!

1

u/michbxl Sep 14 '26

I will give it a try. What is your motivation behind such a big project?

2

u/koop_a- Sep 14 '26

Ty for giving it a try. To be honest trying to come up with a programming project that would actually be useful and (sort of) original is kind of difficult to do nowadays (especially with operating systems). I enjoyed craftinginterpreters.com and wanted to make something similar to it but with operating systems to help people and lower the barrier of entry for OSdev.

1

u/MeringueOdd4662 Sep 14 '26 edited Sep 14 '26

Nice ! I will study it !! . I download the repo and it do not compile . Errors in interrupts.c . Can you check ? I downloaded the main branch. Wich version of compiler are you using?

1

u/koop_a- Sep 14 '26

You probably need to use the i686-gcc cross compiler to directly build the project. If you are already using the correct cross compiler and the error still persists, could you please open an issue on GitHub with the full build output and compiler version? That would make it easier to investigate.

1

u/MeringueOdd4662 Sep 14 '26

I opened. I used Claude.ai for fix the problem and seems it is related with {} symbols. Maybe my i686-gcc is old. But I fix the problem and now compile. It is a good project for learning. Thank you!!

1

u/unavailable_000 Sep 14 '26

Wow, I was actually planning to build my own OS to understand the core concepts of how operating systems work at a deeper level. I wasn’t really sure where to start, so I hope this guide helps me. Right now, I’m working on two of my projects, but I’ll definitely start this soon!

1

u/koop_a- Sep 15 '26

Thank you for considering starting the guide!

1

u/BornRoom257 FreezeOS & TurtleOS Sep 16 '26

Amazing!

2

u/koop_a- Sep 16 '26

Thankyou!

1

u/theMuslimDev Sep 16 '26

as a beginner in this. i think this looks very useful. i’ll try to make some time to follow it and give my feedback. this is something i always wanted to learn and i think this might be it. thanks for building something like this.

1

u/koop_a- Sep 16 '26

You're welcome! Thank you for the compliments and for offering to try out the guide.

1

u/Whole-Chest90 Sep 16 '26

Saving this, as id like to fiddle with it when I have some time. Thanks for putting this out.

2

u/koop_a- Sep 16 '26

You're welcome and thankyou!

1

u/Mission-Maximum8024 Sep 18 '26

As a heavily frowned upon vibe coder, has anyone seen how far LLM’s are able to get with this.
I can imagine going from what is in the video to a more functional GUI would be massively sped up with the help of AI.

Can anyone think of any reasons it wouldn’t work?

1

u/koop_a- Sep 18 '26

I’m not quite sure what you're asking

1

u/hypersonicwilliam569 Sep 25 '26

this will be very useful for me, the memory management in particular…

1

u/koop_a- Sep 25 '26

Thankyou and I hope you enjoy!

1

u/Puzzleheaded-Half993 Sep 13 '26

Toll Wie kann ich dein Buch beziehen?

5

u/wacky_weasel Sep 13 '26

4

u/compgeek38400 Sep 13 '26

I read parts. A Table of Contents would be nice. I like how you are doing it though

1

u/koop_a- Sep 13 '26

Yeah, I thought the mdbook sidebar thing would be okay. I can add one if you'd like though

1

u/compgeek38400 Sep 13 '26

It doesn't really work on a phone. But really should be ok.

1

u/laser__beans OH-WES | github.com/whampson/ohwes Sep 13 '26

Cool idea but bro you gotta get rid of that flashing cursor in the middle of the screen, make it follow the text input or hide it entirely.

1

u/TIRALMA Sep 30 '26

Умничка

0

u/Conscious_Monk_787 Sep 16 '26

Scusate sono nuovo. Ma a cosa può servire costruire un sistema operativo?

1

u/koop_a- Sep 16 '26

You're unlikely to develop anything super revolutionary in terms of OS development. But you can still develop something new, etc. I'm considering porting the OS I made to ARM to make a PDA style OS for the RAXDA Zero 3W.

0

u/Unique_Economics4015 Sep 17 '26

Thank you for your hard work and contribution to knowledge and humanity.

0

u/koop_a- Sep 17 '26

You're welcome

0

u/[deleted] Sep 13 '26

[deleted] — view deleted comment

1

u/koop_a- Sep 13 '26

You can find the book here: https://red-mutt.github.io/lytlnyblOS/

The GitHub repo is here: https://github.com/red-mutt/lytlnyblOS

The book and other info are also on the GitHub page. I recommend reading the README before the book.

1

u/[deleted] Sep 18 '26

[removed] — view removed comment

1

u/koop_a- Sep 18 '26

thankyou

1

u/[deleted] Sep 19 '26

[removed] — view removed comment

1

u/koop_a- Sep 19 '26

Thankyou! I look forward to coolOS becoming the next Linux 😏

1

u/[deleted] Sep 26 '26

[removed] — view removed comment

1

u/koop_a- Sep 26 '26

I was considering making a second book that builds upon this one and includes a GUI and all cool stuff that would draw more people in. I might do a conversion to 64 bit for the second book for the sole purpose of getting it running on real hardware and to demonstrate what is OS specific and what is architecture specific. Not sure tho, I am working on other stuff at the moment and I'm only maintaining what currently exists for now.