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 | Notebooks | ATX PCs
|
---|
Power off | OK | OK
|
Standby -> resume | OK | OK
|
Suspend -> resume | NG | OK
|
Hibernation -> resume | NG | ???
|
Power status acquisition | OK | OK
|
REQUIREMENTS
- PC/AT compatibles with APM BIOS conforming to APM Specification 1.1/1.2
- BeOS R4/4.5 for Intel
Use the latest BIOS whenever possible.
The author has tested under following environment:
- GIGABYTE GA-686BX (APM 1.2)
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:
- Automatic power off when shut down.
- "Suspend" option appears in the "Be" menu, by which the system enters the suspend state (see below).
- Power saving functions (suspend, standby and hibernation) by external factors
(key operation, lid closure, no operation during specific time, etc.) are enabled.
- Programs that call APM BIOS, like apmctl mentioned below, can operate.
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:
- Further operation may be difficult because some display drivers do not
resume screen display or do not perform screen drawing normally after resume.
In particular, this applies to display drivers for most notebooks (NeoMagic driver etc.)
- The system clock may lose as it is not updated upon resume.
- PCI IDE's DMA transfer mode may be cancelled;
upon first access to the hard drive after resume,
DMA transfer will fail and switch into PIO transfer, which takes some time.
This also occurs upon resume from standby.
- There may be other inconvenience for non-resume-aware devices and drivers.
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:
- Model specific information
- Manufacturer and model of your system (APM BIOS version (1.0/1.1/1.2) if possible)
- Name of your graphic card or chip (display driver name if using a non-standard driver)
- Standby operations, resume operations from standby
- Suspend operations, resume operations from suspend
- Hibernation operations, resume operations from hibernation
- Status of the APM driver
- Power off OK/NG ("Shut Down" in Be Menu, apmctl poweroff)
- Standby OK/NG (standby operations, apmctl standby)
- Suspend OK/NG (suspend operations, "Suspend" in Be Menu, apmctl suspend)
- Hibernation OK/NG (ditto)
- Resume from standby/suspend/hibernation OK/NG
- Whether or not apmctl status output is proper
- Others
In testing suspend and hibernation, run apmctl suspend on and
enable suspend/hibernation by external factors.
An example for notebooks:
- Model specific information
- IBM ThinkPad 535, APM BIOS 1.2
- Built-in Trident Cyber 9320, Trident Cyber driver
- Standby: Fn+F3 key, short inactivity;
resume: any key, TrackPoint
- Suspend: Fn+F4 key, lid closure, long inactivity, battery low;
resume: Fn key, lid open
- Hibernation: Fn+F12 key, long inactivity, battery low, power switch;
resume: power switch
- Status of the APM driver
- Power off: all OK
- Standby: all OK
- Suspend: all OK
- Hibernation: all OK
- Resume from standby: OK, resume from suspend/hibernation: screen remains black
- apmctl status: OK
- Resumes immediately after suspend when Resume-On-Ring is enabled.
Enters standby instead of suspend when certain PC Cards are inserted.
An example for ATX PCs:
- Model specific information
- GIGABYTE GA-6BXS, APM BIOS 1.2
- ATI 3D Rage Pro Turbo AGP
- Standby: none;
resume: any key, mouse, sleep switch, power switch, LAN
- Suspend: sleep switch;
resume: any key, mouse, sleep switch, power switch, LAN
- Hibernation: unknown;
resume: unknown
- Status of the APM driver
- Power off: all OK
- Standby: all OK
- Suspend: all OK
- Hibernation: unknown
- Resume: all OK
- apmctl status: OK
- Standby and suspend seem to be same.
Connected to the LAN, resumes by oneself after suspend.
If anything goes wrong except known problems mentioned above,
follow these instructions:
- Run touch /var/log/apm.log in the command line.
- Reboot and run apmd.
- Perform the operation in question.
- 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.
- 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)
-
- Fixed a problem that APM is not enabled on some models.
- Added apmctl suspend on|off.
- Changed parameters into hexadecimal in apmctl bios.
- Debug output to the log file.
- Alpha3 (1999.8.3)
-
- ToDo
-
- Clock update on resume.
- Recovery of PCI IDE's DMA mode.
REFERENCES