Subject: Re: power management and related concerns
To: Garrett D'Amore <>
From: Jachym Holecek <>
List: tech-kern
Date: 07/01/2006 15:04:25
# Garrett D'Amore 2006-07-01:
> Well, I've made the mistake of looking at what we currently have in
> NetBSD.  And comparing it with some real (our) hardware.
> There are few quick points for discussion:
> 1) there doesn't seem a clear way to indicate powerfail for a low
> battery condition in sysmon.  Should I just be sending init some signal?

Mmm, just notify powerd if present, and do nothing (except for printf)
otherwise? We probably don't want to cpu_reboot(RB_POWEROWN) here, the
battery could be flat-lying...

> 2) No way to indicate overtemp status either
> 3) Currently it isn't clear whether you should be registering with APM,
> sysmon, or something else for things like battery status, etc.  It would
> be really, really good if drivers didn't have to do _both_ of these
> things.  Can we maybe have a sysmon APM compatibility layer?  (I guess
> there are some userland apps that "know" about APM.  Bletch.)

Route everything to sysmon, keep APM/ACPI-centric userland interfaces

> 4) We need some userland tools to talk to sysmon in base, I think. 
> (E.g. to query batteries, etc.)
> 5) In many respects, sysmon looks like a good start.

Yes. What I think powerd needs is:

  * change event format to something text-based, so that new events
    can be created easily, w/o compatibility nightmares

  * AF_LOCAL interface so that other parts of userland can inject
    events (imagine commandline tool run from smb's tentative
    envstatd, or from UPS-over-serial-port software)

Well, there's a lot of work to be done in this area, really.

	-- Jachym