aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-02-15 22:35:18 -0800
committerH. Peter Anvin <hpa@zytor.com>2008-02-15 22:54:15 -0800
commitdefcbbc6527cd20bd45e42fab53d7e185156df48 (patch)
tree7cdba63b1d0b72d001b2f0cfb4b2162a48fef151
parent7234f292a43f971899b4a10fc5130c400c4aa3b2 (diff)
downloadsyslinux-elf-defcbbc6527cd20bd45e42fab53d7e185156df48.tar.gz
syslinux-elf-defcbbc6527cd20bd45e42fab53d7e185156df48.tar.xz
syslinux-elf-defcbbc6527cd20bd45e42fab53d7e185156df48.zip
Don't close the A20 gate; leave it open
Don't close the A20 gate (restore to previous state); leave it open. This is good for performance, but also avoids a nasty race condition when leaving protected mode to then quickly re-enter protected mode.
-rw-r--r--bcopy32.inc9
-rw-r--r--com32.inc2
-rw-r--r--config.inc11
3 files changed, 21 insertions, 1 deletions
diff --git a/bcopy32.inc b/bcopy32.inc
index b62d3ac4..99a16d88 100644
--- a/bcopy32.inc
+++ b/bcopy32.inc
@@ -190,7 +190,9 @@ simple_pm_call:
pop fs
pop es
pop ds
+%if DISABLE_A20
call disable_a20
+%endif
popfd ; Re-enables interrupts
pop ebp
@@ -412,6 +414,8 @@ a20_test:
pop es
ret
+%if DISABLE_A20
+
disable_a20:
pushad
;
@@ -464,6 +468,8 @@ a20d_none:
popad
ret
+%endif
+
;
; Routine to empty the 8042 KBC controller. If dl != 0
; then we will test A20 in the loop and exit if A20 is
@@ -594,8 +600,9 @@ trampoline_to_pm:
align 2
A20List dw a20_dunno, a20_none, a20_bios, a20_kbc, a20_fast
+%if DISABLE_A20
A20DList dw a20d_dunno, a20d_none, a20d_bios, a20d_kbc, a20d_fast
-a20_adjust_cnt equ ($-A20List)/2
+%endif
A20Type dw A20_NONE ; A20 type
diff --git a/com32.inc b/com32.inc
index c90c9ec4..220c9d7b 100644
--- a/com32.inc
+++ b/com32.inc
@@ -210,7 +210,9 @@ com32_enter_rm:
jmp bx ; Go to whereever we need to go...
com32_done:
+%if DISABLE_A20
call disable_a20
+%endif
sti
jmp enter_command
diff --git a/config.inc b/config.inc
index d199597c..d6a981e8 100644
--- a/config.inc
+++ b/config.inc
@@ -28,6 +28,17 @@ MAX_FKEYS equ 12 ; Number of F-key help files
%assign DO_WBINVD 0 ; Should we use WBINVD or not?
;
+; Set this to return the A20 gate to its previous state, instead of
+; leaving it open. This has caused problems, because there appear
+; to be a race condition between disabling the A20 gate and trying to
+; re-enter protected mode, causing the A20 gate disable to take effect
+; after we have already done the A20 enabled check, with disastrous
+; consequences. Plus, there seems to be little or no demand for it.
+;
+%assign DISABLE_A20 0
+
+
+;
; Version number definitinons
;
%ifndef DEPEND ; Generated file