Why is the floppy driver always busy in seek mode ?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
User avatar
Thor
Member
Member
Posts: 51
Joined: Mon Jul 06, 2009 12:55 am
Location: Kamloops, BC, Canada

Re: Why is the floppy driver always busy in seek mode ?

Post by Thor »

No, my code clearly starts the motor through 0x3F2, sends the seek command to 0x3F5, and then polls 0x3F4...

I'm sick of this, I'm not trying to help you anymore with such an easy, insignificant problem. If you read something about the FDC for 5 seconds you could make this work. Just stop waiting for others to do the work for you and RTFM. Seriously, you've been waiting for a week for someone to tell you how to do it when you could have reached the wiki or any other of the millions of resources on the internet within 30 seconds and easily found the solution to your problem.
Vancouver Canucks fan for life
User avatar
WhiteSpirit
Posts: 16
Joined: Sat Jul 18, 2009 2:53 pm

Re: Why is the floppy driver always busy in seek mode ?

Post by WhiteSpirit »

Last edited by Thor on Thu Jul 30, 2009 9:56 pm, edited 1 time in total.
Hmm, yes ...

Well thanks for your help, I'm definitely an idiot because I avoid copying codes from other peoples sites .
User avatar
Thor
Member
Member
Posts: 51
Joined: Mon Jul 06, 2009 12:55 am
Location: Kamloops, BC, Canada

Re: Why is the floppy driver always busy in seek mode ?

Post by Thor »

That isn't what I meant at all. I'm done with you though, so... I'll just leave you with this link

FDC Datasheet
Vancouver Canucks fan for life
User avatar
WhiteSpirit
Posts: 16
Joined: Sat Jul 18, 2009 2:53 pm

Re: Why is the floppy driver always busy in seek mode ?

Post by WhiteSpirit »

And hey, your code still lets the MSR bit 0 ( Drive 0 Busy in Seek mode ) at 1, so it isn't improving anything here ;)

The "test al, 0x11" is just "cheating" to get rid of the polling loop, nothing more .

And I've already visited that links and there's where I got the ports, thanks anyway .

EDIT :

another info, it's still blocked in the polling loop .
Last edited by WhiteSpirit on Thu Jul 30, 2009 3:15 pm, edited 1 time in total.
User avatar
Thor
Member
Member
Posts: 51
Joined: Mon Jul 06, 2009 12:55 am
Location: Kamloops, BC, Canada

Re: Why is the floppy driver always busy in seek mode ?

Post by Thor »

Test al, 0x11 masks all but the BSY and DRV0-BSY bits. If either of them is set (ie. zero flag IS NOT set) I loop. If they are both clear (ie, zero flag set) it will exit the loop and move on.

0x11 = 00010001
Last edited by Thor on Thu Jul 30, 2009 3:17 pm, edited 1 time in total.
Vancouver Canucks fan for life
User avatar
WhiteSpirit
Posts: 16
Joined: Sat Jul 18, 2009 2:53 pm

Re: Why is the floppy driver always busy in seek mode ?

Post by WhiteSpirit »

Thor wrote:Test al, 0x11 masks all but the BSY and DRV0-BSY bits. If either of them is set (ie. zero flag IS NOT set) I loop. If they are both clear (ie, zero flag set) it will exit the loop and move on.
But you didn't change anything as the MSR bit 0 is still 1 and the code doesn't leave the polling loop .
User avatar
WhiteSpirit
Posts: 16
Joined: Sat Jul 18, 2009 2:53 pm

Re: Why is the floppy driver always busy in seek mode ?

Post by WhiteSpirit »

The only things that you changed on my code are :

Code: Select all

shl al, 4 ;; Checking CTRL BUSY ( bit 4 )
jc poll_seek
shl al, 4 ;; Checking DRV 0 BUSY ( bit 0 )
jc poll_seek
Replaced by

Code: Select all

test al, 0x11
jnz poll_seek
and you removed the poll_motor_start routine .

Only that ( which doesn't change anything, just code's size ), and you suggest me to read again Intel's docs ?
User avatar
Thor
Member
Member
Posts: 51
Joined: Mon Jul 06, 2009 12:55 am
Location: Kamloops, BC, Canada

Re: Why is the floppy driver always busy in seek mode ?

Post by Thor »

Look, just use the BIOS. The FDC needs a bunch of code to initialize it to get it working the way you want, not to mention you'll need to make a DMA driver as well. Write a floppy driver once you're in protected mode. If you REALLY WANT to make it in your bootsector, read the intel docs. Near the back it gives you step-by-step instructions of how to initialize, read, and write.
Vancouver Canucks fan for life
User avatar
WhiteSpirit
Posts: 16
Joined: Sat Jul 18, 2009 2:53 pm

Re: Why is the floppy driver always busy in seek mode ?

Post by WhiteSpirit »

Thor wrote:Look, just use the BIOS. The FDC needs a bunch of code to initialize it to get it working the way you want, not to mention you'll need to make a DMA driver as well. Write a floppy driver once you're in protected mode. If you REALLY WANT to make it in your bootsector, read the intel docs. Near the back it gives you step-by-step instructions of how to initialize, read, and write.
Why didn't you just say that before instead of saying "I made it work fine", "Understand how your own code works" etc... ?

You didn't make it working, and worse, you just changed/removed some lines .

But thanks, I'll look again at the Intel docs .
Post Reply