Hello,
When do I have to do a 'sense interrupt' ('check interupt status', command 0x8).
I saw I had to do it after a 'seek', 'calibrate' and 'read/write' operations. Is that right? Because when I do it after a 'seek', it works and ST0 returns 0x20 ('seek' completed). But when I do it after a 'calibrate' or right after the 'read/write' command (before the result phase), it never works. It freezes.
Also, just for clarification, I do a 'calibrate', then a 'seek', a 'sense interrupt', a 'read' or 'write' operation (using DMA) and the sector is read or written without problem.
Thank you for your help.
This is the code I use:
;'FDCDone' will be set when an IRQ6 occurs
CheckInt:
sti
hlt
cmp byte [FDCDone],1
jne CheckInt
mov byte [FDCDone],0
;check interrupt status command
call FDCCmdReady
mov dx,0x3f5
mov al,00001000b
out dx,al
;read ST0
call FDCDataReady
mov dx,0x3f5
in al,dx
;read cylinder
call FDCDataReady
mov dx,0x3f5
in al,dx
FDCCmdReady:
FDCCmdReady:
mov dx,0x3f4
in al,dx
and al,11000000b
cmp al,10000000b
jne FDCCmdReady
ret
FDCDataReady:
FDCDataReady:
mov dx,0x3f4
in al,dx
and al,11010000b
cmp al,11010000b
jne FDCDataReady
ret