Here we are again, with yet another step in the process of building a second-stage bootloader for our own toy operating system. In the previous sections (here and here) we learned how to create and set up the global descriptor table (GDT) and the interrupt descriptor table (IDT), which the CPU uses to access and control memory and execute interrupts calls. Both of these structures are necessary to switch the CPU to protected mode. In this tutorial, we’ll see how to enable the A20 line.
We are now actually close to reaching that holy grail now. Only a few more preparatory steps are necessary to switch to protected mode, which will finish off our second-stage boot loader and allow us to start writing our kernel in C (which will be a relief from all the assembler code).
In this article, we will talk a little more about memory (we had already done that extensively in the past), but there’s a final hoop we need to jump through in order to have the the full 4GB of memory at our kernel’s disposal.
This article is part of a short series “Writing your own toy operating system.” Here is an index to the entire series.