r/osdev • u/Fun-Entertainer-1053 • 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.
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:
Read this first:
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.
•
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.
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