Skip to content
FreeDOSDeep Dive Published Updated 5 min readViews unavailable

FreeDOS IDLEHALT: Configure Kernel HLT and Windows Idle Hooks

Tune FreeDOS IDLEHALT levels by separating kernel HLT sites from INT 2Fh AX=1680h handling, then test the selected kernel safely on target hardware.

FreeDOS IDLEHALT is a kernel configuration level, not a general power-management utility. It controls whether selected idle paths may execute the x86 HLT instruction and whether the kernel handles the Windows idle multiplex call INT 2Fh, AX=1680h. The details matter because that call is separate from DOS’s INT 28h idle hook and from a resident power-management program such as FDAPM.

The current FreeDOS kernel configuration documentation accepts IDLEHALT=n, with n equal to -1, 0, 1, or a higher value; its documented default is 0. It cautions that the additional hooks activated by -1 or positive levels can depend on the kernel version. The pinned source for this article provides a concrete level map for the reviewed revision, not a guarantee that every historical FreeDOS kernel has identical behavior.

What each level means in the reviewed kernel

The kernel’s SetIdleHalt configuration handler stores the numeric setting. Its comments describe level 0 as never executing HLT, level 1 as allowing the safe kernel-only idle path, and levels 2 or 3 as additionally enabling the INT 2Fh/1680h path. dosidle.asm checks for at least level 1 before its built-in HLT. The INT 2Fh handler checks for level 2 before executing HLT and, at level 3 or higher, sets AL to zero after the instruction.

Setting Behavior documented or visible in the reviewed source What it does not prove
IDLEHALT=0 Default; the kernel idle path does not execute HLT It does not disable other resident software’s power controls
IDLEHALT=1 The config guide says HLT is used only while the kernel waits for CON character input; the source labels this the safe kernel path It does not mean every wait in every program uses HLT
IDLEHALT=2 Also permits the reviewed INT 2Fh/AX=1680h path to execute HLT It does not show that a calling program can measure power savings
IDLEHALT=3 Same source path, then returns AL=0 AL=0 is not an electrical measurement of energy use
IDLEHALT=-1 Documentation labels this maximum savings The exact extra hooks are kernel-version-dependent

This table is intentionally scoped to the checked-in source revision. The configuration guide itself warns that higher-level hooks can vary. Do not infer behavior for an older kernel from a current comment, or copy a high level into a vintage machine without testing its BIOS, chipset, power supply, and resident drivers.

Change the boot configuration in a disposable system

For a controlled experiment, copy the bootable disk image or use a separate VM snapshot, then add one level to the active CONFIG.SYS:

REM Test only in a separate boot profile or disposable image.
IDLEHALT=1

Begin with level 1. Reboot into the test profile, record the exact kernel version displayed during startup, and confirm the selected CONFIG.SYS was actually read. DOS systems commonly have multiple boot configurations, so editing an unused file is not a valid test. Change one value at a time and retain a recovery boot menu entry with the previous setting.

Only after the conservative path is stable should a test program that intentionally issues the Windows idle call be evaluated with level 2 or 3. The kernel source identifies AX=1680h as the “release time slice” multiplex call. It does not turn every INT 2Fh call into an idle hint, and an emulator or virtual CPU may implement HLT behavior differently from a physical processor. A host CPU percentage that falls is useful evidence, but it is not a portable watts measurement.

Keep INT 28h and FDAPM in their own layers

The FreeDOS idle assembly contains both an HLT helper and an INT 28h path. They are related to idle execution but are not the same interface: INT 28h is the DOS idle callback used by programs that need a safe opportunity to perform limited work while DOS is otherwise waiting, whereas INT 2Fh/AX=1680h is the Windows multiplex hint handled in the kernel’s INT 2Fh table. Do not treat a program’s use of one as evidence that it uses the other.

FDAPM is another separate layer. Its resident driver and APM commands can manage platform power behavior and safe shutdown operations; IDLEHALT is a boot-time kernel option controlling specific CPU-idle paths. Combining several mechanisms at once makes attribution difficult. For diagnosis, first test the kernel setting alone, then add resident utilities one at a time and record the exact command, driver version, and resulting behavior.

Build a test matrix, not a broad compatibility claim

Use the same disk image and workload for each setting. A useful matrix includes idle at the DOS prompt, repeated keyboard input, a program that calls INT 2Fh/AX=1680h, a workload that uses INT 28h, and the same tests with any resident power utility disabled. Record boot messages, CPU utilization, timer behavior, serial/network responsiveness if applicable, and unexpected lockups. Repeat in the intended emulator and on the intended physical machine; success in one environment is not proof for another.

The FreeDOS configuration notes warn that entering or leaving HLT can produce large power-consumption changes and that some inexpensive power supplies or mainboards may not filter those transients well. That warning makes this more than a cosmetic compatibility flag. Keep a known-good boot entry, avoid changing the only installation used for recovery, and stop testing if the machine shows instability. Where the behavior cannot be isolated from other drivers or firmware, retain the conservative setting instead of claiming a power saving that has not been measured.

There is no native FreeDOS runtime validation in this draft environment. The article is based on the pinned kernel documentation and assembly; its boot and hardware matrix remains a test plan for a DOS VM or physical machine, not a claim that the experiments were run here.

Related:

Sources:

Comments