From owner-freebsd-current@FreeBSD.ORG Mon Apr 12 17:55:48 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9BCFF16A4CE; Mon, 12 Apr 2004 17:55:48 -0700 (PDT) Received: from mailout2.pacific.net.au (mailout2.pacific.net.au [61.8.0.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id D483943D54; Mon, 12 Apr 2004 17:55:47 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.0.87])i3D0tX5v008969; Tue, 13 Apr 2004 10:55:33 +1000 Received: from gamplex.bde.org (katana.zip.com.au [61.8.7.246]) i3D0tUsg019606; Tue, 13 Apr 2004 10:55:32 +1000 Date: Tue, 13 Apr 2004 10:55:30 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Roman Kurakin In-Reply-To: <407995BF.7060504@cronyx.ru> Message-ID: <20040413101307.D1606@gamplex.bde.org> References: <4061E207.8070406@cronyx.ru> <407995BF.7060504@cronyx.ru> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-hackers@freebsd.org cc: freebsd-current@freebsd.org Subject: Re: ATA/CHS problem (path + new information) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Apr 2004 00:55:48 -0000 On Sun, 11 Apr 2004, Roman Kurakin wrote: > I remind you that now I have two problems. First one that FreeBSD uses > wrong assumption about which device should be CHS and which LBA: > > if (!ad_version(atadev->param->version_major) || > !(atadev->param->atavalid & ATA_FLAG_54_58) || !lbasize) > atadev->flags |= ATA_D_USE_CHS; > > True ATA device may not have ATA_FLAG_54_58 valid bit, and also due > to last ATA standard this bit is obsoleted. > > I also want to know why ata driver doesn't check LBA support from word 49? > May be this one check could solve my problems and didn't breake code for > non-ATA devices. Possibly for similar reasons. It's hard to tell what's in the LBA bit for pre-ATA devices older than LBA. Similarly for the lbasize words, but it's easier to do a sanity check on a 32-bit values that a 1-bit flag. > Second one, that only 20G part of my hard disk works with CHS. This is other > side of the same problem. Device should work in CHS mode. And it works > witch ICH5 controller. But with ICH2 it doesn't with out hack. > > I've checked standard again and I sew command 91h (Initialize drive > parameters). Check out the commands for limiting the (apparent) disk size. IIRC, the CHS limit can be set independently of the LBA limit, and some settings are harder than others so that they can't be cleared by old commands like 0x91. The limits may be set to prevent old drivers which only understand old commands from becoming confused by trying to actually use the whole disk. Bruce