From owner-freebsd-hackers Tue Oct 1 13:41:18 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CE05037B401 for ; Tue, 1 Oct 2002 13:41:16 -0700 (PDT) Received: from tasogare.imasy.or.jp (tasogare.imasy.or.jp [202.227.24.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9F05843E75 for ; Tue, 1 Oct 2002 13:41:14 -0700 (PDT) (envelope-from iwasaki@jp.FreeBSD.org) Received: from localhost (iwa@tasogare.imasy.or.jp [202.227.24.5]) by tasogare.imasy.or.jp (8.11.6+3.4W/8.11.6/tasogare) with ESMTP/inet id g91Kf4Y66089; Wed, 2 Oct 2002 05:41:05 +0900 (JST) (envelope-from iwasaki@jp.FreeBSD.org) Date: Wed, 02 Oct 2002 05:40:57 +0900 (JST) Message-Id: <20021002.054057.109173550.iwasaki@jp.FreeBSD.org> To: rodrigc@attbi.com Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: ACPI programming under FreeBSD? From: Mitsuru IWASAKI In-Reply-To: <20021001162300.A31745@attbi.com> References: <20021001162300.A31745@attbi.com> X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.0 (HANANOEN) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi, > I am interested in retrieving power statistics type of information from a > system running FreeBSD. I am interested in information such as: > power consumed, temperature, percentage of battery available, etc. > > Is it possible to do this with ACPI, and if so, are there any > examples of how to gather this information at the user-level? Yes, you can get them via sysctl, like % sysctl hw.acpi hw.acpi.power_button_state: S5 hw.acpi.sleep_button_state: S4 hw.acpi.lid_switch_state: NONE hw.acpi.standby_state: S4 hw.acpi.suspend_state: S4 hw.acpi.sleep_delay: 0 hw.acpi.s4bios: 1 hw.acpi.verbose: 0 hw.acpi.cpu.max_speed: 8 hw.acpi.cpu.current_speed: 8 hw.acpi.cpu.performance_speed: 8 hw.acpi.cpu.economy_speed: 8 hw.acpi.thermal.min_runtime: 300 hw.acpi.thermal.polling_rate: 30 hw.acpi.thermal.tz0.temperature: 3262 hw.acpi.thermal.tz0.active: -1 hw.acpi.thermal.tz0.thermal_flags: 0 hw.acpi.thermal.tz0._PSV: -1 hw.acpi.thermal.tz0._HOT: -1 hw.acpi.thermal.tz0._CRT: 3652 hw.acpi.thermal.tz0._ACx: 3372 -1 -1 -1 -1 -1 -1 -1 -1 -1 hw.acpi.acline: 0 hw.acpi.battery.life: 99 hw.acpi.battery.time: 357 hw.acpi.battery.state: 1 hw.acpi.battery.units: 1 hw.acpi.battery.info_expire: 30 I think my fivamon (Monitor for ACPI and Crusoe Longrun info.) will be an example of application development. It's diff against wmmon Dock. http://people.freebsd.org/~iwasaki/acpi/fivamon-20011124.diff http://people.freebsd.org/~iwasaki/acpi/fivamon-1.gif http://people.freebsd.org/~iwasaki/acpi/fivamon-2.gif http://people.freebsd.org/~iwasaki/acpi/fivamon-3.gif > How stable is ACPI support in -STABLE and -CURRENT for this > kind of work? Currently ACPI support is available in only -CURRENT. But John Baldwin (jhb@FreeBSD.org) has patches for -STABLE. The stability is depending on what machine you have, I think. If you have the same machine with ACPI developer, the machine is supported very well :-) Thanks To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message