From owner-freebsd-bugs Fri Jan 15 06:00:40 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id GAA17797 for freebsd-bugs-outgoing; Fri, 15 Jan 1999 06:00:40 -0800 (PST) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id GAA17789 for ; Fri, 15 Jan 1999 06:00:38 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.8.8/8.8.5) id GAA13867; Fri, 15 Jan 1999 06:00:02 -0800 (PST) Date: Fri, 15 Jan 1999 06:00:02 -0800 (PST) Message-Id: <199901151400.GAA13867@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.ORG From: Andrew Sherrod Subject: Re: kern/8590: kernel incorrectly recognizing Maxtor 11.5gb IDE hd Reply-To: Andrew Sherrod Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR kern/8590; it has been noted by GNATS. From: Andrew Sherrod To: freebsd-gnats-submit@freebsd.org, gme@caffeine.sundial.net, ixkatl@yahoo.com Cc: Subject: Re: kern/8590: kernel incorrectly recognizing Maxtor 11.5gb IDE hd Date: Fri, 15 Jan 1999 08:46:43 -0500 I may be able to help with your IDE disk problem. I have been trying to fix misreported disk sizes on my IDE disks, and found that the code will use CHS, even if this doesn't match the LBA size, unless LBA is turned on explicitly (3.0 only). My Award BIOS kept misreporting CHS sizes. The following two patches seem to fix it. The first is for 2.2.8 (though it should work for earlier 2.2.x versions) the second is for 3.0. Let me know if they help. Andrew Sherrod (ixkatl@yahoo.com) PS. See report i386/9431 for details, and my (lame) first attempts to fix it. If you respond, please reply to the yahoo address, as I don't check my work mail often. --------------EA0D5F70CF578339B1589242 Content-Type: text/plain; charset=us-ascii; name="diffc2a.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diffc2a.txt" *** wd.c.2_2_8 Wed Jan 13 11:45:04 1999 --- wd.c.original.2_2_8 Wed Jan 13 11:45:04 1999 *************** *** 113,122 **** #define WDOPT_FORCEHD(x) (((x)&0x0f00)>>8) #define WDOPT_MULTIMASK 0x00ff - /* This bit mask is used to determine if the drive supports LBA addressing. */ - - #define WDCAP_LBA 0x02 - /* * This biotab field doubles as a field for the physical unit number on * the controller. --- 113,118 ---- *************** *** 1731,1745 **** 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; ! ! /* Check for BIOS LBA flag. This should allow kernel to determine ! actual disk geometry for diffiuclt BIOSes. ! This will likely only be of use during initial installation, or ! perhaps when configuring a new drive. Otherwise, the disk geometry ! should already be known. -A. Sherrod 01/13/1999*/ ! ! if ( ( (wp->wdp_capability&WDCAP_LBA) || ! (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 = --- 1727,1733 ---- 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 = --------------EA0D5F70CF578339B1589242 Content-Type: text/plain; charset=us-ascii; name="diffc3a.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diffc3a.txt" *** wd.c.3_0 Wed Jan 13 12:07:46 1999 --- wd.c.original.3_0 Wed Jan 13 11:17:54 1999 *************** *** 130,140 **** */ #define id_physid id_scsiid - /* This bitmask is used to determine if the BIOS flags showing LBA support - are active or inactive */ - - #define WDCAP_LBA 0x02 - /* * Drive states. Used to initialize drive. */ --- 130,135 ---- *************** *** 1954,1973 **** 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 BIOS specifies LBA mode is supported, but LBA flags ! are not set, check if wdp_lbasize is larger than ! CHS size. If so, use the lba_size. ! This should fix problems with certain BIOSes (e.g. Award) ! which do not report the correct size when using only ! CHS calculations. ! This will not force the use of LBA mode. It is only ! used to determine disk geometry. ! ! -A. Sherrod 01/13/1999 */ ! ! if ( ( (wp->wdp_capabilities & WDCAP_LBA) || ! (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 = --- 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 (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 = --------------EA0D5F70CF578339B1589242-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message