4 ms·
For practical operating systems development, you want to use a bootloader on top of BIOS or UEFI. In particular, the Multiboot[0] protocol is very useful, becau
by exDM69 12y ago
For practical operating systems development, you want to use a bootloader on top of BIOS or UEFI. In particular, the Multiboot[0] protocol is very useful, because it is supported out-of-the-box by bootloaders (like GRUB) and there's built-in support for multiboot in emulators like QEMU and Bochs (qemu -kernel mykernel.elf).
It is rather easy to build a multiboot-capable ELF file that can be easily booted on real iron as well as emulators.
This will directly set up your computer in protected (32 bit) mode (NOTE: working in 64 bit "long" mode is a bit more difficult, for educational projects, it's best to stick with 32 bit mode). The protocol also has specs to set up a video mode and provide you with a pointer to the framebuffer (otherwise you'd need to fall back to 16 bit real mode, and use BIOS interrupts for setting up a video mode) and provide some information about the machine in a structure provided to the kernel on boot.
Booting directly with UEFI might be more and more viable option as time goes by, but I think that multiboot is still more viable (things might have changed, I haven't done OS development in a few years).
[0] https://www.gnu.org/software/grub/manual/multiboot/multiboot.html https://www.gnu.org/software/grub/manual/multiboot/multiboot...