I was curious about how to enable the A20 gate, and when I should do so, and what it is exactly. Thanks!

Code: Select all
mov ax, 0x2401
int 0x15
jnc .done
Code: Select all
; empty keyboard input buffer
.read:
in al, 0x60
.out:
in al, 0x64
test al, 0x01
jnz .read
; send command
call .cmd_wait
mov al, 0xd1
out 0x64, al
call .cmd_wait
mov al, 0xdf
out 0x60, al
.cmd_wait:
in al, 0x64
test al, 0x02
jnz .cmd_wait
ret
Code: Select all
xor ax, ax
mov fs, ax
dec ax
mov gs, ax
mov al, byte [fs:0x0]
mov ah, al
not al
xchg al, byte [gs:0x10]
cmp ah, byte [fs:0x0]
mov [gs:0x10], al
jnz .error
.done: