OSDev.org https://forum.osdev.org/ |
|
Floppy seek doesnt work https://forum.osdev.org/viewtopic.php?f=1&t=9199 |
Page 1 of 1 |
Author: | awas [ Tue Feb 17, 2004 11:34 am ] |
Post subject: | Floppy seek doesnt work |
Here is my seek code Code: #define CMD_SEEK 0x0f bool seek(unsigned int CylindirNo) { if(CurrentCylindir == CylindirNo) return TRUE; sendbyte(CMD_SEEK); sendbyte(0); sendbyte(CylindirNo); if(CheckInterruptStatus()) if(CurrentCylindir == CylindirNo) { return TRUE; } Print("FDC error"); return FALSE; } Whenever I call seek function, I get FDC error. And I dont hear any head moving voice from my floppy. Before calling seek I set motor on. My fdc led turns on but not works. Is there any error in my seek function or what may couse problem?? |
Author: | awas [ Wed Feb 18, 2004 2:53 am ] |
Post subject: | Re:Floppy seek doesnt work |
No answer? PS:I tried my seek function on real computer... |
Author: | Slasher [ Wed Feb 18, 2004 3:29 am ] |
Post subject: | Re:Floppy seek doesnt work |
Hi, you have not provided enough info. what does sendbyte do?have you initialized the controller properly? what does CheckInterruptstatus? how did you code all these functions? Most importantly, the seek causes an interrupt to be fired after the seek is completed so you need to wait for the floppy int on IRQ 14 to fire befor you check the status. Hope this helps. Else there are a lot of post here on floppy, use the seach onto of the screen. |
Author: | awas [ Wed Feb 18, 2004 1:14 pm ] |
Post subject: | Re:Floppy seek doesnt work |
What is IRQ 14? I think floppy irq is 6, doesnt it? And after calibration, and seek operation, irq 6 is not called in real computer but called in bochs. Why is irq6 not called in real machine?? |
Author: | Pype.Clicker [ Wed Feb 18, 2004 2:31 pm ] |
Post subject: | Re:Floppy seek doesnt work |
probably because you have something wrong in your PIC code or something alike ... as BOCHS is an idealized machine, there are things that can work with it and that will not work on a real machine ... The fact that BOCHS zeroes memory before you read it may be a reason ... |
Author: | jgmorford [ Wed Feb 18, 2004 5:45 pm ] |
Post subject: | Re:Floppy seek doesnt work |
IRQ6 is fired on a real machine. What CodeSlasher meant was that interrupt 0x0E (hooked to IRQ6) is fired on disk operation completions. Just set up interrupt 0x0E to set a completion flag and then re-enable IRQs on the master PIC. Then all you have to do is write a loop which checks the completion flag to know when you may proceed. Also, more problems may arise if you are not checking the contents of the diskette main status register (3F4) to ensure a write can be performed in your 'sendbyte' procedure. |
Page 1 of 1 | All times are UTC - 6 hours |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |