I’m just totally unsure where I’d even begin in a practical sense.
I’m just totally unsure where I’d even begin in a practical sense.
Then you compile this with GCC flags that tell GCC to not include a standard library (e.g. compile for bare metal).
Then you link with a very simple linker script that tells ld to put the multiboot header before your actual program.
Then, if you want to run on your own hardware, you change the GRUB config file to load your binary and reboot. Or if you want to run in QEMU, you just load the binary with QEMU. Using QEMU is probably simpler, since you're less likely to run into hardware weirdness at the beginning.
Then, you'd start with just writing to a text buffer, which has a hardcoded address on old architectures (it makes sense to start with an architecture where that's the case). That way, you can print stuff to the screen. That's enough to do a lot of very cool stuff already. After that, you configure interrupts, which you do by hard-coding some function pointers in a table using assembly. Then you use some special instructions to load these interrupt handler tables on startup. Now you can do all kinds of interactive things.
It teaches how to do a hello world, with proper setup.
It's a bit more than a single C file, with some assembly/linker script/custom GCC toolchain required.
From there, that wiki is probably the most helpful resource you can find, along with the CPU manuals.
(I used x86 assembly as an example assuming you wanted to boot your OS on a PC. An alternative could be to target a well documented SBC like the BeagleBone Black)
Its linux but stripped down to the very bare essentials
The OSDev wiki has lots of actually minimal examples for different architectures and boards