A Minimal Bootloader
"From a small spark may burst a mighty flame." - Dante Alighieri
Writing a bootloader is not an easy task, and it can include a lot of things. In this chapter we will write the minimal needed bootloader to load our kernel, and obtain information that is necessary for it.
In this chapter we will implement the following features:
- Setup registers and stack
- Enable the A20 line
- Read kernel from disk
- Load the global descriptor table
- Enable Paging
These features are enough, at least for the start of our kernel. Later in the book, we will implement more features like obtaining a memory map, enabling text mode, locating the kernel in the file system, and more!