> On May 14, 2025, at 8:29 AM, Bernd Böckmann via Freedos-devel > <freedos-devel@lists.sourceforge.net> wrote: > > Hi! > > Is anyone into power management, specifically how to properly idle DOS > applications NOT using any of the DOS calls typically triggering DOS idle > handling? > > FreeDOS EDIT does not use any DOS functions in its event handling loop, but > instead does its input polling through INT16 (keyboard) and INT33 (mouse). > > First guess on saving some energy would be to issue HLT instructions as part > of the event loop, but I am not sure about the side effects on doing so from > within an application. May it safely be used? > > Further, there seem to be some idle related interrupts, like INT28 [1]. But > the FDAPM documentation mentions that this interrupt is not hooked, unless > its ADV:MAX mode is used [2]. As this is not the default, relying on INT28 > seems neither to be a good idea. > > > Bernd
Usually, I just use this or a similar routine. https://github.com/LoopZ/V8Power/blob/9475786721532b4a2a2d2a72dcb13c5c020a9fa3/SOURCE/COMMON.INC#L56 <https://github.com/LoopZ/V8Power/blob/9475786721532b4a2a2d2a72dcb13c5c020a9fa3/SOURCE/COMMON.INC#L56> Requires DOS 5+. Not an issue for FreeDOS Edit. Basically, tries to release the timeslice. If not successful, it doesn’t bother trying again and falls back on HLT. :-) > > > [1]: https://fd.lod.bz/rbil/interrup/dos_kernel/28.html#4166 > [2]: > https://gitlab.com/FreeDOS/base/fdapm/-/blob/8438642453457b25b13db4d589958fec400bb9bc/DOC/FDAPM/FDAPM.TXT#L44 > > > > _______________________________________________ > Freedos-devel mailing list > Freedos-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/freedos-devel
_______________________________________________ Freedos-devel mailing list Freedos-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/freedos-devel