Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Jan 1999 18:32:03 -0800 (PST)
From:      ixkatl@yahoo.com
To:        freebsd-gnats-submit@FreeBSD.ORG
Subject:   i386/9431: wd.c Does nto recognize certain LBA disks [patch attached]
Message-ID:  <199901110232.SAA18087@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         9431
>Category:       i386
>Synopsis:       wd.c Does nto recognize certain LBA disks [patch attached]
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jan 10 18:40:00 PST 1999
>Closed-Date:
>Last-Modified:
>Originator:     Andrew Sherrod
>Release:        2.2.8 / 3.0.0 (Patch diff for 3.0.0, but works on 2.8.8 as well.)
>Organization:
>Environment:
>Description:
My email to -current:


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

>How-To-Repeat:

>Fix:
*** wd.c	Sun Jan 10 21:27:38 1999
--- wd.c.original	Sun Jan 10 21:27:22 1999
***************
*** 1949,1955 ****
  			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;  
! 		if(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;  
--- 1949,1956 ----
  			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;  
! 		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;  

>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message



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