:: commit 5374e4e1f27dd5ed5f3a4a6289cf5bb5f549269f

mintsuki <mintsuki@protonmail.com> — 2021-09-22 22:17

parents: dbab5f6063

bios: Call a20_enable() before doing anything else

diff --git a/stage23/entry.s2.c b/stage23/entry.s2.c
index a63a7c8b..dcaf9cae 100644
--- a/stage23/entry.s2.c
+++ b/stage23/entry.s2.c
@@ -70,6 +70,10 @@ enum {
 
 __attribute__((noreturn))
 void entry(uint8_t boot_drive, int boot_from) {
+    // XXX DO NOT MOVE A20 ENABLE CALL
+    if (!a20_enable())
+        panic("Could not enable A20 line");
+
     init_e820();
     init_memmap();
 
@@ -77,9 +81,6 @@ void entry(uint8_t boot_drive, int boot_from) {
 
     copyright_notice();
 
-    if (!a20_enable())
-        panic("Could not enable A20 line");
-
     init_idt();
 
     disk_create_index();
tab: 248 wrap: offon