From owner-cvs-all Tue Dec 17 9: 3:19 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CBAC137B404 for ; Tue, 17 Dec 2002 09:03:15 -0800 (PST) Received: from mail.speakeasy.net (mail17.speakeasy.net [216.254.0.217]) by mx1.FreeBSD.org (Postfix) with ESMTP id 06D2543EDA for ; Tue, 17 Dec 2002 09:03:15 -0800 (PST) (envelope-from jhb@FreeBSD.org) Received: (qmail 11596 invoked from network); 17 Dec 2002 17:03:17 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) by mail17.speakeasy.net (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 17 Dec 2002 17:03:17 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.6/8.12.6) with ESMTP id gBHH3BUT012453; Tue, 17 Dec 2002 12:03:11 -0500 (EST) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.2 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <2340.1040055951@critter.freebsd.dk> Date: Tue, 17 Dec 2002 12:03:11 -0500 (EST) From: John Baldwin To: phk@FreeBSD.ORG Subject: Re: cvs commit: src/sys/boot/i386/boot2 boot2.c Cc: cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 16-Dec-2002 phk@FreeBSD.ORG wrote: > In message , John Baldwin writes: >> >>On 14-Dec-2002 Poul-Henning Kamp wrote: >>> phk 2002/12/14 09:34:28 PST >>> >>> Modified files: >>> sys/boot/i386/boot2 boot2.c >>> Log: >>> Don't fill in the table with the BIOS idea about disk-geometry, we don't >>> use it. This saves a surprising number of bytes. >> >>It might be nice to use it at some point to improve sysinstall's geometry >>guesses. At least that was the plan. > > Well, ACPI can tell us too, and that will even tell which drive is which, > something this old hack didn't tell us. Uh, it can? How? ACPI can tell you what IDE controllers are present and what timing parameters to use when doing suspend/resume, but it doesn't tell you what disks are present AFAIK. Well, it might tell you the disks, but it doesn't tell you the geometries. There's no AML defined for listing BIOS geometries. Here's what the IDE controller on my laptop with an ejectable CD-ROM looks like: Device(PX41) { Name(_ADR, 0x00070001) /* PCI device 7, function 1 */ Device(PRIM) { Name(_ADR, 0x0) /* Primary channel */ Method(_STA) { Store("PCI IDE Primary _STA", Debug) Return(0xf) } Device(MAST) { Name(_ADR, 0x0) /* Master device is fixed */ } Device(SLAV) { Name(_ADR, 0x1) /* Slave device is fixed.. note that I don't actually have a slave device installed, nor is there room for one. */ } } Device(SECN) { Name(_ADR, 0x1) /* Secondary channel */ Method(_STA) { Store(0x1, \_SB_.PCI0.PX41.SIDE) Return(0xf) } Device(MAST) { Name(_ADR, 0x0) /* Master device, ejectable */ Method(_STA) { /* status, checks if a device is present */ Store(BEXT(), Local7) Return(Local7) } Method(_EJ3, 1) { /* device can be ejected at S3 sleep state after calling this method */ If(Arg0) { Store(0x0, \_SB_.PCI0.PX41.SIDE) Store(0x1, \_SB_.PCI0.PX40.SISI) Store(0x1, \_SB_.PCI0.PX43.SDPW) } Return(0x0) } } Device(SLAV) { Name(_ADR, 0x1) /* Slave device, ejectable */ Method(_STA) { /* status, same as above */ Store(BEXT(), Local7) Return(Local7) } Name(_EJD, "\_SB_.PCI0.PX41.SECN.MAST") } Method(BEXT) { /* method to see if a device is present in the battery bay that is an IDE device on the secondary channel */ If(\_SB_.PCI0.PX40.ECOK()) { Store(0x0, Local7) Store(\_SB_.PCI0.PX40.EC0_.SHDD, Local0) Store(\_SB_.PCI0.PX41.SIDE, Local1) Store(LNot(\_SB_.PCI0.PX43.SDPW), Local2) Store(LNot(\_SB_.PCI0.PX43.SRST), Local3) Store(LNot(\_SB_.PCI0.PX40.SISI), Local4) If(LAnd(Local0, Local1)) { If(LAnd(Local2, Local3)) { If(Local4) { Store(0xf, Local7) } } } If(LNot(Local7)) { Store(0x1, \_SB_.PCI0.PX43.SDPW) } } Else { Store(0xf, Local7) } Return(Local7) } } My laptop doesn't even have the timing parameter stuff. But note that ACPI doesn't tell you if drives are present unless they are ejectable (such as in a laptop's device bay) and then it will tell you that something is present, but it doesn't tell you if it's a CD-ROM, hard drive, etc. If you go read the ACPI spec (www.acpi.info) you will find on provisions for communicating BIOS geometries. Matching up BIOS geometries to drive geometries isn't but so hard. BIOS geometries are in a order. There are some ambiguous cases that you can't figure out which is which, but there are many cases when you _can_ figure out which drives have which BIOS geometries and then it can be a great help. That said, I haven't heard of sysinstall screwing up geometry (aside from the 0 heads thing it currently has due to int32_t limits being exceeded I think) in a while so it may not be all that pressing of a matter. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message