flat assembler
Message board for the users of flat assembler.

Index > OS Construction > FDC programming

Author
Thread Post new topic Reply to topic
ManOfSteel



Joined: 02 Feb 2005
Posts: 1154
ManOfSteel 17 Feb 2005, 15:31
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:
Code:
;'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:
Code:
FDCCmdReady:
mov dx,0x3f4
in al,dx
and al,11000000b
cmp al,10000000b
jne FDCCmdReady
ret
    


FDCDataReady:
Code:
FDCDataReady:
mov dx,0x3f4
in al,dx
and al,11010000b
cmp al,11010000b
jne FDCDataReady
ret
    
Post 17 Feb 2005, 15:31
View user's profile Send private message Reply with quote
Octavio



Joined: 21 Jun 2003
Posts: 366
Location: Spain
Octavio 18 Feb 2005, 23:17
Quote:
But when I do it after a 'calibrate' or right after the 'read/write' command (before the result phase), it never works. It freezes.

complete the result phase, comands can not be overlaped.
Post 18 Feb 2005, 23:17
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.