RTC precision?

Clarence Dold dold at mitisft.Convergent.COM
Sat Mar 9 05:20:47 AEST 1991


in article <1991Mar6.202858.17593 at sci.ccny.cuny.edu>, jeffrey at sci.ccny.cuny.edu (Jeffrey L Bromberger) says:

> tick counter.  What I'm really after is some way to adjust the 3b1's
> clock to something smaller than a second.  Somehow, the LOSE/TCP code
> sends stuff out with useconds.  All I'm after is a way to make a *software*

The tv_usec returned by gettimeofday() is either 0, or time() % 60 * 10000
neither of them is really usec, it just looks good.

> itself, the hardware clock is the real clock.  

arguably true, but not very often...

The RTC chip is like a wristwatch (except terribly inaccurate).  The system
time (software clock) looks at it's wristwatch when it wakes up in the 
morning (boot time script), and possibly from time to time throughout
the day (via cron scripts).  I stretched that analogy far enough :-)

As far as my rapidly fading memory can recall, unless you do a "date -", 
the system clock is never adjusted to match the RTC.  When you specify a 
new date with "date 0306123491", you set the system time, and drive that
into the RTC.

In fact, an stime() call by itself doesn't set the RTC, just the system.
You must use syslocal(SYSL_WTRTC) to change the RTC, which 'date' does.
SYSL_WTRTC is the name on later Convergent boxes, I forget what it is on
the 3b1, but it's close.

-- 
---
Clarence A Dold - dold at tsmiti.Convergent.COM
               ...pyramid!ctnews!tsmiti!dold



More information about the Comp.sys.3b1 mailing list