Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

polling (Announce)

posted by Ninho E-mail, 17.07.2011, 12:59

Hello Mike
> DOS 2 and higher have INT 0x28 known as the idle handler. According to
> what I have read DOS may not have a idle handler installed. If it does
> not, then making INT 0x28 calls is harmless, but burns a few cycles. If
> there is an idle handler installed then it can make use of the fact that
> the foreground application has basically said 'I'm idle'. This function
> should always be safe to use.

I don't think you got it right. Int 28 isn't something you CALL, (the handler is just an IRET anyway), it's something your TSR may HOOK and DOS itself calls it to signal it is basically idle - as in waiting for keyboard entry, and the like. It doesn't look like what your polling app wants to do.


> Then there is INT 0x2F,1680 (the idle call). This is supported in DOS 5
> and later versions of Windows,

The bit about "DOS 5" is a misunderstanding of R. Brown's list, forget it. What int 2F/1680 is, is a DPMI/Windows/Task Switcher thing (hence supported by DOS 5's "DOSSHELL", NOT supported by DOS 5 or any DOS's kernel).

How it works is your app calls int 2F/1680 in order to tell the multitasker "I think I have nothing useful to do for a while", thus allowing the multitasker to pass control to other tasks; In other words yielding.



> I'd like one version of my executables to work in all of the environments.
> The simplistic way to do this is to get the DOS version and if DOS 5 or
> better is reported to verify INT 0x2F,1680 is installed and use it. (And
> if it returns 0, then continue using it.) If 0x2F,1680 does not work then
> fall back to using INT 0x28.
>
> Does this seem reasonable?

Pretty much, except the bit about int 28 ;=) You may call 2F/80 in all DOS versions, too, not just 5+.

---
Ninho

 

Complete thread:

Back to the forum
Board view  Mix view
22778 Postings in 2122 Threads, 402 registered users (0 online)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum