Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Jan 1999 03:51:12 +1100
From:      Bruce Evans <bde@zeta.org.au>
To:        freebsd-bugs@FreeBSD.ORG, yaldabaoth@geocities.com
Subject:   Re: [Modified Patch] Re: i386/9431: wd.c Does nto recognize certain LBA disks [patch attached]
Message-ID:  <199901121651.DAA10604@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
> (I could really use the input of some disk gurus here. Any idea why the
> Award BIOS would NOT return
> any flags?

The driver ignores the BIOS.  The flags are whatever you set them to be
in the FreeBSD configuration of the driver.

> 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?)

Support for LBA mode is nonexistent in 2.2.8 and dangerously incomplete
in 3.0 (if it is used, then kernel dumps may trash filesystems).  There
is no reason to use it because all known disks (except possibly yours :-)
support CHS mode.

> *** 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;  
> 

The magic number 16383 is tested because the current ATA (draft?) standard
specifies that CHS mode is specially broken for drives with more than
1024*255*63 sectors.  Such drives are supposed to have a C/H/S geometry of
16383/16/63 (or something like that) for their default translation mode
so that they work as least unwell as possible with old, broken BIOSes.
Previous versions of the standard permitted the default geometry to
have up to 65535 cylinders, and we know that drives with more than 32767
cylinders used to be made because the driver used to have sign extension
bugs for them.

The driver multiplies out the CHS values to get the number of sectors
unless the drive appears to have specially broken CHS.  It doesn't
trust the wdp_lbasize value otherwise because wdp_lbasize may be
garbage for old drives.  Drives with 16383 cylinders are presumably
new enough to have a valid wdp_lbasize.

Bruce

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?199901121651.DAA10604>