Mail Archives: djgpp-workers/2005/10/08/15:34:42
I recently encountered program hangups under WinXP and traced it to the
BIOS timer tick accessed by _farpeekl(_dos_ds, 0x46c) not advancing
unless BIOS is actually called.
Scanning through the archives I encountered a number of messages
about irregular timer ticks and quite complex ways like RDTSC to resolve
it. I believe many of them can be simply solved by calling BIOS. The
following function illustrates my point:
int GetTick(void)
{
__dpmi_regs r;
r.h.ah = 0x11; // check keyboard status and ignore result
__dpmi_int(0x16, &r);
return _farpeekl(_dos_ds, 0x46c);
}
Having to do a BIOS call anyway, one can probably just use the BIOS call
to get the ticks directly using Int 0x1a, Function 0. I very much doubt that
the midnight passed flag will influence Win2K/XP.
Note that the clock() function in LIBC suffers from the same problem.
===============================================
Gerrit van Niekerk
GP van Niekerk Ondernemings BK
Roosstraat 211, Meyerspark, 0184, South Africa
Tel: +27(12)8036501 Fax SA: 0866 413 555
Fax Int'l: +12(06)2034131
Email: gerritvn AT gpvno DOT co DOT za
Web: http://www.gpvno.co.za
===============================================
- Raw text -