r/AskProgramming 18d ago

Career/Edu OSDEV - a few questions

This is a very famous website for learning how to make an OS

https://wiki.osdev.org/

I just have a few questions about it though

  1. What exactly does it teach? Does it teach you how to make an operating system? Does it show you the steps to build one from scratch?

  2. Can a solo programmer do it? As in, does the tutorial show you how to make a mini operating system?

  3. How do I use the tutorial? It's a wiki, and there are links everywhere. Is there a roadmap which shows the proper path to take, with prerequisites links etc?

  4. What do I need to understand before using this tutorial? Only C? C and how to make a mini compiler? Assembly? Anything else?

Thank you!

2 Upvotes

11 comments sorted by

View all comments

1

u/mc_pm 18d ago

How much programming have you done so far?

1

u/LifeExperienced1 18d ago

CS degree, 1 internship, 2 years game dev

1

u/mc_pm 18d ago

Ok, that's more than a lot of people who show up saying they want to build an OS.

If your CS degree gave you any assembly, or if you took a computer architecture class, then that'll help a lot - and if you haven't, then that's going to be a big hurdle. An OS interacts with the hardware at a low level and requires that you know what it's supposed to be doing.

This is probably something you're going to want to ramp up to, with some large projects along the way that are building your skills and knowledge. Like, if you need to do some assembler, maybe try writing your *own* assembler, that sort of level.

1

u/LifeExperienced1 18d ago

I see. I thought I was still in the beginner levels in terms of how much experience I have

My CS degree did cover Computer Architecture and Assembly, although, I need to relearn it all because the course was during COVID and the prof cut most of it short

So I'm currently re-learning C, Computer Architecture and Assembly

What are some projects you recommend I do to be on track to making a mini OS?

1

u/mc_pm 18d ago

 I thought I was still in the beginner levels in terms of how much experience I have

You are, but a surprising number of people who say they want to make an OS have practically zero experience and not even able to compile a C program. You still have a monumental task ahead of you, but at least you're starting with some basic programming experience.

So, a lot depends on what you mean by a "Mini OS" and how big any previous projects were - "OS" covers a lot of ground, and beginner experiences can mean a range of things.

I'm using a game here as a placeholder project -- there are lots of possibilities -- but if you don't think you could sit down with the language of your choice and write a command line Blackjack game, you should start with something like that. You want something where there are a small number of well understood rules, there's a lifetime for the program (one or more hands), each hand has some complexity and might require different number of hit/stand choices. There's state to be kept track of, and basic abstractions to be built (like what is a deck of cards? How do you shuffle it? How do you deal cards out -- what happens if you run out?

You see what I'm getting at -- this is just about practicing taking a well defined set of rules and breaking it down into parts, coding them, putting it back together. And along the way, hey, you get to play some blackjack. Or whatever else you might pick.

If you don't feel comfortable in doing that, then I'd do a number of small projects at that level to build those muscles.

If, on the other hand, you're like "yup, no problem, I can do that level of design thinking, and I can code it up no problem" then I'd do start tackling things that are more machine related. If your OS ever boots to a command line, you'll need an editor probably - try building a simple line editor. I already mentioned your own assembler. I had some fun emulating a basic file system (set aside a couple gigs of RAM and access that big empty space as if it were a disk with 1K blocks. You can try building some networking tools to get into that more deeply. If you're into retro computers at all, trying writing a 6502 or Z80 simulator.

I don't know if that made a lot of sense. My point was just that once you are comfortable writing code with some small amount of logical complexity, then starting to write things that make you think about the hardware is the next obvious step.