Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
I've visited making a bootloader once or twice before (https://github.com/cfenollosa/os-tutorial) but I never actually understood it well. Some of my questions were "What do all the registers mean?" and "Why are we using a 16 and 32 bit mode, and not just a 64-bit mode? What do modes even mean?"
So I'm calling for help to make a tutorial on how to build a basic operating system. One where you don't have to Google every single thing or go back to previous pages. Here's how I'm probably going to structure it:
Introduction to ASM: Printing "Hello, World!"
ASM: What are registers and what do they mean?
ASM: Preparing to load up a kernel
C: Your first kernel
C: Drawing shapes
C: Taking input
The parts are short because I only want to go over the basics, but this whole time I've been assuming that you don't have to enable a 16 or 32 bit mode to enter it. (This is due to the confusion of many tutorials surrounding loading a kernel.)
Please don't write another tutorial that misleads beginners by telling them to write a boot sector. Even more importantly, don't write a tutorial while you're still a beginner yourself.
The main problem I see with all "tutorials" on osdev ( and many other topics) I see around is the wrong people writing them, usually the ones with not a full understanding. The experts tend to have other things to do. This is a main problem, because most tutorials will introduce nifty little bugs or big falsehoods that way which then just keep on spreading.
One hard question would be wether a "tutorial" is really needed on this extremely vast and complicated topic, i am not sure wether you, even if you got a dozen experts, could write a "tutorial" that covers everything necessesary in reasonable depth( i suppose you'd end up with several libraries that way), so i am more in line with saying "There don't need to be tutorials on osdev, there are books".
So why not just contribute to the wiki? Due to peer review and the inability to write a full "tutorial" in any reasonable time this would be the course of action i'd advise.
One general Tipp : you should NOT use tutorials, especially not ones from youtube. Read books, they are better. The wiki MIGHT be a good source, at least it had some peer review where tutorials most likely hadn't.
On the other hand, adding pages to the Wiki, or editing existing pages helped me a lot when I was just getting started.
This may be a better approach...
Project: OZone
Source: GitHub
Current Task: LIB/OBJ file support
"The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott
You don't even know how to do Assembly and you want to teach it? That's insane. You don't teach football if you don't even know about the scores. You don't teach swimming or basketball if you don't know how to play. Learn Assembly. Then, come back later to a tutorial.
moo wrote:
The parts are short because I only want to go over the basics, but this whole time I've been assuming that you don't have to enable a 16 or 32 bit mode to enter it. (This is due to the confusion of many tutorials surrounding loading a kernel.)
If the pc starts using the BIOS then it will be in 16-bit mode. If you want to go to 64-bit long mode then you need to switch to 32-bit protected mode, set some control registers, setup a page tabel, enable paging, create a task state segment (TSS), enable long mode and jump to the first identity-mapped 64-bit page at which point you will be in long mode executing the 64-bit code that needs to continue booting the system.