beautypg.com

Juniper Systems Allegro DOS Manual User Manual

Page 239

background image

Software Developer's Guide for DOS Page 8-5

For applications that do not take advantage of the Allegro power API,
the BIOS Automatic Power Manager can greatly extend operating time
and should be used when possible. In our experience, it works quite
well with most applications. However, because the BIOS can only guess
what the processor is doing, in some cases it may shut activities down
when it should not and vice versa. If the program is misbehaving with
Power Manager enabled, try disabling it. If the problem disappears,
then there may be a conflict with your program and the Power Manager.
If you encounter a situation where you cannot use the Power Manager,
the next best thing for power savings is to set the performance level to
the lowest possible setting in which the program still functions properly.

If you are writing an application for Allegro, we strongly encourage
designing power management into your program. Any time the
processor is waiting for input, you may want to put it to sleep. The most
common case where this technique is used is while waiting for a
keystroke. See the Allegro Getch() example for a means to shut the
processor down while waiting for a keystroke. A rule of thumb is
whenever the processor may be waiting for 50 milliseconds or more for
input it should be put to sleep.

Another case where power management can be used is when an
application temporarily needs to perform some high speed processing of
data. The Allegro_CpuBusy() function can be used to override the
Power Manager and put the processor into high speed mode while the
processing is taking place. The Allegro_CpuDone() function is used to
restore settings when processing is completed.

The user from the System Setup program can control the power
management for DOS operation (refer to Section 5, DOS Operating
System, System Setup Program for more details). It can be controlled
programmatically through the Extended BIOS Functions (later in this
section) as illustrated by the examples on the following pages written in
C and Assembly language. Note that these examples are for DOS
operation only.