Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Jan 1999 18:24:34 -0800 (PST)
From:      Andrew Sherrod <ixkatl@yahoo.com>
To:        current@FreeBSD.ORG
Cc:        ixkatl@yahoo.com
Subject:   Fwd: [Modified Patch] Re: i386/9431: wd.c Does nto recognize certain LBA disks [patch attached]
Message-ID:  <19990112022434.28366.rocketmail@send101.yahoomail.com>

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

Have to correct myself.

My original message 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't it 
> 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

[Patch omitted]

---------------------------------------------------

My follow-up post to GNATS:


> Correcting my own mistake here. (Never try to patch
>something too late at night.)
 
> The piece of code I changed was NOT inside the LBA
> flag portion. Insterad, it was in the "else" part
> of the "if lba_flag" code.

> The reason? It seems Award BIOS (at least some
> versions) do not return any flags when LBA is active.
> So, the patch still stands, it simply needs a better
> explanation.
 
> (I could really use the input of some disk gurus
> here. Any idea why the Award BIOS would NOT return
> any flags? And, more important, if LBA is not 
> enabled, will any lba_size value be returned?Or if
> LBA is off is a null or 0 returned?)
 
> Proposed patches for 2.2.8 and 3.0.0 follow:


> *** wd.c.2_2_8	Mon Jan 11 20:59:44 1999
> --- wd.c.original.2_2_8	Mon Jan 11 20:41:01 1999
> ***************
> *** 1727,1740 ****
>   	du->dk_dd.d_nsectors = wp->wdp_sectors;  
>   	du->dk_dd.d_secpercyl = 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;  
> !         /* It appears that Award BIOSes (At least the more recent
> !            versions) do not return an LBA flag when probed. However,
> !            as an LBA size should not be returned when LBA mode is
not
> !            active, this hack seems safe.
> ! 
> !            A. Sherrod 01/11/1998   */
> ! 
> !         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;   
> --- 1727,1734 ----
>   	du->dk_dd.d_nsectors = wp->wdp_sectors;  
>   	du->dk_dd.d_secpercyl = 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;   
> >
> *** wd.c.3_0	Mon Jan 11 21:01:30 1999
> --- wd.c.original.3_0	Sun Jan 10 21:27:22 1999
> ***************
> *** 1949,1964 ****
>   			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;  
> !                
> ! 		/* It appears that certain Award BIOSes (newer versions
> ! 		   apparently) do not return LBA flags when LBA is
> ! 		  active. Hwoever, as LBA size should not be returned
> ! 		  when LBA is off, this hack should be safe.
> ! 
> ! 		  A. Sherrod 01/11/1998   */
> ! 
> ! 
> ! 		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;  
> 

_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com


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?19990112022434.28366.rocketmail>