hdd_setup:
; Probe for PATA hard drive
mov dx, 0x01F0
mov [ata_base], dx
add dx, 7 ; Primary ATA Regular Status Byte
in al, dx
cmp al, 0xFF ; Check for "float" value
je hdd_setup_try_sata ; No drive detected
test al, 0xA9 ; Is ERR, DRQ, DF, or BSY set?
jne hdd_setup_err_read
jmp hdd_setup_load_sector
Instruction "in al, dx" return 0x50 in my PC. What does it mean? I don't know.
Under SATA's legacy mode, my "ata_base" is really 0x6EB0, not 0x01F0.
All test done on real hardware; my Core Duo doesn't support 64 bit virtualization. My PC is a Dell Inspiron 1525 con BIOS setup to use AHCI (factory default).
I know hardware is a bitch and lots of real tests is the only way to go. I will gladly help you with any test you need. Just ask.
Enjoy
Andrés