RTC precision?

Jeffrey L Bromberger jeffrey at sci.ccny.cuny.edu
Thu Mar 7 06:28:58 AEST 1991


In article <924 at jonlab.UUCP> jon at jonlab.UUCP (Jon H. LaBadie) writes:
>However, there is access to a parameter that is the number of "ticks"
>since system boot.  Ticks are defined in sys/param.h as "HZ" to be 
>number of clock ticks per second.  Many things use HZ.  For example,
>the cursor is defined to be on for 2 HZ and off for 4 HZ.  Process
>accounting is logged each clock tick, not each second.
>
>On the 3B1, HZ is defined as 60 ticks per second.

Terrific, but this is a read-only sort of thing.  If I wanted to
implement a settimeofday(2) of adjtime(2) [my ultimate goal], I'd need
to control this.  But it really isn't nice to muck with the kernel's
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*
clock move either faster or slower than the hardware one.  Then, I'd
set the hardware from the software.  Assuming that this is done in one
piece of high-interrupt-level kernel code, it should be prretty
accurate.  Remember that the software clock can drop interrupts, so by
itself, the hardware clock is the real clock.  But, Thad has told me
that there is no way to use the RTC for any interval less than one
second.  Which means that the only chance I have of setting the time
more accurately then the second is by playing with the software clock
and back-feeding the hardware clock.

I'm starting to get the feeling that without beating upon the hardware
(to get better control over the clock), this issue is going to go
nowhere.  Why couldn't the designers have thought in a more general
frame of mind?  Time doesn't always move in seconds!

j
-- 
Jeffrey L. Bromberger
System Operator---City College of New York---Science Computing Facility
jeffrey at sci.ccny.cuny.edu			jeffrey at ccnysci.BITNET
	Anywhere!{cmcl2,philabs,phri}!ccnysci!jeffrey



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