From owner-freebsd-amd64@FreeBSD.ORG Thu Dec 29 22:12:49 2005 Return-Path: X-Original-To: freebsd-amd64@freebsd.org Delivered-To: freebsd-amd64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 201F416A41F for ; Thu, 29 Dec 2005 22:12:49 +0000 (GMT) (envelope-from peter@wemm.org) Received: from canning.wemm.org (canning.wemm.org [192.203.228.65]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9758443D5E for ; Thu, 29 Dec 2005 22:12:26 +0000 (GMT) (envelope-from peter@wemm.org) Received: from fw.wemm.org (canning.wemm.org [192.203.228.65]) by canning.wemm.org (Postfix) with ESMTP id BF30C2A918 for ; Thu, 29 Dec 2005 14:12:24 -0800 (PST) (envelope-from peter@wemm.org) Received: from overcee.wemm.org (overcee.wemm.org [10.0.0.3]) by fw.wemm.org (Postfix) with ESMTP id 6033CE2B3 for ; Thu, 29 Dec 2005 14:12:24 -0800 (PST) (envelope-from peter@wemm.org) Received: from overcee.wemm.org (localhost [127.0.0.1]) by overcee.wemm.org (8.13.4/8.13.4) with ESMTP id jBTMCJv4036252; Thu, 29 Dec 2005 14:12:20 -0800 (PST) (envelope-from peter@wemm.org) Received: from localhost (localhost [[UNIX: localhost]]) by overcee.wemm.org (8.13.4/8.13.1/Submit) id jBTMCJOd036251; Thu, 29 Dec 2005 14:12:19 -0800 (PST) (envelope-from peter@wemm.org) X-Authentication-Warning: overcee.wemm.org: peter set sender to peter@wemm.org using -f From: Peter Wemm To: freebsd-amd64@freebsd.org Date: Thu, 29 Dec 2005 14:12:18 -0800 User-Agent: KMail/1.8.1 References: <63675.24.71.129.36.1135718125.squirrel@imap.sd73.bc.ca> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200512291412.19476.peter@wemm.org> Cc: Subject: Re: No APM yet for AMD? X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2005 22:12:49 -0000 On Wednesday 28 December 2005 07:41 am, Francisco Reyes wrote: > Freddie Cash writes: > >> That's ACPI... notice I typed "APCI". That was not a typo. > > It was a typo. :-( > I should have said... not ACPI.. > > > I think you mean APIC > > Correct. > > > (Advance Programmable Interrupt Controller), not > > APCI. There are options for APIC and ACPI, but I've never seen > > APCI anywhere in FreeBSD. > > No wonder I could not find it in any computer dictionary. :-) > > Back to the original question... How do I do power management on > AMD64? Even if it is just a function to see the battery status so I > don't end up loosing power in the middle of some work. sysctl hw.acpi.battery.life (percentage) sysctl hw.acpi.battery.time (time remaining) If you don't have acpi enabled, then you're sunk. On i386, acpi emulates the apm kernel API, so if you've got acpi enabled there, then all apm(8) access actually is implemented via acpi anyway. amd64 doesn't have the apm api wrapper for some reason that I don't remember now. (I suspect it was that it was binary incompatible with i386 binaries who would be the main users of it, so there'd need to be compat32 shims or something). i386 has real APM available as an option. amd64 cannot do that because it requires bios calls. We cannot do bios calls in 64 bit long mode, just like we can't do vm86 calls and can't do the VESA bios stuff. It just isn't possible in 64 bit mode. You have to leave 64 bit mode to do it, which means your own page tables, your own mini 32 bit kernel to handle interrupts, etc. It just isn't worth it. The effort to make this work would be far better spent on making acpi work, and/or finding and fixing the bugs in the machine's aml code. (FWIW we can load and use custom aml for a machine to replace a buggy version in the bios) -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com "All of this is for nothing if we don't go to the stars" - JMS/B5