apm with linux 2.4.0; Suspends with switch, not with timer

apm with linux 2.4.0; Suspends with switch, not with timer

Post by Richard M. Denne » Thu, 22 Feb 2001 17:38:01

I am running a RH 7 system with updated kernel.org 2.4.0 kernel and apmd
version -3Ob2-2 (from RedHat). The BIOS is APM compliant and with APM
configured in the kernel, my system suspends with the CPU power key
(touch it, it suspends or awakens; hold down 4 seconds and it powers on
or off). So far, so good. The problem is, even though the BIOS (in Setup
during boottime) is set to power down after 30 minutes, the computer
under linux doesn't do this. A ps ax | grep apm shows:

442 ?        S      0:00 /usr/sbin/apmd -p 10 -w 5 -W -P

I have looked through the apmd manual, but find it hard to understand.
Some things definitely do not seem to work on my system. For example,
the manual says that "apm -n" or "apm --noignore" should tell the system
to carry out apm tasks when signaled by the system even when the system
is AC power. When I give this command, I get:

usage: apm [-vmsSin] [--verbose] [--minutes] [--suspend] [--standby] --

suggesting that "apm -n" is not a valid command, despite the message.
(In fact, the apmd manual says this is the default mode.)

I get the same usage: apm message when I give the command:

apm -i.

On the other hand, "apm -s" suspends the system (just like touching the
power button on the cpu), as it should.

The command "apm" gives the message:

AC on-line, no battery


Obviously I am missing something. Can anyone point me in the right


1. reset the irq 0 timer after APM suspend


On my AST J50 (P133) notebook, the timer on irq 0 resets itself from
interrupting at 100 Hz to 18.3 Hz (DOS default) after a suspend/resume.

What is the right way to re-initialize it back to 100 Hz without a reboot?

Dong Chen

BTW, I tried to modify


in function suspend() at line 639 (kernel 2.0.30) from

        err = apm_set_power_state(APM_STATE_SUSPEND);
        if (err)
                apm_error("suspend", err);


        err = apm_set_power_state(APM_STATE_SUSPEND);
        if (err)
                apm_error("suspend", err);

        /* set the clock to 100 Hz */
        outb_p(0x34,0x43);              /* binary, mode 2, LSB/MSB, ch 0 */
        outb_p(LATCH & 0xff , 0x40);    /* LSB */
        outb(LATCH >> 8 , 0x40);        /* MSB */


But this does not work.  All programs crash after suspend() is called.


2. tools to snoop packet between os and driver interface.

3. fix oops on resume from apm bios initiated suspend

4. yp_match() does not work in libc.so.5.2.18??

5. apm suspend broken ?

6. Limit memory to low 16MB

7. Problems with APM suspend and ext3

8. compile erro 2.5.6pre2

9. 2.5.41: apm hangs instead of suspending

10. APM suspend/resume doesn't work properly

11. 4 beeps on apm --suspend, how to debug this?

12. SOLVED: Thinkpad A30 Suspend Hibernate dual-boot APM Problems

13. APM Suspend/Resume messes up PCMCIA and Video