Instant Gratification – Building a Simple Bootloader

I am all about instant gratification. Perhaps that’s a bad personality quirk for someone that has set out to write his own operating system, but hey, I’m me, and I can’t be anything else.

For someone that has just set out on the long road to building an OS, there is nothing more thrilling than seeing your code boot up for the first time. I can’t describe it – it’s just a total rush to hand-craft some assembly code, build a binary, write that binary to the boot sector and see your computer boot up and be completely under the control of your code.

In addition to satisfying my need for instant gratification, this exercise allowed me to start to become familiar with the various tools in my toolbox. When you’re coding this close to the metal, it is important to be very familiar with your tools.

So, without further ado, here it is – the very first iteration of M3’s boot loader, running on Q (QEmu on OS X):