I have written some code to enable the A20 gate but somehow it seems to be on when I boot my computer. Here's the code that checks if A20 is enabled.
Code: Select all
_enable_a20:
; THIS IS FOR TESTING IF A20 IS ENABLED
xor ax, ax
mov bx, 0xFFFF
mov fs, ax
mov gs, bx
mov di, 0x0500
mov si, 0x0510
mov byte [fs:di], 0x00
; TRY TO ENABLE A20 THROUGH PORT 0x92
; call _a20_92
mov byte [gs:si], 0x01 ; TEST
cmp byte [fs:di], 0x01 ; TEST
mov si, msg_a20_92
jne _a20_on
Maybe it's me who can't think but 0000:0500 is the same as FFFF:0510 in real mode right?
Anyway I don't see how A20 can be enabled when I boot but maybe you can....
(BTW I'm using bochs when I test it so maybe it is bochs that enable A20 or something)