[patch] acpi_battery -- notify critical 'life' via devd(8)
Pietro Cerutti
gahr at FreeBSD.org
Fri May 23 15:13:42 UTC 2008
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Hi Nate, list,
pre-everything:
my knowledge of the ACPI subsystem is very limited,
as is my understanding of general kernel mechanisms.
--> if this patch is crap, please be patient with me :)
reason:
I want my laptop to notify me when the battery life
reaches a certain critical low level (say, 5%).
solution:
I've implemented a kernel process in acpi_battery which
notifies devd(8) when the critical level is reached.
For this, I've added the following sysctl OIDs to the
hw.acpi.battery tree:
polling_rate: in seconds, self explaining...
critical_level: in percent, also self explaining...
questions:
I've chosen a notify of 0x80 for this event. The reason
just being that I've seen acpi_thermal starting its own
notify values with this number.
Is there any guidelines for Notify values?
devd:
This patch allows for a devd.conf(5) entry such as:
notify 10 {
match "system" "ACPI";
match "subsystem" "Battery";
match "notify" "0x80";
action "logger -p kern.emerg 'WARNING: low battery!'";
};
the patch:
http://gahr.ch/FreeBSD/patches/_pending/acpi_battery.c.diff
Any comments, tests, bug-reports, ... welcome!
Thanks!
P.S. please CC me as I don't follow freebsd-acpi@ (yet).$
- --
Pietro Cerutti
gahr at FreeBSD.org
PGP Public Key:
http://gahr.ch/pgp
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (FreeBSD)
iEYEAREKAAYFAkg215QACgkQwMJqmJVx9451lQCfZuNpsOOvalRvKrlu1VcQtP0M
aAoAn2iXdHxrCzeAy+8qj5vMPgO9xCn4
=UIgG
-----END PGP SIGNATURE-----
More information about the freebsd-acpi
mailing list