Page 1 of 1
Floppy overrun/underrun ("controller timeout") on real box
Posted: Sun Mar 15, 2009 6:48 pm
by TyrelHaveman
Greetings,
First of all, my floppy driver (which is based off the tutorial
here in the forum) works perfectly in VMware. I'm having some difficulty getting it to work on a real machine, however.
I am able to calibrate the drive and seek successfully (all returns are affirmative). However once I try to read a track, I'm having a problem. First of all, I get two interrupts instead of one in response to command 0xC6. I check the response from the floppy, and bit 4 of ST1 is set, which according to the code in the tutorial is "controller timeout" and according to the Intel 80277AA manual indicates is "set if the 82077AA does not receive CPU or DMA service within the required time interval resulting in data overrun or underrun."
I retry several times and get no success from it. But again it works great in VMware. Any ideas?
Let me know if there's more info I can provide.
Thanks,
Tyrel
Re: Floppy overrun/underrun ("controller timeout") on real box
Posted: Mon Mar 16, 2009 6:35 am
by System123
I used the same tutorial for my Floppy driver, in the beginning I had a similar problem but not quite the same. I would only receive on interrupt. but maybe it is the same problem. The problem was IRQ 7, you need to mask it off. Else check my code,link in signature, to see if you maybe missed something.
Re: Floppy overrun/underrun ("controller timeout") on real box
Posted: Mon Mar 16, 2009 12:12 pm
by Dex
If things work ok in emulator, but not on real hardware, delays can be the problem, not likely in this case, as it should of been tested, before release.
Re: Floppy overrun/underrun ("controller timeout") on real box
Posted: Mon Mar 16, 2009 12:37 pm
by quok
Dex wrote:If things work ok in emulator, but not on real hardware, delays can be the problem, not likely in this case, as it should of been tested, before release.
I'd still say that delays are the likely culprit here. Mystran's tutorial has this to say:
You will also need to be able to sleep() for certain amounts of time, so you also need some sort of timer support. The version of sleep() I'll be using takes it's arguments as number of ticks, which are 10ms each, but I'll put comment on each sleep() with the real time, so you don't have to remember this. The normal rule with timers is that they never wake you before the requested time has elapsed, so sleep(1) really waits for two ticks: one so we know a point in time to count from, and another so we know a full period between ticks has elapsed.. but that's how every good timer works.
Does the OP's sleep() function (or timer_sleep(), as used in the tutorial) potentially wait a lot longer than it should, or does it maybe not wait long enough?
Re: Floppy overrun/underrun ("controller timeout") on real box
Posted: Mon Mar 16, 2009 5:27 pm
by TyrelHaveman
quok wrote:I'd still say that delays are the likely culprit here. Does the OP's sleep() function (or timer_sleep(), as used in the tutorial) potentially wait a lot longer than it should, or does it maybe not wait long enough?
Well, it certainly is waiting long enough, any time that I use my ksleep function. It's always possible it could be waiting longer than intended, since it is a multitasking operating system and there already at least 3 tasks running when the floppy driver starts being used here. However it doesn't seem to me like waiting too long would be a problem anywhere.
Here is something else that may be worth noting: Not only does the floppy driver work in VMware (both Server 1.0 and 2.0) with a virtual floppy drive (image file), it also works when using a machine's physical floppy drive from VMware. It just doesn't work when using the physical floppy drive when it's running natively on the machine. So I suspect VMware's sort-of-virtual floppy driver is being a bit more lenient with me or something.
I'm going to spend some time to look over all of my code again and compare it to several example drivers again just to be sure I'm getting everything I need. Let me know if you think of anything else though.
Thanks again.
Re: Floppy overrun/underrun ("controller timeout") on real box
Posted: Tue Mar 17, 2009 11:53 am
by Dex
Re: Floppy overrun/underrun ("controller timeout") on real box
Posted: Wed Mar 18, 2009 12:41 pm
by tarrox
I would suggest to try out different emulators. When I was programming my floppy-driver, everyone was telling different errors and were handling time in its own way.
My Emulators: VirtualPC, Bochs and VirtualBox