211 points · by ingve · 3y ago · 29 comments
Power management under DOS on early x86 laptops was downright primitive. There were no standards of any kind (I'd never even heard of the DR-DOS $IDLE$ device until now, but it doesn't seem like that gained any kind of traction at the time), not even BIOS-based abstractions. Just vendor-provided 'drivers' (in name only: it's not like DOS made any distinction between system and user code) that directly communicated with the hardware.
Unsurprisingly, that all broke down as soon as you did anything even remotely interesting. Run QEMM386? No power management for you! Have a certain PCMCIA card inserted? Ditto! And shipping any kind of updates took forever at that time (literally FedExing floppies...), so getting a working system was pretty much impossible.
Kudos, indeed!
An examination of the source code for the PC/AT BIOS reveals what it actually does when waiting for input on INT 16/AH=0 --- it polls the keyboard buffer in a loop that also appears to repeatedly update the keyboard LED indicator status, and one of the instructions that it executes (with interrupts enabled) is a NOP. Naturally, that makes one wonder whether simply replacing that NOP with a HLT would be sufficient to idle the CPU, and if so, why didn't IBM do that originally; and what newer BIOSes do.
The 6A69MV39 AWARD BIOS I inspected (from 1999) looks similar, but loops with a "delay" created by reading from I/O port 0EBh.