The a20 gate is enabled when invoking 32bit mode. Turn it off before
returning to 16bit mode.
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.
__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
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