bios/a20: Add support for fast A20 method. May fix #386
diff --git a/common/sys/a20.s2.c b/common/sys/a20.s2.c
index 0c55e737..c123bd54 100644
--- a/common/sys/a20.s2.c
+++ b/common/sys/a20.s2.c
@@ -60,6 +60,17 @@ bool a20_enable(void) {
outb(0x64, 0xae);
while (inb(0x64) & 2);
+ if (a20_check())
+ return true;
+
+ // Fast A20 method
+ b = inb(0x92);
+ if ((b & 0x02) == 0) {
+ b &= ~0x01;
+ b |= 0x02;
+ outb(0x92, b);
+ }
+
if (a20_check())
return true;
