[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: apmd doesn't log battery status




On Fri, 21 Jan 2000, Thomas Vogels wrote:

> same problem here with a TP385.  Please check the docu for the TP310
> series whether the batteries actually support this information.
> I.e. my batteries only "know" the critical state (< 10%?), the normal
> state (>10%, <80%) and the fully charged state (>80%).

They probably do report that kind of information, as the ms-windows
battery utility displays it quite correctly.

> >> So, this is the question, what can I do to have the kernel check
> >> (or report, or "be informed bye the bios", or whatever) the battery
> >> status ? I guess that this is an apm bios probem, but I couldn't yet
> >> figure out where I'm doing wrong. And of course, I don't always have the
> >> power supply with me to force the check by doing a power cycle...
> 
> you can randomly check by using either of the following two commands:
> 
> $ apm
> AC on-line, battery status high: 80%
> $ cat /proc/apm 
> 1.2 1.1 0x03 0x01 0x00 0x09 80% -1 ?

The fact is that the /proc/apm info is *not* updated as time goes on. To
have this data updated, I need to do a power cycle (or power supply
plug/unplug cycle). If I don't, it will just stay the same until it
reaches the 5% limit at which the computer complains.

This means (I've tried to read the kernel sources) probably that when the
kernel checks the data structures of the APM bios, the data in them is not
updated by the bios from the hardware. What is surprising is that it works
from windows. I suspect some kind of trick with the bios, and not a
spectific windows driver trick, because it does even work from plain
MS-DOS (5.0) with the POWER utility.

For short, the "hdparm -u1" allowed the apm bios to do its job at
suspending, I'd like something "similar" that would allow it to update
battery status in real time.

cheers
raph


Reply to: