From ee9202997be14184e0b781ed378388b25d16e998 Mon Sep 17 00:00:00 2001 From: okuji Date: Sat, 21 Dec 2002 00:34:33 +0000 Subject: [PATCH] 2002-12-21 Yoshinori K. Okuji * stage2/asm.S (gateA20): First, try a BIOS call (INT 15H, AX=2400/2401). Use the keyboard controller, only if that failed. --- ChangeLog | 5 +++++ stage2/asm.S | 30 ++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/ChangeLog b/ChangeLog index 7bb210ccf..1b526ce59 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2002-12-21 Yoshinori K. Okuji + + * stage2/asm.S (gateA20): First, try a BIOS call (INT 15H, + AX=2400/2401). Use the keyboard controller, only if that failed. + 2002-12-11 Yoshinori K. Okuji Add a workaround for buggy BIOSes which don't pass boot drive diff --git a/stage2/asm.S b/stage2/asm.S index d56e0f747..fd5e50b9b 100644 --- a/stage2/asm.S +++ b/stage2/asm.S @@ -1660,6 +1660,36 @@ ENTRY(set_vbe_mode) */ ENTRY(gateA20) + /* first, try a BIOS call */ + pushl %ebp + movl 8(%esp), %edx + + call EXT_C(prot_to_real) + + .code16 + movw $0x2400, %ax + testw %dx, %dx + jz 1f + incw %ax +1: stc + int $0x15 + jnc 2f + + /* set non-zero if failed */ + movb $1, %ah + + /* save the status */ +2: movb %ah, %dl + + DATA32 call EXT_C(real_to_prot) + .code32 + + popl %ebp + testb %dl, %dl + jnz 3f + ret + +3: /* use keyboard controller */ pushl %eax call gloop1