Floppy overrun/underrun ("controller timeout") on real box

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.
Post Reply
User avatar
TyrelHaveman
Member
Member
Posts: 40
Joined: Thu Sep 20, 2007 11:20 pm
Location: Bellingham, WA
Contact:

Floppy overrun/underrun ("controller timeout") on real box

Post 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
System123
Member
Member
Posts: 196
Joined: Mon Jul 07, 2008 1:25 am

Re: Floppy overrun/underrun ("controller timeout") on real box

Post 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.
Gizmic OS
Currently - Busy with FAT12 driver and VFS
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Re: Floppy overrun/underrun ("controller timeout") on real box

Post 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.
quok
Member
Member
Posts: 490
Joined: Wed Oct 18, 2006 10:43 pm
Location: Kansas City, KS, USA

Re: Floppy overrun/underrun ("controller timeout") on real box

Post 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?
User avatar
TyrelHaveman
Member
Member
Posts: 40
Joined: Thu Sep 20, 2007 11:20 pm
Location: Bellingham, WA
Contact:

Re: Floppy overrun/underrun ("controller timeout") on real box

Post 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.
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Re: Floppy overrun/underrun ("controller timeout") on real box

Post by Dex »

Your welcome to take alook at mine http://dex4u.com/demos/FloppyDriver.zip
tarrox
Posts: 19
Joined: Wed Dec 31, 2008 8:40 am

Re: Floppy overrun/underrun ("controller timeout") on real box

Post 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
Post Reply