Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

DJGPP - how to make timeout in loop when interrupt disabled? (Developers)

posted by Japheth Homepage, Germany (South), 22.04.2008, 10:33

> Hi,
> does someone know how to make a timeout in a loop executing during
> interrupt disabled (CLI)?

Hey, you're in a DOS board! We know everything!

> Timeout would be about 1sec but it shouldn't be
> dependent on CPU speed. I cannot use clock/uclock/delay functions when
> interrupt disabled. It should also work under win9x.

I guess that "Timeout" means that you want to wait for a certain amount of time. With interrupts disabled this can be done by scanning the "keyboard controller port B control register" (port 0061h), bit 4, which toggles with each "refresh cycle".

If this doesn't work in Win9x, you can also consider to read the PIT timer values directly (ports 40h-43h), since it counts down with a fix frequency.

---
MS-DOS forever!

 

Complete thread:

Back to the forum
Board view  Mix view
22049 Postings in 2034 Threads, 396 registered users, 256 users online (1 registered, 255 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum