From owner-freebsd-current Sun Jan 10 17:46:32 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id RAA13632 for freebsd-current-outgoing; Sun, 10 Jan 1999 17:46:32 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from send101.yahoomail.com (send101.yahoomail.com [205.180.60.87]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id RAA13622 for ; Sun, 10 Jan 1999 17:46:30 -0800 (PST) (envelope-from ixkatl@yahoo.com) Message-ID: <19990111014508.9942.rocketmail@send101.yahoomail.com> Received: from [207.172.145.121] by send101.yahoomail.com; Sun, 10 Jan 1999 17:45:08 PST Date: Sun, 10 Jan 1999 17:45:08 -0800 (PST) From: Andrew Sherrod Subject: A problem with LBA in wd.c? To: current@FreeBSD.ORG MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="0-1998898814-916019108=:1509" Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG --0-1998898814-916019108=:1509 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline I think I found a problem in the wd.ccode which makes it unable to recognize certain LBA disks. The code assumes any LBA disk will return 16383 as the number of cylinders. In my case, at least (Award BIOS on a Tyan Trinity motherboard) two of the three disks do NOT return this number, so the disk size is underestimated by the kernel probes. [Yes, I DID fix this by putting on a DOS partition, but wouldn'tit be nice to not have to rely on DOS partitions for disk geometry?] Well, I don't know if this fixes any other disk geometry problems, as I haven't tried it out very extensively, but this patch does make dmesg (and the boot time probes) return the correct number of sectors. Could anyone tell me if this breaks anything? And what the reasoning was behind the 16383 restriction. (After all, it only reaches that line of code if the LBA flag is set anyway. So we already know it is in LBA mode. The 16383 seems superfluous.) Andrew Sherrod _________________________________________________________ DO YOU YAHOO!? Get your free @yahoo.com address at http://mail.yahoo.com --0-1998898814-916019108=:1509 Content-Type: text/plain; name="diff.txt" Content-Description: diff.txt Content-Disposition: inline; filename="diff.txt" --- wd.c Sun Jan 10 20:47:05 1999 +++ wd.c.original Sun Jan 10 20:27:52 1999 @@ -1949,14 +1949,8 @@ du->dk_dd.d_ntracks * du->dk_dd.d_nsectors; du->dk_dd.d_secperunit = du->dk_dd.d_secpercyl * du->dk_dd.d_ncylinders; - - /* The original code assumed LBA would return - 16383 for number of cylinders. Not all BIOSes - return this value. Thus, the patch assumes if - an LBA value is returned, that LBA is active. - -A. Sherrod 01/10/1999 */ - - if( du->dk_dd.d_secperunit < wp->wdp_lbasize) { + if (wp->wdp_cylinders == 16383 && + du->dk_dd.d_secperunit < wp->wdp_lbasize) { du->dk_dd.d_secperunit = wp->wdp_lbasize; du->dk_dd.d_ncylinders = du->dk_dd.d_secperunit / du->dk_dd.d_secpercyl; --0-1998898814-916019108=:1509-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message