aboutsummaryrefslogtreecommitdiff
path: root/src/stacks.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2014-10-11 13:27:16 -0400
committerKevin O'Connor <kevin@koconnor.net>2014-10-15 12:10:52 -0400
commitbfb7b58b30681f5c421e838fdef3dbc358e80f1e (patch)
tree9e5c92069f14abd14f5a42f2b02e9884d6fa5e0d /src/stacks.c
parent341f8d98a087de01326634dd8a838381e7caa1c9 (diff)
downloadseabios-hppa-bfb7b58b30681f5c421e838fdef3dbc358e80f1e.zip
seabios-hppa-bfb7b58b30681f5c421e838fdef3dbc358e80f1e.tar.gz
seabios-hppa-bfb7b58b30681f5c421e838fdef3dbc358e80f1e.tar.bz2
Backup and restore a20 on call32_sloppy()
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>
Diffstat (limited to 'src/stacks.c')
-rw-r--r--src/stacks.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/stacks.c b/src/stacks.c
index 4b26d9f..6f40cbe 100644
--- a/src/stacks.c
+++ b/src/stacks.c
@@ -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);