ouyesmxl/HelloOS — Issue #4: Enabling A20 Line
Author: Shikhin
Created: 2012-02-20 09:09:17+00:00
State: open

The method via which the bootloader enables the A20 line is the keyboard controller. The problems with this are:

a) It doesn't test if the method via which it enabled was successful or not - and just "hopes" it succeeds.
b) It doesn't use several methods.

After some time of research, I find out that the best method is

a) Try using the BIOS itself to enable the A20 line. Test if enabled. If enabled, continue.
b) Try using the keyboard controller to enable the A20 line. Test if enabled. If enabled, continue.
c) Use the Fast A20 method to enable the A20 line. Test if enabled. If enabled, continue.
d) Abort boot.

For further information, you could refer to https://github.com/Shikhin/Draumr/blob/master/Source/System/Boot/BIOS/BIOS/Src/A20.asm but I don't encourage copying it without understanding.