Floppy driver speed

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
ASHLEY4

Floppy driver speed

Post by ASHLEY4 »

I have just made a floppy driver for pmode, the basic's are done, i have followed the Intel manual and implemented all steps, as written in the manual for each function.
reset, seek, recalibrate,read/write sector etc.

All function work as they should, but with the delays done as per manual, it reads sector visibly slower than doing the same function using int 13h from realmode.
20 sector take about 6 seconds to read, using bios may be 1 to 2 seconds.
Has any one else found there driver slower ?.
Also what is the size of dma buffer you use ?.

The above driver is done in asm.

\\\\||////
(@@)
ASHLEY4.
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re:Floppy driver speed

Post by Brendan »

Hi,
ASHLEY4 wrote: Has any one else found there driver slower ?.
Also what is the size of dma buffer you use ?.
I wrote my floppy driver (NASM) around a year ago, mostly following Intel's datasheets. I timed it by dumping the floppy data to the screen ("type FDA0") and it took 67 seconds to read an entire 1.44 floppy from start to end. This time includes automatically detecting the media type (the driver attempts to read from different parts of the disk using different data rates, etc until it's determined the correct media type - I don't use DOS's Bios Parameter Block). I'd guess this auto-detection adds half a second or so, but I can't easily skip the auto-detection as it happens the first time the floppy is read, which puts at least one cylinder of data into the floppy driver's cache.

Then I timed it using "rawwritewin.exe" to copy the entire floppy to an image file (on hard disk) under windows 98 (same computer). This took 60 seconds exactly, and I'm assuming the overhead of writing to the hard drive is negligable due to "write behind caching" and speed of the hard disk.

The 7 seconds difference is possibly due to Windows using PIO instead of DMA. PIO would be a little faster but consumes far too much CPU time (Windows becomes extremely unresponsive, while under my OS you don't notice any difference).

The DMA buffer I use is large enough to hold the data for a single cylinder, and the floppy driver always reads entire cylinders into it's cache. Because of this (and the auto-detection) I haven't tried to figure out how quickly it can read 6 sectors only.


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
ASHLEY4

Re:Floppy driver speed

Post by ASHLEY4 »

Brendan, thanks for the info.

\\\\||////
(@@)
ASHLEY4.

Batteries not included,Some assembly required.
Post Reply