Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 02 Oct 2002 05:40:57 +0900 (JST)
From:      Mitsuru IWASAKI <iwasaki@jp.FreeBSD.org>
To:        rodrigc@attbi.com
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: ACPI programming under FreeBSD?
Message-ID:  <20021002.054057.109173550.iwasaki@jp.FreeBSD.org>
In-Reply-To: <20021001162300.A31745@attbi.com>
References:  <20021001162300.A31745@attbi.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021002.054057.109173550.iwasaki>