]> xenbits.xensource.com Git - people/andrewcoop/seabios.git/commitdiff
Backup and restore a20 on call32_sloppy()
authorKevin O'Connor <kevin@koconnor.net>
Sat, 11 Oct 2014 17:27:16 +0000 (13:27 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Wed, 15 Oct 2014 16:10:52 +0000 (12:10 -0400)
Previously, the a20 line would always be enabled and left on after
call32_sloppy().  The setting should really be backed up and restored
on each call.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
src/stacks.c

index 4b26d9f9ee63dcb91b7f5a5fbc4067331e6be03e..6f40cbeb64429e959b5c565562dbda03af9f0a8b 100644 (file)
@@ -25,6 +25,7 @@
 struct {
     u8 method;
     u8 cmosindex;
+    u8 a20;
     u16 ss, fs, gs;
     struct descloc_s gdt;
 } Call32Data VARLOW;
@@ -174,6 +175,9 @@ call32_sloppy_prep(void)
     inb(PORT_CMOS_DATA);
     SET_LOW(Call32Data.cmosindex, cmosindex);
 
+    // Enable a20 and backup it's previous state
+    SET_LOW(Call32Data.a20, set_a20(1));
+
     // Backup ss/fs/gs and gdt
     SET_LOW(Call32Data.ss, GET_SEG(SS));
     SET_LOW(Call32Data.fs, GET_SEG(FS));
@@ -201,6 +205,9 @@ call32_sloppy_post(void)
     SET_SEG(FS, GET_LOW(Call32Data.fs));
     SET_SEG(GS, GET_LOW(Call32Data.gs));
 
+    // Restore a20
+    set_a20(GET_LOW(Call32Data.a20));
+
     // Restore cmos index register
     outb(GET_LOW(Call32Data.cmosindex), PORT_CMOS_INDEX);
     inb(PORT_CMOS_DATA);