OSDev.org

The Place to Start for Operating System Developers
It is currently Sat Apr 27, 2024 2:17 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Floppy seek doesnt work
PostPosted: Tue Feb 17, 2004 11:34 am 
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??


Top
  
 
 Post subject: Re:Floppy seek doesnt work
PostPosted: Wed Feb 18, 2004 2:53 am 
No answer?

PS:I tried my seek function on real computer...


Top
  
 
 Post subject: Re:Floppy seek doesnt work
PostPosted: Wed Feb 18, 2004 3:29 am 
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.


Top
  
 
 Post subject: Re:Floppy seek doesnt work
PostPosted: Wed Feb 18, 2004 1:14 pm 
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??


Top
  
 
 Post subject: Re:Floppy seek doesnt work
PostPosted: Wed Feb 18, 2004 2:31 pm 
Offline
Member
Member
User avatar

Joined: Wed Oct 18, 2006 2:31 am
Posts: 5964
Location: In a galaxy, far, far away
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 ...

_________________
Image May the source be with you.


Top
 Profile  
 
 Post subject: Re:Floppy seek doesnt work
PostPosted: Wed Feb 18, 2004 5:45 pm 
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.


Top
  
 
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: Bing [Bot], Google [Bot], Majestic-12 [Bot] and 27 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