The A20 Problem (JOS)
Posted: Tue Apr 02, 2013 9:52 am
The snippet code as following is enable A20 for JOS. It has a problem which confuse for me. The "$0xdf" is a command, not data.It should be out to port 0x64, which is command port. In fact, It port to 0x60, which is data port.
Here, exist two methods (Method 3.1 & Method 3.2) : http://www.brokenthorn.com/Resources/OSDev9.html
So, my question is : Why port to 0x60 (outb %al, %0x60) at last ?
Here, exist two methods (Method 3.1 & Method 3.2) : http://www.brokenthorn.com/Resources/OSDev9.html
So, my question is : Why port to 0x60 (outb %al, %0x60) at last ?
Code: Select all
seta20.1:
inb $0x64,%al # Wait for not busy
testb $0x2,%al
jnz seta20.1
movb $0xd1,%al # 0xd1 -> port 0x64
outb %al,$0x64
seta20.2:
inb $0x64,%al # Wait for not busy
testb $0x2,%al
jnz seta20.2
movb $0xdf,%al # 0xdf -> port 0x60
outb %al,$0x60