*BSD News Article 35559


Return to BSD News archive

Newsgroups: comp.os.386bsd.bugs
Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!bunyip.cc.uq.oz.au!munnari.oz.au!spool.mu.edu!howland.reston.ans.net!EU.net!sun4nl!cs.vu.nl!kjb
From: kjb@cs.vu.nl (Kees J. Bot)
Subject: Re: FreeBSD, fd0d: hard error
Message-ID: <Cvr6I0.4H6@cs.vu.nl>
Sender: news@cs.vu.nl
Organization: Fac. Wiskunde & Informatica, VU, Amsterdam
References: <33j9hp$41l@sol.sun.csd.unb.ca> <jmonroyCvozLK.5q9@netcom.com> <bakulCvpyuw.5nB@netcom.com>
Date: Wed, 7 Sep 1994 09:32:23 GMT
Lines: 52

bakul@netcom.com (Bakul Shah) writes:

>One possibility is the value in the GPL byte of the read/write
>command is incorrect.  I don't have FreeBSD sources anymore but a
>cursory glance at fd.c of NetBSD reveals this value to be on the
>high side for atleast the 1.2MB floppy type.  In general the gap1
>value should be lower for higher number of sectors/track.  The
>gap1 values used in FreeBSD fd driver should be compared against
>what Linux and dos do and corrected if necessary.

The Minix floppy driver is probably twice as old as the Linux or *BSD
drivers.  I trust its current incarnation as much as the BIOS driver (it
is usually even faster.)

Below is an outtake of the driver that lists the parameters.  Feel free
to ask me questions, I have had some doings with the driver.
--
	                        Kees J. Bot  (kjb@cs.vu.nl)
	              Systems Programmer, Vrije Universiteit Amsterdam
_._. .._ _   ._ ._.. ___ _. __.   _ .... .   _.. ___ _ _ . _..   ._.. .. _. .
/* Seven combinations of diskette/drive are supported.
 *
 * # Drive  diskette  Sectors  Tracks  Rotation Data-rate  Comment
 * 0  360K    360K      9       40     300 RPM  250 kbps   Standard PC DSDD
 * 1  1.2M    1.2M     15       80     360 RPM  500 kbps   AT disk in AT drive
 * 2  720K    360K      9       40     300 RPM  250 kbps   Quad density PC
 * 3  720K    720K      9       80     300 RPM  250 kbps   Toshiba, et al.
 * 4  1.2M    360K      9       40     360 RPM  300 kbps   PC disk in AT drive
 * 5  1.2M    720K      9       80     360 RPM  300 kbps   Toshiba in AT drive
 * 6  1.44M   1.44M    18	80     300 RPM  500 kbps   PS/2, et al.
 *
 * In addition, 720K diskettes can be read in 1.44MB drives, but that does
 * not need a different set of parameters.  This combination uses
 *
 * X  1.44M   720K	9	80     300 RPM  250 kbps   PS/2, et al.
 */
PRIVATE char gap[NT] =
	{0x2A, 0x1B, 0x2A, 0x2A, 0x23, 0x23, 0x1B}; /* gap size */
PRIVATE char rate[NT] =
	{0x02, 0x00, 0x02, 0x02, 0x01, 0x01, 0x00}; /* 2=250,1=300,0=500 kbps*/
PRIVATE char nr_sectors[NT] =
	{9,    15,   9,    9,    9,    9,    18};   /* sectors/track */
PRIVATE int nr_blocks[NT] =
	{720,  2400, 720,  1440, 720,  1440, 2880}; /* sectors/diskette*/
PRIVATE char steps_per_cyl[NT] =
	{1,    1,    2,    1,    2,    1,     1};   /* 2 = dbl step */
PRIVATE char mtr_setup[NT] =
	{1*HZ/4,3*HZ/4,1*HZ/4,4*HZ/4,3*HZ/4,3*HZ/4,4*HZ/4}; /* in ticks */
PRIVATE char spec1[NT] =
	{0xDF, 0xDF, 0xDF, 0xDF, 0xDF, 0xDF, 0xDF}; /* step rate, etc. */
PRIVATE char test_sector[NT] =
	{4*9,  14,   2*9,  4*9,  2*9,  4*9,  17};   /* to recognize it */