The only "funny" thing the program does is to read the BIOS timer variable
using "_farpeekl(_dos_ds, 0x46c);".
I am using the "17-Nov-2003 DJGPP CVS Development Bin (djdev)",
DJGPP Version 2.04 BETA 1 PRE RELEASE BY ANDREW COTTRELL
BUILT WITH CVS LIBC OF 16-November-2003
Version 2.03 gave similar results.
Any help will be appreciated.
===============================================
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: gerr...@gpvno.co.za
Web: http://www.gpvno.co.za
===============================================
The problem seems that WinXP does not bother to update BIOS variables
unless BIOS calls are actually made. That means that a loop waiting for
_farpeekl(_dos_ds, 0x46c), to return a different value, will never exit. To
make it work, one has to call BIOS in the loop. I used
int GetTick(void)
{
__dpmi_regs r;
int iRet;
r.h.ah = 0x11; // check keyboard status and ignore result
__dpmi_int(0x16, &r);
iRet = _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.