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 ecm Homepage E-mail, Düsseldorf, Germany, 04.06.2011, 06:50

> I am thinking of doing a check for the DOS version, and then if it is one
> of the versions that supports int 2f.1680 using it each time I check for a
> new packet and one is not there.

Just check for 2F.1680 support directly: If the call sets AL to zero, it is supported. Otherwise it isn't supported.

You can do that check before your application actually starts its operation; or you could do it the first time you're waiting for a packet; or each time. I usually do it each time since then (in TSRs) I won't have to keep track of whether 2F.1680 becomes supported (or goes away) while my program is running. With non-TSR programs, that's obviously not that useful.

> I'm using int 2f.1680 now in an XP DOS Box with SWSVPKT and the busy
> polling behavior that consumed a core is gone,

Good.

> but the application is more than usable.

What do you mean with this?

> I understand that the call yields the processor for a time slice, where the
> OS supports that. But what is the definition of a time slice? I imagine
> it varies from environment to environment.

Yes. However, if it's supported in a single-tasking DOS environment (FDAPM or MS-DOS POWER possibly provide it, I'm not sure) then I'd assume its operation is similar to that of executing HLT (with interrupts enabled): wait until the next external interrupt reaches the CPU. That can for example be caused by a keystroke, a packet from the network, or the timer.

> The interrupt list says that it was supported in DOS 5. What does DOS 5 do
> with it?

I don't think any kernel provides this interface directly. That entry probably just means that interface became popular with MS-DOS 5, or that MS-DOS 5+ programs use it or something.

---
l

 

Complete thread:

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