Re: PML4 on Core2Duo or VirtualBox issue
Posted: Thu Apr 11, 2013 4:05 pm
gusc wrote:00:00:07.201562 Guest paging mode: AMD64 (changed 6 times), A20 disabled (changed 1 times)
The Place to Start for Operating System Developers
http://f.osdev.org/
gusc wrote:00:00:07.201562 Guest paging mode: AMD64 (changed 6 times), A20 disabled (changed 1 times)
FFFUUUUUUUUUUUUUUU! (rage)Owen wrote:gusc wrote:00:00:07.201562 Guest paging mode: AMD64 (changed 6 times), A20 disabled (changed 1 times)
Code: Select all
; Enable A20 Gate
in al, 0x92 ; read from io port 0x92
test al, 0x02 ; do some test
out 0x90, al ; write to io port 0x90
Code: Select all
IN AL, 0x92 ; A20, using fast A20 gate
MOV CL, AL
AND CL, 2
JNZ skip ; if a20 bit seems set, don't touch it
OR AL, 2
OUT 0x92, AL
It's alive! Funny, but this "Fast A20" worked in Bochs and Qemu, but not on the real hardware. And, yes, I had a typo, so it's 0x92 after all not 0x90.Combuster wrote:copying port 0x92 to 0x90 doesn't do anything with A20, but setting bit 1 of port 0x92 does:
Code: Select all
IN AL, 0x92 ; A20, using fast A20 gate MOV CL, AL AND CL, 2 JNZ skip ; if a20 bit seems set, don't touch it OR AL, 2 OUT 0x92, AL
Code: Select all
mov ax, 0x2401
int 0x15
jc .a20Error
cmp ah, 0
jne .a20Error
This will not work on macbook since it does not have PS2 controller at all, not even emulation. It's best to detect if it exist before sending IOs, or just simply call BIOS (for uEFI, A20, if there is still such idea at all, is already enabled).gusc wrote:It's alive! Funny, but this "Fast A20" worked in Bochs and Qemu, but not on the real hardware. And, yes, I had a typo, so it's 0x92 after all not 0x90.Combuster wrote:copying port 0x92 to 0x90 doesn't do anything with A20, but setting bit 1 of port 0x92 does:
Code: Select all
IN AL, 0x92 ; A20, using fast A20 gate MOV CL, AL AND CL, 2 JNZ skip ; if a20 bit seems set, don't touch it OR AL, 2 OUT 0x92, AL
It will not just "not work", it will hang the machine dead.bluemoon wrote:This will not work on macbook since it does not have PS2 controller at all, not even emulation.
I don't know, and it may be model dependent. Is anyone sure 0x92 actually crashes a Mac? I know the keyboard controller ports do, but 0x92?Combuster wrote:While we're at it, does the read from 0x92 crash the mac or the write? (and if it's the write, what's the value returned by the read - I don't have a macbook or bootcamp to try)