FDAPM on FreeDOS: Power Management, Safe Shutdown, and Cache Flushing
A hardware-aware guide to FDAPM information, idle modes, standby, suspend, poweroff, reboot, disk handling, and cache safety on FreeDOS.
FDAPM gives FreeDOS an interface to PC power-management firmware and several low-level shutdown operations. It can report APM battery information, install a resident idle handler, enter standby or suspend, request poweroff, change supported ACPI throttling states, spin disks down, flush caches, and reboot through different hardware paths.
Those operations reach below normal DOS applications. The correct command depends on firmware, memory managers, disk caches, and whether the machine is real hardware or an emulator. Test the information paths before treating FDAPM as a universal power button.
Inventory firmware support first
Begin with read-only output:
FDAPM INFO
FDAPM STATS
INFO queries APM BIOS data such as battery state when the firmware provides it. STATS reports idle statistics when resident FDAPM or a compatible POWER implementation exposes them. Running FDAPM without arguments normally displays both in an interactive shell.
Absence of useful battery data does not prove FDAPM is broken. Desktop firmware, virtual machines, and partially implemented APM BIOSes may return little or nothing. Record the BIOS version, emulator and version, FreeDOS memory-manager configuration, and exact FDAPM build before comparing results between machines.
Resident mode saves idle CPU cycles
FDAPM APMDOS installs the resident component and uses DOS idle hooks plus processor halt or APM idle calls. Compatibility aliases such as ADV:MAX exist for MS-DOS POWER syntax.
FDAPM APMDOS
FDAPM STATS
Load it after the memory-management environment is stable and measure both conventional-memory cost and application behavior. Some protected-mode memory managers or virtual machines do not allow the same halt behavior. Network clients and other programs may also appear continuously busy, preventing meaningful idle time.
Do not infer success from the command returning to the prompt. Compare STATS, power or temperature behavior, timer-sensitive software, network throughput, and audio playback. A retro game that depends on a busy loop may expose timing assumptions that an ordinary text application never reaches.
Standby, suspend, and poweroff are different requests
FDAPM exposes several firmware paths:
STANDBYrequests an APM energy-saving standby state.SUSPENDrequests APM suspend and explicitly spins disks down.PURESUSPskips the explicit disk spin-down for firmware that needs the disk during suspend-to-disk.POWEROFFtries APM poweroff and falls back to suspend if poweroff fails.ACPIOFFexplicitly uses ACPI to request the S5 soft-off state.PUREOFFavoids an explicit spin-down before power is cut.
Firmware bugs matter. Some BIOS implementations spin a disk back up while cutting power or fail to resume hardware correctly. Start on a test installation with no unwritten work, then verify the next boot, clock, disk state, network card, and keyboard behavior. A command that turns the display black is not proof of a clean suspend.
Flush caches before low-level transitions
FDAPM’s disk-related sleep, poweroff, and reboot operations tell caches to write dirty buffers before changing hardware state. FDAPM FLUSH performs the cache-flush step without shutting down.
FDAPM FLUSH
That request depends on resident software honoring the recognized flush protocols. A proprietary cache, storage controller, or virtual disk layer may sit outside FDAPM’s view. Close applications, finish file copies, return to a stable DOS prompt, and use each cache’s own synchronization command when it provides one.
Do not replace a normal shutdown procedure with an immediate hardware reset merely because FDAPM can flush common caches. FAT directory updates and application-level state still need to complete before the flush.
Reboot paths have different failure modes
HOTBOOT reloads the operating system without a full firmware bootstrap and often fails when drivers cannot unwind. WARMBOOT returns through BIOS bootstrap logic. COLDBOOT asks the keyboard controller to pulse the hardware reset circuit, approximating a physical reset on compatible systems.
Prefer the least surprising tested path for that machine. If a protected-mode application, network stack, or memory manager leaves hardware in an unusual state, a warm path may inherit it. If data is at risk, stop and power-cycle only after a deliberate cache flush rather than repeatedly trying progressively harsher resets.
ACPI throttling is experimental hardware control
The SPEEDn commands inspect ACPI tables and request duty-cycle levels in 12.5 percent steps. SPEED9 reports the current setting and is the recommended compatibility probe in FDAPM’s own documentation. Some HIMEM or EMM386 configurations block the BIOS memory-copy service used to read ACPI tables, and incompatible access can crash DOS.
Do not put SPEEDn, ACPIOFF, or automatic suspend in startup files until the exact configuration has survived repeated tests. Keep a boot-menu entry that omits FDAPM so a bad resident or firmware interaction cannot trap the system in a broken startup path.
Build a repeatable hardware acceptance test
Power management is one of the places where an emulator success can hide a real-machine failure. Create a small test matrix for each computer rather than copying one AUTOEXEC.BAT line everywhere. Record the BIOS revision, APM version reported by INFO, XMS and EMS managers, cache TSRs, storage controller, and whether the operating environment is bare metal or virtualized.
Run the least disruptive operations first. Install APMDOS, leave the machine idle, and confirm that timers, audio, networking, and keyboard input still behave normally. Next test STANDBY, then resume and checksum a set of files that was written and closed beforehand. Test SUSPEND only after standby is repeatable. Reserve POWEROFF, ACPIOFF, and reboot modes for the end, with no valuable writable media attached.
After every transition, inspect the next boot rather than stopping when the screen turns off. Run a filesystem check appropriate to the volume, verify the real-time clock, read files from every BIOS disk, and confirm that removable-media geometry did not change. A successful transition must preserve data and restore devices, not merely reduce power.
Keep the tested command in a named boot-menu profile and leave the default recovery profile free of resident FDAPM and experimental ACPI speed control. That gives a future memory-manager or firmware change a safe comparison point and keeps a marginal power feature from becoming an unbootable configuration.
FDAPM is valuable because it exposes several generations of PC power management in one small FreeDOS tool. Its safest use is empirical: query first, change one mode at a time, synchronize storage, and maintain a no-FDAPM recovery configuration.
Related:
- LBACACHE on FreeDOS: Sector Caching Without Gambling with Writes
- The FreeDOS Boot Process: CONFIG.SYS and AUTOEXEC.BAT
Sources: