Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Jan 1999 17:45:08 -0800 (PST)
From:      Andrew Sherrod <ixkatl@yahoo.com>
To:        current@FreeBSD.ORG
Subject:   A problem with LBA in wd.c?
Message-ID:  <19990111014508.9942.rocketmail@send101.yahoomail.com>

next in thread | raw e-mail | index | archive | help
--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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990111014508.9942.rocketmail>