The A20 gate you're studying was originally toggled through the 8042 keyboard controller, a hack so entrenched that Linux's arch/x86/boot/a20.c still ships four different enable methods (keyboard, fast A20 port 0x92, BIOS INT 15h) to cover every motherboard quirk. Getting the memory map wrong here is exactly how real bootloaders corrupt video RAM at 0xB8000 or crash writing into the BIOS ROM shadow region.