The APM/2 tips and tricks page

The APM/2 tips and tricks page

APM/2 in its functioning, unfortunately, strongly depends on the hardware and software it is running on. Though it uses the same interfaces (provided by OS/2's APM.SYS driver which in turn interfaces with the APM BIOS) the requests sent by APM/2 may work on one PC but not on another, even from the same manufacturer.

The following is a collection from the feedback I got for APM/2 and the survey I'm running from my side (thanks to all who contributed!).

Can APM/2 code be (re)used in other applications?

If the target system is a non-Windows platform, certainly. Just add some credits for the parts you are reusing, I also welcome you to drop me a note so I might include a reference to your application on my site.

Will the Desktop be closed correctly?

The options /Standby and Suspend should only suspend the execution of the CPU, and the execution can be resumed at any time (by pressing a (sometimes special) key or moving the mouse.

The option /Poweroff on the other hand, will as its name implies, power off your PC, similar to pressing the power switch. By design, it will also shut down the OS/2 filesystems before requesting the APM BIOS to inform the power supply to cut power. The main problem is, that sometimes the shut down of the filesystems is not done correctly or completely, on HPFS drives you will know this when CHKDSK runs during the next reboot. As said in the APM/2 documentation, Warp 4 is at least required that the shut down will theoretically work, practically YMMV.

I said shut down of the filesystems and not shut down of the applications, because that's what happens. Expressed more clearly, applications will not be notified that a shut down is performed and are therefore not able to terminate or save their data, is just the same what is done when you press CTRL+ALT+DEL (with the difference the later almost everytime closes the filesystems correctly).

What can you do if /Poweroff causes CHKDSKs?

Again, this depends on the hard and software you are using. It should not cause damage at least, if you upgrade your BIOS and the OS/2 APM.SYS driver to the latest release (for APM.SYS you might want to apply the latest OS/2 service packs).

Tuning the APM BIOS configuration options may sometimes help too. Especially the Wakeup functions have been reported to make a difference. Just try to toggle the Wakeup on Timer (reportedly the one most likely to help), Wakeup on LAN, Wakeup on Modem and/or Wakeup on Serial options (the terms used will likely be different).

/Poweroff causes a power off followed by a immediate power on

Again, try to toggle the Wakeup on Timer options (reportedly the one most likely to help). It may be called differently, like e.g. Power-on Timer or APM Automatic Power Up.

Can the /Ready option help?

Well, not likely. To run /Ready you must have access to a command window, on a suspended PC not really likely. I can only thing of one point (besides experimenting with turning off individual devices like e.g. display or serial port) it may be helpful, that is a device does not work again after a /Standby or /Suspend request, e.g. the serial port.

For other devices, e.g. soundcard, a not working device after an APM request is a hint that its device driver is not APM aware, you might try to contact the manufacturer or apply a later driver then. I have not details which device drivers are APM aware (Crystal drivers likely, as the driver expert Timur Tabi is working for them) and which not.

/Suspend does not work

If /Suspend does not work, or only works for a moment and the PC restores immediately this is a hint that you have configured a hardware interrupt to return your PC from suspend. You might apply the latest BIOS flash and/or check the APM settings that some hardware interrupts should not cause a return from suspend (e.g. a network, sound, graphics or disk adapter card may cause such interrupts), that is that the activity detection is set to off.

I admit that you have to have some ideas what hardware interrupts are connected to which devices, the Netfinity System Information tool may be helpful here.

Kernel trap during /Poweroff

Some older non APM-aware drivers may cause a kernel trap during /Poweroff (e.g. the Crystal 1.71 driver has been reported here), you might try to upgrade to a more recent release (e.g. Crystal 2.02 has been reported to work on the same PC then).


(C) Roman Stangl (Roman_Stangl@at.ibm.com), 17.08.1997
Last update: 01.12.2000