OSDev.org

The Place to Start for Operating System Developers
It is currently Fri Apr 19, 2024 7:05 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: floppy driver problem(interrupt), pls give me some advise
PostPosted: Tue Jul 15, 2008 12:46 am 
Offline

Joined: Mon Jul 14, 2008 8:55 pm
Posts: 11
If I send RESET OR RECALIBRATE command to FDC seperately, the interrupt can be received normally.

But if I first send RESET, and then send RECALIBRATE command to FDC, only one interrupt can be received.
I think 2 interrupts should be received during this proceduce.(one is for RESET command, one is for RECALIBRATE command.)

I set the trap gate type for floppy's interrupt and I also found the behaviors of the following virtual machines are different.
Virtual BOX1.6 : ONLY received the interrupt triggered by RESET command
Qemu manager3.0: ONLY received the interrupt triggered by RESET command
Bochs2.3.6 : ONLY received the interrupt triggered by RECALIBRATE command

Can anybody give me some ideas about this problem? I just only want to reset the FDC.


Top
 Profile  
 
 Post subject: Re: floppy driver problem(interrupt), pls give me some advise
PostPosted: Tue Jul 15, 2008 2:46 am 
Offline
Member
Member
User avatar

Joined: Sun Oct 22, 2006 7:01 am
Posts: 2646
Location: Devon, UK
Hi,

Are you waiting between commands, or are you hammering the FDC with commands at full speed? The FDC is legacy and I believe you need to wait for the interrupt for the first command before sending the second command (or put in some kind of delay - say 200msec).

Cheers,
Adam


Top
 Profile  
 
 Post subject: Re: floppy driver problem(interrupt), pls give me some advise
PostPosted: Tue Jul 15, 2008 5:46 am 
Offline
Member
Member

Joined: Wed Oct 31, 2007 9:09 am
Posts: 1385
AJ wrote:
The FDC is legacy


I think we can safely assume the FDC does not like to get more then one command at a time. Isn't there some busy bit or something one can check to see if sending a command is safe?


JAL


Top
 Profile  
 
 Post subject: Re: floppy driver problem(interrupt), pls give me some advise
PostPosted: Tue Jul 15, 2008 7:25 am 
Offline

Joined: Mon Jul 14, 2008 8:55 pm
Posts: 11
Hi AJ, jal

I add some delay between two commands. The sequences are as follows:

1. send RESET command to FDC
2. send OK
3. receive interrupt, handle interrupt(namely, send SENSEI command to FDC, get 2 result bytes, send SPECIFY command to FDC)
4. interrupt handle OK
5. wait about 1s

mov ecx, 0xFFFFFF
.loop:
dec ecx
nop
nop
nop
nop
cmp ecx, 0
jne .loop

6. re-send RESET command to FDC
7. NOTHING happen

I'll continue to try to find where the problem is located.

Thanks anyway.


Top
 Profile  
 
 Post subject: Re: floppy driver problem(interrupt), pls give me some advise
PostPosted: Tue Jul 15, 2008 1:13 pm 
Offline
Member
Member
User avatar

Joined: Fri Jan 27, 2006 12:00 am
Posts: 1444
This may help.
www.dex4u.com/demos/FloppyDriver.zip


Top
 Profile  
 
 Post subject: Re: floppy driver problem(interrupt), pls give me some advise
PostPosted: Wed Jul 16, 2008 7:40 am 
Offline

Joined: Mon Jul 14, 2008 8:55 pm
Posts: 11
Thanks Dex.

The problem has just been solved.

I forgot send EOI to 8259a and I found floppy controller is very sensitive about time delay which I always ignore.(Here, also thanks Adam
and JAL's reminder.)

BTW, DexOS is cool. :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Google [Bot] and 97 guests


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group