But I am having issues when booting from IDE.
I can find the IDE in PCI, which returns BAR0 to BAR4.
But when I query the device it returns error = ABRT indicates the requested command has been aborted due to a drive status error (such as not ready or write fault) or because the command is invalid.
Before this command there is no error and the device is ready.
Does anyone have any ideas??
Using VirtualBox, latest version.
Here is my code, in long mode, it returns error or 4h
Code: Select all
align 16
ProcX Start64
; Master Drive Select
Mov2 al, 0xA0
Mov2 dx, 0x1F6
out dx, al
; wait 400ns for drive select to work
mov dx, 0x3F6
in al, dx
in al, dx
in al, dx
in al, dx
; set the Sectorcount, LBAlo, LBAmid, and LBAhi IO ports to 0 (port 0x1F2 to 0x1F5)
Mov2 al, 0
Mov2 dx, 0x1F2
out dx, al
call Pause
Mov2 al, 0
Mov2 dx, 0x1F3
out dx, al
call Pause
Mov2 al, 0
Mov2 dx, 0x1F4
out dx, al
call Pause
Mov2 al, 0
Mov2 dx, 0x1F5
out dx, al
call Pause
; send the IDENTIFY command (0xEC) to the Command IO port (0x1F7)
Mov2 al, 0xEC
Mov2 dx, 0x1F7
out dx, al
call Pause
mov dx, 0x1F1
in al, dx
in al, dx
in al, dx
xor rax, rax
in al, dx
Mov2 rsi, msgHere
Mov2 r15, rax
call MessageHEX64
jmp $