* stage2/asm.S (gateA20): First, try a BIOS call (INT 15H,
AX=2400/2401). Use the keyboard controller, only if that failed.
+2002-12-21 Yoshinori K. Okuji <okuji@enbug.org>
+
+ * 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 <okuji@enbug.org>
Add a workaround for buggy BIOSes which don't pass boot drive
*/
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