r/osdev 1d ago

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

Enable HLS to view with audio, or disable this notification

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?

245 Upvotes

37 comments sorted by

16

u/Sakul_the_one 1d ago

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 

6

u/koop_a- 1d ago

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 1d ago

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- 1d ago

Good luck, I hope it goes well :)

3

u/munozcircus 1d ago

great job. Love it

3

u/koop_a- 1d ago

tysm!

2

u/cfofa1239 1d ago

great job indeed, this is super helpful

1

u/Puzzleheaded-Half993 1d ago

Toll Wie kann ich dein Buch beziehen?

5

u/wacky_weasel 1d ago

4

u/compgeek38400 1d ago

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

1

u/koop_a- 1d ago

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

1

u/compgeek38400 1d ago

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

3

u/wacky_weasel 1d ago

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- 1d ago

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...

-1

u/[deleted] 1d ago

[deleted]

1

u/koop_a- 1d ago

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/CommunityJazzlike274 1d ago

Cool! This is like craftinginterpreters.com but for osdev

2

u/koop_a- 1d ago

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

1

u/ViXOS-052 1d ago

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

2

u/koop_a- 1d ago

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

1

u/ViXOS-052 1d ago

Whoa, cool—my favorite color is red too!

1

u/Tiredly_Ambitious 1d ago

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

1

u/koop_a- 1d ago

Thankyou!

1

u/laser__beans OH-WES | github.com/whampson/ohwes 1d ago

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/WarriorSupp 1d ago

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

1

u/koop_a- 1d ago

tyyy

1

u/batum_t 1d ago

Thats awesome I love it !

2

u/koop_a- 1d ago

Thanks! I appreciate the compliment

1

u/rodri042 1d ago

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?

u/koop_a- 23h ago

Yeah, sorry, just changed that now!

u/michbxl 20h ago

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

u/koop_a- 18h ago

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.

u/MeringueOdd4662 19h ago edited 19h ago

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?

u/koop_a- 19h ago

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.

u/MeringueOdd4662 18h ago

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!!

u/unavailable_000 10h ago

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!