5 ms·
While BIOS-booting does seem a bit dated, this still looks like an interesting lab to go through just to understand the bits and pieces of how PCs used to boot
by josteink 12y ago
While BIOS-booting does seem a bit dated, this still looks like an interesting lab to go through just to understand the bits and pieces of how PCs used to boot before UEFI.
On the flip side, I can also understand why you wouldn't want to start an Operating-system engineering course with UEFI.
Unlike BIOS (a set of historically accumulated hacks, which works in a given way because they just do), UEFI is quite a big thing, a big spec and a OS onto itself. It would probably involve quite a bit of indirection.
On the flip side (again), experimenting with the boot process on (real) UEFI machines would probably be much simpler than trying to program boot PROMs and similar stuff they resort to when experimenting with QEMU.
- exDM69 12y agoFor 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...