delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/10/06/14:52:26

Date: Thu, 6 Oct 1994 10:19:53 -0400 (EDT)
From: Edwin Phillips <flaregun AT strauss DOT udel DOT edu>
To: hvb AT netrix DOT com
Cc: eliz AT is DOT elta DOT co DOT il, DJGPP AT sun DOT soe DOT clarkson DOT edu, victor AT euler DOT berkeley DOT edu
Subject: Re: accuracy of clock()

On Wed, 5 Oct 1994 hvb AT netrix DOT com wrote:

> 
> > 
> > > We had to reprogram the timer chip (8253) to have a faster interrupt rate.  You
> > > still need to call the original interrupt to have the DOS clock up to date.
> > > On some hardware platform, this is not achievable as the disk drive actually
> > > uses the chip timer output for some of its own timing!!!
> > 
> > AFAIK the timer chip has 3 independent timers/counters, each of which
> > can be programmed individually.  The first 2 are used, but the third
> > isn't.  So, unless those disks you mention use that third timer, it
> > can be reprogrammed without affecting system operation in any way
> > whatsoever, including the luxury to not pass the interrupts to the
> > original Int 08 handler which maintains DOS time.  Am I right?
> > 
> The truth is:
> 
> Timer 0 is the one that DOS uses for its real time clock interrupt.  I've
> read somewhere that some disk hardware uses this timer 0 output to time
> some of its internal operation, so if we reprogram this timer, on some
> hardware you may have to restore it back to its original state before
> certain disk operation.  We did not need to do this on our PC based hardware.
> If we had to we probably have to work on some other solutions as it
> is not acceptable to do so.
> 
> Timer 1: is used for the RAM refresh.  So it is a no no.
> 
> Timer 2: is used to generate sound for the speaker.  This output does not
> generate any interrupt to the CPU.  If you just want to sample the clock timer
> then it is ok.
> 

  Anyone got docs on how to program the timers?  If this is correct and 
you can use timer 2 without worrying about disk drives/system stuff, then 
it seems that we could make some decent use of it for DJGPP.

	Thanks,
	Ed

/****************************************************************************/
/* Ed Phillips  flaregun AT strauss DOT udel DOT edu      University of Delaware       */
/* Jr Systems Programmer  (302) 831-6082    IT/Network and Systems Services */
/****************************************************************************/


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019