APM Driver Alpha3


OVERVIEW

This driver enables APM in BeOS R4.x for Intel. You can use power management functions (power off, suspend, standby, hibernation, power status acquisition etc.) in a notebook PC or an ATX PC. However, there are currently some problems upon resume, especially on notebooks.

The status of each function is roughly as follows: (depending on your model, motherboard or display driver).

PM functions NotebooksATX PCs
Power off OKOK
Standby -> resume OKOK
Suspend -> resume NGOK
Hibernation -> resumeNG???
Power status acquisitionOKOK

REQUIREMENTS

Use the latest BIOS whenever possible.

The author has tested under following environment:


INSTALLATION

$ make install

will copy apm, apmd and apmctl to appropriate directories.

Under R4.5, add the following lines to ~/config/settings/kernel/drivers/kernel. You can copy ~/config/settings/kernel/drivers/sample/kernel.sample and edit it. Do not activate apm true and bios_calls disabled.

# bios_calls disabled
# apm true
_apm true
enable_shutdown true

To uninstall:

$ make uninstall

USAGE

Run apmd in the background.

$ apmd &

It is recommended to add this in UserBootscript. Now APM is enabled and the following functions are available:

To stop apmd, send SIGTERM or SIGKILL by specifying its thread ID.

$ ps | grep apmd
/boot/home/config/bin/apmd (team 246)
   1234                 apmd  zzz  10        0       28
/bin/grep apmd (team 256)
$ kill -TERM 1234

You may use KillTeam or TManager. Power saving functions by external factors are disabled when apmd is not running.


UTILITY PROGRAM

The utility apmctl controls APM directly.

apmctl standby
Enters the standby state.
apmctl suspend
Enters the suspend or hibernation state in a few seconds.
apmctl suspend on
Enable suspend/hibernation by external factors.
apmctl suspend off
Disable suspend/hibernation by external factors and forces to enter the standby state instead. This is the default setting.
apmctl poweroff
Turns off the power in a few seconds. Confirmation required. Normal shutdown process does not take place. Do not use in usual situations.
apmctl status
Prints current power status.
apmctl bios AX BX CX DX SI DI
Calls APM BIOS. Takes up to 6 parameters in hexadecimal and stores them in AX, BX, CX, DX, SI and DI registers respectively and calls APM BIOS (AH is set to 53H). Upon return, prints error code and each register's value in hexadecimal. However, AX value is not printed because it is junk. For example, to enter suspend state:
$ apmctl 7 1 2

SUSPEND/HIBERNATION

Upon resume from suspend or hibernation, you will face the following problems:

Therefore suspend/hibernation by external factors are disabled by default; instead the system enters the standby state (apmctl suspend off). This prevents the system from entering the suspend or hibernation state against your will. (Note that "Suspend" in the Be menu and apmctl suspend always cause suspend or hibernation.) To enable suspend/hibernation by external factors, use apmctl suspend on.


CAUTION

If your system has Resume-On-Ring or Resume-On-LAN function, it may malfunction and cause immediate resume after suspend. In such a case, disable Resume-On-Foobar function.

Some systems do not suspend when the serial port or LAN is in use or PC Cards are attached.

If you are using my PC Card enabler package, configure your cards again after resume from suspend or hibernation.

Not all power management functions provided in your system are enabled. In particular, it is not supported to stop or slow down the CPU when idle.

It seems that many APM BIOS implementations have problems or do not conform to the specification. The author provides some workarounds for the problems encountered, but it may still malfunction on some systems.


TESTING REPORT

Please send your testing report to the author, including the following information:

In testing suspend and hibernation, run apmctl suspend on and enable suspend/hibernation by external factors.

An example for notebooks:

An example for ATX PCs:

If anything goes wrong except known problems mentioned above, follow these instructions:

  1. Run touch /var/log/apm.log in the command line.
  2. Reboot and run apmd.
  3. Perform the operation in question.
  4. See if debug output is logged in /var/log/apm.log. It's OK if you can see any contents by less /var/log/apm.log. Note that you can't see anything under /var within Tracker.
  5. Email to the author your testing report and /var/log/apm.log.

You may delete /var/log/apm.log when your problem is solved.


LICENSING INFORMATION

The author does not claim any rights on this software. The author does not place any restrictions on use and distribution of this software. The author is not liable for the result of operating this software. The author is under no obligation to fix bugs.

The latest version is available in the author's web page.


HISTORY

Alpha1 (1999.3.10)
Alpha2 (1999.3.14)
Alpha3 (1999.8.3)
ToDo

REFERENCES