Welcome to the home of APM/2, a utility that allows you to:
Does it work? Theoretically yes, but YMMV (your mileage will vary)! Unfortunately if it works for your PC depends on your PC's APM BIOS, the OS/2 APM subsystem and your PC's hardware - in about that sequence. What the problems are is mentioned in the Known Problems section, what the solutions are, well that may depend on your experiments and luck ;-). By the way, you may also take a look onto the hints and tips page.
I'm very interested for any feedback, so I would be pleased if you can stop by at the online APM/2 survey and send me your comments. Of course e-mail is welcome too.
The OS/2 APM.SYS device driver has been update to APM Specification 1.2, you can download it from the OS/2 Device Driver Pak online in the OS/2 Components, Base Device Driver update section. Alternatively the APM support introduced with Warp 4 FixPack 6 gets you to APM.SYS level 1.2 too. I didn't test in detail, but I haven't found one of my problems was fixed.
APM/2 is provided in 2 NLS versions:
You can easily create your own (SBCS single byte character set) national language
version, just use APMUs.txt as a template, translate the messages there without
altering the row and column layout, indentions, characters per line, ... and
compile it with the MKMSGF compiler from the Toolkit (or send me the file and
I'll try to compile it).
If someone volunteers to create a national language version, I'm prepared to
add it to my site and the package (surely you will be credited too ;-).
When invoking APM.EXE without commandline arguments, the help is displayed (if possible in your national language, otherwise defaults to English):
OS/2's APM.SYS currently only supports APM BIOS specification 1.2 (and APM/2 therefore also supports 1.2), but you need to upgrade to level 1.2 (Warp 4 was shipped with level 1.1, Fixpack 6+ will upgrade to level 1.2). Usually PCs implement specification 1.1 in APM BIOS, most recent PCs already support specifications 1.2 or even 2.1 too.
A prerequisite for APM.SYS to function is that APM BIOS is enabled in your BIOS. APM/2 will then allow you to query APM configuration or to put your PC into APM standby, suspend or power off.
Under OS/2 versions prior to Warp 4, for APM power off requests the filesystem will not be closed correctly, causing a CHKDSK during the next reboot. And to cite a tip from Frank Schroeder (OS/2 I/O Subsystem/Device Driver Development): "Do not try to run the Version 4.0 APM device driver on OS/2 Warp Version 3.0 as there are dependencies upon other system files including the os2krnl".
APM/2 has the commandline option /Force that allows you to force APM requests under Warp 3 and before. This option may be useful when a fixpack or computer vendor improves APM support, but most likely it will not work or cause a CHKDSK during next boot.
I've also heard that Warp 4 fixpacks 2 and above have broken APM support. I haven't verified if restoring the Warp 4 GA APM.SYS driver restores working APM support but it's sure worth a try. Just to remember, the rule of thumb "Never fix a running system" still applies.
/Verbose | This option displays the APM support available from APM.SYS |
/Ready | This option restores APM support to the state before an APM standby, suspend or power off request was submitted. For example, if you have put your PC into APM standby using the /Standby option, then you may restore from that state by activities defined in BIOS (usually keyboard and mouse events) or by running APM/2 with the /Ready option. This option may be useful when scheduled or invoked by e.g. a remote telnet session. However, I think it may be very APM BIOS and hardware dependent for which APM requests this option restores the previous state (e.g. if BIOS slows down the CPU it likely will work, if BIOS stops CPU I'm afraid you can't execute any program). | .
/Standby | This option requests APM support to put your PC into APM standby. Most likely this will cause your display to be switched into standby mode, your disk may be spinned down and/or the clock speed of your CPU to be reduced |
/Suspend | This option requests APM support to put your PC into APM suspend under Warp 4.
Most likely this will cause your display to be switched off and your PC to
go into sleep mode (for ThinkPads this request likely causes
a hibernation to disk). No Shutdown of the file system will be performed, you PC will be able to continue when awakened. |
/Poweroff | This option requests APM support to shut down the filesystem (and thus no CHKDSK
during next boot) and to power off your PC. As only Warp 4 has the required changes to shut down the filesystem, APM/2 by default refuses to run on Warp 3 and before. This option is hardware and BIOS dependent and may not work for your PC. |
/Poweroff- | This option is the same as option /Poweroff except that thread execution will
be quiescent by calling DosShutdown(1) before the APM request, the file system
is still not locked. As Warp 4 is supposed to shut down the file system this option should not be required, however a user has surprisingly found out that this made power off requests more stable (no more CHKDSKs during next boot). |
/Poweroff+ | This option is the same as option /Poweroff except that the file system is shut down
by calling DosShutdown(0) before the APM request, which causes subsequent file
I/O to fail or block. As Warp 4 is supposed to shut down the file system this option should not be required too, however one never knows (so you may try if /Shutdown fails). |
/Poweron | This option allows you to schedule the date and time when your PC automatically
powers on by using the automatic APM power on timer. However, this requires
APM support at level 1.2+ and possibly also activation of some BIOS settings.
This option is only valid in addition to the /Schedule [yyyy:mm:dd:]hh:mm
option). This option is hardware and BIOS dependent and may not work for your PC. |
/Device BIOS|All|Display| Disk|Parallel|Serial| | This option allows you to specify the device the APM request is performed on.
If this option is not specified All is the default, causing the APM
request to target all APM devices in your PC. Of course, only the /Ready, /Standby, /Suspend and the /Poweroff options make sense, so be cautious. This options are hardware and BIOS dependent and may not work for your PC. |
/Schedule [yyyy:mm:dd:]hh:mm | This option allows you to schedule APM requests, except the /Verbose option, which can't be scheduled. This option must be used when you want to use the /Poweron option to schedule the automatic APM power on timer. |
/Language xx | This option allows you to force using the national language version of APM/2 where
APMxx.msg exists. APM/2 ships with APMUs.msg and APMGr.msg, being the
English and German NLS versions. APM/2 tries to load messages in the language of the system where it is running on, e.g. on a German setup (049 at the COUNTRY statement in CONFIG.SYS) the German message file is used, though those automatic support is limited to only major languages. You can easily use APMUs.txt as a template, translate the messages while preserving the row and column layout, and then compile them into your national language APMxx.msg messagefile. As said, if you're running a major language as e.g. French or Spanish, NLS support will be used automatically then, otherwise just supply the /Language xx option. |
/Force | This option allows you to force APM/2 accepting the /Poweroff options under Warp 3 and before. Most likely the APM requests will fail or may cause a CHKDSK during next boot. |
I know there are many problems with APM, I would almost say APM is broken by design or the lack of, so I welcome any feedback. If I get reasonable response I plan to collect and document the feedback into a pro and cons list for OS/2's APM support.
Per design, the option /Poweroff should work without additional parameters, but if you experience one of the problems mentioned above, you may experiment with adding - or + to those options.
If APM requests fail, most likely a CHKDSK will be run during next boot, but it's a good idea for sure to have a backup!
Now what can you try to improve the situation?
APM/2 is Freeware, but I welcome you to credit me if you're going to reuse some code and I'm also very interested to hear about your product where you are using the code, likely I will also add a link to it from my pages!
You are also welcome to upload this program to any distribution (like e.g. Hobbes, Leo, ...) or to mention it in foras or E-Zines (like e.g. Warpcast) as I might not have the time to it myself.
Thanks to Cornelis Bockemuehl, there also exists a PM-Frontend to APM/2 providing a much more user-friendly interface than the commandline utility APM/2. It should be available as PMAPM V0.10 on all major anonymous-ftp OS/2 file servers.
APM/2 includes a C/C++ Toolkit header, which includes the most comprehensive information about OS/2 and APM available. You may want to use this toolkit to do your own APM OS/2 programming.