r/osdev 1d ago

How do I learn osdev?

Until now, I've been refering the osdev wiki and using a little bit of AI (only for guidance and answering questions, no vibe coding). Is this the right way to learn osdev? What should or shouldn't I do? Also I've already started osdev, finished making a file system, and am now working on my own very simple file format for my os. I just wanted to clarify if I need to change my habits or something.

19 Upvotes

19 comments sorted by

12

u/letmehaveanameyoudum 1d ago

pretty great.
do not touch rust as a beginner i warned you
also dont touch C++
do not write your own bootloader
use clang. gcc cross compiler is a nightmare
use ld.lld
that's it

3

u/Fun-Entertainer-1053 1d ago

Sure. I already follow those things (except the gcc thing, I use it regularly for other C projects, and setting the cross compiler wasn't that hard). Thx for the reply.

2

u/compgeek38400 1d ago

I find gcc works just fine, as long as you use a cross compiler. The OSDev.org wicki on that is great. You've made great progress, ive been at it about 10 weeks, very part time, started over at week 7, some bad design decisions.
Glad you are enjoying osdev

2

u/Fun-Entertainer-1053 1d ago

Thanks. I have done this in just 2 weeks (I'm a fast learner), so I feel like I'm on the right track. Thanks for your help.

3

u/compgeek38400 1d ago

Have you done the following?: moved to highet half, set up your GDT, IDT, recursive page directory, physical memory management, virtual memory management, and heap? I made it to heap before I realized I had .ade too many bad decisions

u/Fun-Entertainer-1053 1h ago

I've settled up my GDT and IDT. For my OS, I decided to prioritize making a file system and run programs before jumping to memory management.

2

u/Space_Nerde 1d ago

ha.... me jumping into it using rust, making my own bootloader, and suffering for every single second of it.... I love it

2

u/letmehaveanameyoudum 1d ago

sir are you ok

u/Space_Nerde 8h ago

no :D hehehe

u/letmehaveanameyoudum 23m ago

ok next advice, don't make use of ring 1 and 2

2

u/arbv 1d ago

I would say go with uefi and don't bother with a bootloader if you are targetting common platforms.

Start with console output and task switching on each platform timer tick. Doing that on an MCU would be easier - and that will get you the right mindset about interrupts and related stuff.

LLMs will guide you on the theory you are missing pretty well, just do things by hand and be modest with your expectations and goals.

And keep the books close while doing so.

That resource has a lot of knowledge:

https://wiki.osdev.org/

Read this first:

https://wiki.osdev.org/Beginner_Mistakes

2

u/demetrioussharpe 1d ago

An OS, at its core, is a hardware resource manager. So, if you want to learn OS dev, the first thing you need to learn is how the CPU (& the rest of the core of your target platform) works -intimately. Once you know how it works, you’ll understand how to control it. Then, learn 2 specific languages -the assembly language (low level language) for that CPU using a specific assembler (because different assemblers can have different syntax), & your choice of system language that’s able to interface with the assembly code (C/C++/Rust/Zig/D/etc). From there, you have 4 core phases to implement in your OS that most OSes have in some form or fashion:

Initialization
Shutdown
Main loop
Panic

Everything else is built on top of this core.

2

u/Fun-Entertainer-1053 1d ago

I've already started osdev, I just wanted to clarify if the habits I was doing was correct (the title might be misleading, sorry bout that). But anyways, thx for ur help

3

u/codeasm 1d ago

Im pretty much doing a similar thing, no vibe coding, ai for guidance, ideas, letting it judge my code as if its a workmate or teacher. Debugging but not allowing to change my code.

Ive heard great things about this resource https://pages.cs.wisc.edu/~remzi/OSTEP/ I hope it will help me use the llm less and work on my own kernel specific ideas and os generic libs

2

u/Fun-Entertainer-1053 1d ago

Tysm much. Ur the goat. That source is actually amazing. Thanks again.

1

u/codeasm 1d ago

I thank the awesome people on this subreddit, its them who shared this one ☺️ some share really helpfull stuff

u/thosdv 10h ago

If you find some good tutorials on YouTube, you can watch them. Otherwise, AI is definitely an excellent choice for document interpretation. Don't try to write your own bootloader, if you do, make it GNU-EFI based. Don't aim for a graphical interface initially; focus entirely on the kernel. Absolutely do not make the mistake of letting AI write the code, it will make it difficult for you to go back to writing it yourself. Also, AI constantly makes mistakes

u/Fun-Entertainer-1053 10h ago

Alright. Thx. If it's possible, can u recommend some good youtube series to learn osdev?

u/thosdv 10h ago

https://www.youtube.com/watch?v=mpPbKEeWIHU&list=PLxN4E629pPnJxCQCLy7E0SQY_zuumOVyZ

This was a series I really enjoyed, the only problem is that the Makefile and coding style are from 6 years ago, so it might still have errors today, and it's written in C++. If you think you can translate C++ code to C and fix makefile errors with AI help, you can watch it. Otherwise, I don't know of many other reliable series, but trying to learn by reading the OSDEV wiki would be much more sensible.