Subject: Re: AC adapter event
To: None <lukem@NetBSD.org>
From: Takayoshi Kochi <kochi@netbsd.org>
List: port-i386
Date: 05/04/2004 14:21:46
Hi,

>   | While you are working on it: It would be nice if we
>   | could hook into the "battery critical low" event too.
>   | My laptop always crashes hard if it runs out of battery.
>   | Shutting down cleanly would at least help until
>   | suspend/resume works.
> 
> "oh yes"
> 
> (I would like that functionality too :)

Yes, that would be nice.

For batteries, 'critical low' event (in this context, event
is a hardware interrupt) is not guaranteed on every laptop (IMO).
Thus someone has to poll the status of the remaining capacity.

This can be done in kernel (kernel thread or callouts) but also
can be done in userland (using envsys(4)).

As most necessary information is available via envstat(8), this
userland thing is as easy as a simple shell script.

I'm not inclined to abuse the kernel<->powerd interface for this
matter.

---
Takayoshi Kochi