From: Kevin O'Connor Date: Wed, 12 Nov 2008 03:03:55 +0000 (-0500) Subject: Disable a20 on 16bit calls. X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=seabios.git;a=commitdiff_plain;h=1a72e2e8195396bc58f50f2df375c2526a48c355 Disable a20 on 16bit calls. The a20 gate is enabled when invoking 32bit mode. Turn it off before returning to 16bit mode. --- diff --git a/TODO b/TODO index 07015de..ca76fe3 100644 --- a/TODO +++ b/TODO @@ -1,7 +1,5 @@ Clean up timer code. Don't use PORT_DIAG as delay mechanism. -Disable a20 on jump to 16bit mode. - The keyboard driver should detect ctrl+alt+del and reboot the machine. diff --git a/src/romlayout.S b/src/romlayout.S index e9ea067..f7c2b02 100644 --- a/src/romlayout.S +++ b/src/romlayout.S @@ -181,11 +181,6 @@ transition32: __call16_from32: pushl %eax - // Jump to 16bit mode - ljmpw $SEG32_MODE16_CS, $1f - - .code16gcc -1: // restore data segment limits to 0xffff movw $SEG32_MODE16_DS, %ax movw %ax, %ds @@ -194,6 +189,16 @@ __call16_from32: movw %ax, %fs movw %ax, %gs + // disable a20 + inb $0x92, %al + andb $~0x02, %al + outb %al, $0x92 + + // Jump to 16bit mode + ljmpw $SEG32_MODE16_CS, $1f + + .code16gcc +1: // reset PE bit in CR0 movl %cr0, %eax andb $0xfe, %al