Subject: wdc driver and very old (40MB conner) disk drive
To: None <port-i386@netbsd.org>
From: Wojciech Puchar <wojtek@chylonia.3miasto.net>
List: port-i386
Date: 02/17/2002 20:19:11
i have problems with such drives on NetBSD.
one problem was that multisector ability were misdetected but i've got
patch some time ago (from Manuel Bouyer) and it works.

yes works - but REALLY slow. and the faster is machine, the slower is
drive. for example it's 280kB/s (closest to 450kB/s it can really do) on
386DX/33, 40-200kB/s on 486/33 (depends of cache and ISA config in BIOS)
and 10-20kB/s on pentium-100. write speeds are even worse.


i found that linux have the same problem, but there is an boot option
"hda=slow" that fixes it. linux code fragments for that are below.
my question is - how to implement in in NetBSD driver which use bus_*
functions.... i tried few times but with no success (same speed) so i must
be doing something wrong. i tried replacing bus_*_multi functions with for
and non-multi bus function.
is another way to do it or maybe it's another thing to do too?

while it sounds funny of using such drives, but i've got bunch of them
almost for free and they have more than enough space for
routing/ssh/dns/etc purposes.




#if SUPPORT_SLOW_DATA_PORTS
                if (drive->slow) {
                        unsigned short *ptr = (unsigned short *) buffer;
                        while (wcount--) {
                                *ptr++ = inw_p(IDE_DATA_REG);
                                *ptr++ = inw_p(IDE_DATA_REG);
                        }
                } else
#endif /* SUPPORT_SLOW_DATA_PORTS */
                        insw(IDE_DATA_REG, buffer, wcount<<1);
        }


#if SUPPORT_SLOW_DATA_PORTS
                if (drive->slow) {
                        unsigned short *ptr = (unsigned short *) buffer;
                        while (wcount--) {
                                outw_p(*ptr++, IDE_DATA_REG);
                                outw_p(*ptr++, IDE_DATA_REG);
                        }
                } else
#endif /* SUPPORT_SLOW_DATA_PORTS */
                        outsw(IDE_DATA_REG, buffer, wcount<<1);
        }


----------------------------------------------------------------------
Instead of asking why a piece of software is using "1970s technology,"
start asking why software is ignoring 30 years of accumulated wisdom.