Bootloader basics | notes.eatonphil.com

submited by
Style Pass
2022-01-24 00:00:07

I spent a few days playing around with bootloaders for the first time. This post builds up to a text editor with a few keyboard shortcuts.

There are a definitely bugs. But it's hard to find intermediate resources for bootloader programming so maybe parts of this will be useful.

If you already know the basics and the intermediates and just want a fantastic intermediate+ tutorial, maybe try this. It is very good.

Bootloaders are a mix of assembly programming and BIOS APIs for I/O. Since you're thinking about bootloaders you already know assembly basics. Now all you have to do is learn the APIs.

The hello world bootloader has been explained in detail (see here, here, and here) so I won't go into too much line-by-line depth.

But aside from clerical settings (16-bit assembly, where the program exists in memory, padding to 512 bytes) the only real bootloader-y magic in there is int 0x10, a BIOS interrupt.

BIOS interrupts are API calls. Just like syscalls in userland programs they have a specific register convention and number to call for the family of APIs.

Leave a Comment