Date: Sun, 15 Jun 1997 11:54:50 +0300 (IDT) From: Eli Zaretskii To: Steve Higgins cc: "'DJGPP Mail List'" Subject: Re: Intermittent uclock() failure under DOS. In-Reply-To: <01BC7742.2B312840@TAURUS> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Thu, 12 Jun 1997, Steve Higgins wrote: > My bodge work around is to call the this function at the start of main(). > > void startup_uclock() > { > unsigned long tics; > > tics = _farpeekl(_dos_ds,0x46c); > > /* wait for a BIOS tick */ > while(tics == _farpeekl(_dos_ds,0x46c)); > /* initialise uclock() */ > uclock(); > } I don't understand. Here's a fragment from `uclock' sources: /* Make sure the numbers we get are consistent */ do { otics = _farpeekl(_dos_ds, 0x46c); outportb(0x43, 0x00); lsb = inportb(0x40); msb = inportb(0x40); tics = _farpeekl(_dos_ds, 0x46c); } while (otics != tics); It appears that `uclock' *does* in fact attempt to make both parts of the value consistent. Can you explain what is it that your loop does better than this one? Thanks.