My dream is to one day write an operating system from scratch, but I know I'll need to learn a lot about how existing operating systems work. What are some of the best resources for learning the basics of Operating Systems?
Resources that start from level 0 (I don't even know how a bootloader works or what exactly it does), but cover most important things by the end and are free would be great. Thanks!
DARK-KNIGHT-491
The best way to start working on an operating system is to write a simple legacy boot loader program and print a text or character on the screen. You could easily find resources online. Then obviously to proceed you must know some concepts about Operating Systems and also the hardware architecture. Initially you would be writing the code in assembly language to set up different directory tables and then switch to 32 bit protected mode from 16 bit real mode. Now you could code in higher level languages like C and link the objects of C and assembly together to form executable files. Now since the executable files does not need platform dependent relocations by loaders, they need not to contain unnecessary headers and must be in the correct formats (raw binary, elf, PE are some executable formats). You might need a cross compiler to compile to platform independent executable. Once you have reached this far, you could decide whether to move to 64 bit mode. You have to learn about various OS concepts like paging, process scheduling,etc. You might have to switch back and forth from assembly to higher level language as there are certain things only asm language could do. Also at this point bios services are unavailable. So you need to develop your own drivers. Once you understand how things works you could try on developing UEFI bootloaders too.
I had also begun like you. And so far I have made this:
The image file used for this program is not owned by me. ( actually my program could print any image file ).
This is a simple UEFI bootloader which displays an image to the output screen. I am also in learning phase.
There is this awesome site wiki.osdev.org which contains all resource you need to get started.
goodluck.