I waited a few hours and didn't see any mention of the big one : https://wiki.osdev.org/Bare_Bones. In general osdev has a lot of good resources although the good threads get buried in the forum. Sortix came from there and the threads about trying to minimize the source dependency graph helped a lot in my first startup.
However, nothing else. So it's a starting point for a beginner. I don't know if its the perfect starting point or not, but at least you won't be stuck with all the setup. If you are writing an OS in another language you can probably get some inspiration as well, as for example I did implement basic ubsan support.
Some fun facts:
There is a C++ exceptions example that shows that with the compiler runtime as well as a libunwind you can catch C++ exceptions, but only if you create the exception fully yourself, as there is no standard library. It does add a bit of bloat, so it's not really intended for OS development.
There is an example of how to runtime load a library, and call into it. No runtime linking, just an exchange of call table.
There is very primitive backtrace functionality in the panic function simply by using compiler builtins. No way to convert the addresses to function + offset because there is no symbol table. One cool way to do this is to link the kernel, generate an ELF section that contains only the function symbols, and then append it to the end of your kernel. During initialization you can then use it for backtraces. It's also fairly architecture independent, as you will only have to distinguish between 32- and 64-bit symbols.
What I'd love to have is a tutorial or a base OS that initializes all the hardware stuff (I/O, memory, discs, video, processor...) and let you build the software stack on top of it. Anything outthere? The closest I found is baremetal https://en.wikipedia.org/wiki/BareMetal
Well it does what it says on the tin. So its fine.
Whats your next step? Perhaps put a version of snake in there. That will provoke input/output etc... I'd suggest text mode first but then aim for VGA and beyond.
If you want a bigger challenge, implement serial port I/O so you could hook it via virtualbox etc to another running machine and network your snake game etc.
Then from there dig into ethernet and use raw ethernet or even UDP. Now you have a full working network client from the ground up.
While the point of this project is to go for developing a very small kernel, I afraid I can't recommend this as a way to "learn to write your first OS kernel".
Particularly, this project has been fossilised for two years, (last commit was in 2018) with a single commit each year hardly qualifies as an updated tutorial for writing OS kernels.
My first recommendation would be the "writing an OS in Rust" tutorials [0] and the xv6 tutorials [1].
His blog post goes into a lot more detail about things, and he has a part 2 where he adds keyboard input and screen output via interrupt handlers. It's useful as a "Hello World" level intro to the topic.
I agree, this is really just a "how to boot x86" rather than an actual kernel. But then, they're just using GRUB to boot into 32-bit (Which is the best way to do it) which means their "kernel" does basically nothing - they're just writing to 0xB8000.
I second xv6, it's a bit simplistic, and not the cleanest, but it really shows the basics of a 'real' kernel - locking and task scheduling, a basic file-system and block layer, some userspace utilities, and fantastic documentation (There's a whole book!).
I did this recently for fun, including the bootloader (I considered GRUB cheating!) The best tutorial IMO was https://samypesse.gitbook.io/how-to-create-an-operating-syst...
Some other useful resources I found: