polling (Announce)
Just for the record, in my applications I idle with the following sequence:
* issue 2F.1680, done if it zerod al
* if in DPMI protected mode, issue 2F.1680 via 31.0300 (ie from real/V86 mode), done if it zerod al
* otherwise insure interrupts are enabled (via sti) then execute a hlt instruction, assume this did it
The second way is necessary because at least some DPMI environments (including the NTVDM's) do not support 2F.1680 even though it's supported in their real/V86 mode.
The third way, executing hlt, is a default handler to idle directly. It doesn't work in some environments. I provide an option to change whether hlt will be used at all; if that option is set, my handler gives up instead of attempting to idle via hlt.
I additionally currently never issue hlt in DPMI protected mode because DPMI hosts seem to dislike that instruction (or possibly sti, not sure).
I'm not using Int28 primarily because there is no intrinsically supported way to determine whether it did something useful at all. (One could check for, say, whether the handler wasn't a single iret, but that wouldn't always indicate that the handler would do something useful if called right now.) If it did something, additionally attempting to idle by hlt or 2F.1680 afterwards would decrease performance and responsiveness. If it didn't, not additionally attempting to idle in other ways afterwards would mean not to idle at all. (I might add an option to my application to call Int28 instead or additionally though.)
I assume that Int2F can be called without crashing the machine. But then again, I make that assumption everywhere, so if I'd crash because Int2F is invalid, then I'd crash much earlier before ever reaching the idling code.
One could say I'm running the idling method detection every time I am idling. I recognize that this may not be the best way to do it. However, some of my applications stay resident in one or another way, so they want to catch changes in interrupt handlers and such - necessitating running the detection again. I might change that so I won't try detecting changes every time I idle though.
---
l
Complete thread:
- mTCP Open Source release - mbbrutman, 27.05.2011, 23:47 (Announce)
- mTCP GPL - ecm, 27.05.2011, 23:58
- GPLv3 - mbbrutman, 28.05.2011, 00:20
- GPL: either version 3 of the license, or any later version - ecm, 28.05.2011, 00:55
- GPL: either version 3 of the license, or any later version - mbbrutman, 28.05.2011, 01:09
- GPL: either version 3 of the license, or any later version - ecm, 28.05.2011, 01:18
- GPL: either version 3 of the license, or any later version - mbbrutman, 28.05.2011, 01:25
- download, compile, ... - ecm, 28.05.2011, 01:30
- GPL: either version 3 of the license, or any later version - mbbrutman, 28.05.2011, 01:25
- GPL: either version 3 of the license, or any later version - marcov, 30.05.2011, 09:37
- GPL: either version 3 of the license, or any later version - mbbrutman, 30.05.2011, 15:32
- What does the GPL allow? - ecm, 30.05.2011, 16:08
- What does the GPL allow? - mbbrutman, 30.05.2011, 16:30
- GPL something - ecm, 30.05.2011, 17:08
- GPL something - mbbrutman, 30.05.2011, 18:05
- theoretical licensing problems and such - ecm, 30.05.2011, 18:28
- licensing again... executables - ecm, 30.05.2011, 22:34
- licensing again... executables - mbbrutman, 31.05.2011, 03:33
- licensing again... executables - ecm, 31.05.2011, 13:59
- licensing again... executables - mbbrutman, 01.06.2011, 01:16
- licensing again... executables - ecm, 01.06.2011, 01:53
- licensing again... executables - mbbrutman, 01.06.2011, 02:17
- licensing again... executables - ecm, 01.06.2011, 15:49
- licensing again... executables - mbbrutman, 01.06.2011, 02:17
- licensing again... executables - ecm, 01.06.2011, 01:53
- licensing again... executables - mbbrutman, 01.06.2011, 01:16
- licensing again... executables - ecm, 31.05.2011, 13:59
- licensing again... executables - mbbrutman, 31.05.2011, 03:33
- GPL something - mbbrutman, 30.05.2011, 18:05
- What does the GPL allow? - Rugxulo, 30.05.2011, 18:14
- mTCP in DOSEMU; Linux kernel developers' GPLv2-only reasons - ecm, 30.05.2011, 22:38
- What does the GPL allow? - marcov, 30.05.2011, 22:49
- What does the GPL allow? - mbbrutman, 31.05.2011, 03:41
- What does the GPL allow? - mbbrutman, 31.05.2011, 04:18
- What does the GPL allow? - Japheth, 30.05.2011, 18:47
- Gift trolls and other curiosities - ecm, 30.05.2011, 19:20
- Gift trolls and other curiosities - mbbrutman, 30.05.2011, 19:54
- editing - ecm, 30.05.2011, 20:03
- Gift trolls and other curiosities - mbbrutman, 30.05.2011, 19:54
- Gift trolls and other curiosities - ecm, 30.05.2011, 19:20
- What does the GPL allow? - marcov, 30.05.2011, 22:38
- GPL something - ecm, 30.05.2011, 17:08
- What does the GPL allow? - marcov, 30.05.2011, 22:37
- What does the GPL allow? - mbbrutman, 30.05.2011, 16:30
- GPL: either version 3 of the license, or any later version - marcov, 30.05.2011, 22:35
- GPL: either version 3 of the license, or any later version - mbbrutman, 30.05.2011, 22:56
- GPL: either version 3 of the license, or any later version - marcov, 02.06.2011, 16:10
- GPL: either version 3 of the license, or any later version - mbbrutman, 03.06.2011, 04:12
- GPL: either version 3 of the license, or any later version - marcov, 03.06.2011, 13:36
- GPL: either version 3 of the license, or any later version - Rugxulo, 03.06.2011, 16:45
- GPL: either version 3 of the license, or any later version - marcov, 03.06.2011, 13:36
- GPL: either version 3 of the license, or any later version - mbbrutman, 03.06.2011, 04:12
- GPL: either version 3 of the license, or any later version - marcov, 02.06.2011, 16:10
- GPL: either version 3 of the license, or any later version - mbbrutman, 30.05.2011, 22:56
- What does the GPL allow? - ecm, 30.05.2011, 16:08
- GPL: either version 3 of the license, or any later version - mbbrutman, 30.05.2011, 15:32
- GPL: either version 3 of the license, or any later version - ecm, 28.05.2011, 01:18
- GPL: either version 3 of the license, or any later version - mbbrutman, 28.05.2011, 01:09
- GPL: either version 3 of the license, or any later version - ecm, 28.05.2011, 00:55
- GPLv3 - mbbrutman, 28.05.2011, 00:20
- mTCP and SwsVPkt - Japheth, 31.05.2011, 09:03
- mTCP and SwsVPkt - mbbrutman, 01.06.2011, 03:11
- mTCP and SwsVPkt - Japheth, 01.06.2011, 13:14
- mTCP and SwsVPkt - mbbrutman, 01.06.2011, 15:04
- polling - ecm, 01.06.2011, 16:07
- polling - Japheth, 01.06.2011, 17:12
- polling - ecm, 01.06.2011, 17:27
- polling - Japheth, 01.06.2011, 17:50
- polling - ecm, 01.06.2011, 17:55
- polling - Japheth, 01.06.2011, 18:39
- polling - ecm, 01.06.2011, 18:49
- polling - Japheth, 01.06.2011, 18:39
- polling - ecm, 01.06.2011, 17:55
- polling - Japheth, 01.06.2011, 17:50
- polling - ecm, 01.06.2011, 17:27
- polling - Japheth, 01.06.2011, 17:12
- mTCP and SwsVPkt - Japheth, 01.06.2011, 13:14
- mTCP and SwsVPkt - mbbrutman, 01.06.2011, 03:11
- mTCP GPL - ecm, 27.05.2011, 23:58