pop fs
pop es
pop ds
+%if DISABLE_A20
call disable_a20
+%endif
popfd ; Re-enables interrupts
pop ebp
pop es
ret
+%if DISABLE_A20
+
disable_a20:
pushad
;
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
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
%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