Kristoff Bonne | 1 Mar 13:47 2009
Picon

setting system clock-rate

Hi All,

I have installed netbsd 4.0.1 on an old PC (pentium III, 1 Ghz).

Due to some reason (probably hardware I guess), the system-clock runs
about 3 % to fast. The RTV-clock is correct, but the system-clock goes 1
to 2 seconds more in advance every minute.

The time-difference is that large, that ntpd is unable to sync.

Using debian and "adjtimex", I managed to get the "tick" and
"frequency"-values to correct this:
tick: 9738, frequency: -1503002

So, how do I configure netbsd to change the system clock-rate. "sysctl
-w kern.clockrate=9738" doesn't work as that value seams to be read-only.

I tried using ntp with copying the value in the driftfile to netbsd
(-22.934), but that doesn't work neither. (doesn't ntpd use that value
to set the system-clock rate?)

Anybody any idea?

Cheerio! Kr. Bonne.

--

-- 
jabber/gtalk: kristoff <at> krbonne.net

Attachment (kristoff_bonne.vcf): text/x-vcard, 198 bytes
(Continue reading)

Cyrille Vladimirov | 1 Mar 15:24 2009
Picon

Re: setting system clock-rate

Hi Kristoff!
why shouldn't you try with ntpdate. just put this small sh script into
crontab and start it every 10 or 20 minutes

------------
#!/bin/sh
/usr/sbin/ntpdate us.pool.ntp.org
-------------

(replace us.pool.ntp.org it should be your some appr. time server in your
time zone, for example be.pool.ntp.org)
Cyrille

On 3/1/2009, "Kristoff Bonne" <kristoff.bonne <at> skypro.be> wrote:

>Hi All,
>
>
>I have installed netbsd 4.0.1 on an old PC (pentium III, 1 Ghz).
>
>
>Due to some reason (probably hardware I guess), the system-clock runs
>about 3 % to fast. The RTV-clock is correct, but the system-clock goes 1
>to 2 seconds more in advance every minute.
>
>The time-difference is that large, that ntpd is unable to sync.
>
>
>
>Using debian and "adjtimex", I managed to get the "tick" and
(Continue reading)

David Lord | 1 Mar 16:17 2009

Re: setting system clock-rate

On 1 Mar 2009 at 13:47, Kristoff Bonne wrote:

> Hi All,
> 
> 
> I have installed netbsd 4.0.1 on an old PC (pentium III, 1 Ghz).
> 
> 
> Due to some reason (probably hardware I guess), the system-clock runs
> about 3 % to fast. The RTV-clock is correct, but the system-clock goes 1
> to 2 seconds more in advance every minute.
> 
> The time-difference is that large, that ntpd is unable to sync.
> 

On NetBSD-3 I have compiled kernels with "options TIMER_FREQ=nnnnnnn"
with nnnnnnn adjusted from default so that ntpd frequency offset
settles down to < 10ppm. Some of the systems have needed 500ppm 
frequency adjustment then ntpd doesn't have a problem.

I'm not sure this works with NetBSD-4 as it is supposed to self 
calibrate and seems to have it right on some of upgrades I've done
but others are left at such a large offset that ntpd struggles
to sync and limited to short polling intervals. I'm in process of
move to 5.0 and will eventually give the TIMER_FREQ a try with 
the worst behaving pcs.

David

> 
(Continue reading)

matthew sporleder | 1 Mar 17:06 2009
Picon

Re: setting system clock-rate

On 3/1/09, Kristoff Bonne <kristoff.bonne <at> skypro.be> wrote:
> Hi All,
>
>
>  I have installed netbsd 4.0.1 on an old PC (pentium III, 1 Ghz).
>
>
>  Due to some reason (probably hardware I guess), the system-clock runs
>  about 3 % to fast. The RTV-clock is correct, but the system-clock goes 1
>  to 2 seconds more in advance every minute.
>
>  The time-difference is that large, that ntpd is unable to sync.
>
>
>
>  Using debian and "adjtimex", I managed to get the "tick" and
>  "frequency"-values to correct this:
>  tick: 9738, frequency: -1503002
>
>  So, how do I configure netbsd to change the system clock-rate. "sysctl
>  -w kern.clockrate=9738" doesn't work as that value seams to be read-only.
>
>
>  I tried using ntp with copying the value in the driftfile to netbsd
>  (-22.934), but that doesn't work neither. (doesn't ntpd use that value
>  to set the system-clock rate?)
>
>
>  Anybody any idea?
>
(Continue reading)

matthew sporleder | 1 Mar 17:49 2009
Picon

Re: setting system clock-rate

Do you have kern.timecounter?

On 3/1/09, Kristoff Bonne <kristoff.bonne <at> skypro.be> wrote:
>
>  Hi Matthew,
>
>
>  matthew sporleder schreef:
>
>  I have installed netbsd 4.0.1 on an old PC (pentium III, 1 Ghz).
>  Due to some reason (probably hardware I guess), the system-clock runs
>  about 3 % to fast. The RTC-clock is correct, but the system-clock goes 1
>  to 2 seconds more in advance every minute.
>
>  Can you look in machdep.est
>
>  Is this for CPU-scaling?
>
>  I do not think this is related to this, as I have this problem on any OS I
> run on the box, windows98 (which came with it), linux or netbsd.
>
>
>  BTW. I did try the installation-procedure as found here (see URL below) and
> it doesn't work. When I start esd, it says "estd: Cannot guess CPU-scaling
> technology. (maybe you are missing some kernel-option?)"
>
>  (URL: http://wiki.netbsd.se/CPU_frequency_scaling)
>
>  here some other info:
>
(Continue reading)

Kristoff Bonne | 1 Mar 17:59 2009
Picon

Re: setting system clock-rate

Matthew,

matthew sporleder schreef:
> Do you have kern.timecounter?
>   
Nope. :-(

This is the only systctl information which looks to me related to time
or clocks:

#sysctl -a | grep clock
kern.clockrate: tick = 10000, tickadj = 40, hz = 100, profhz = 100,
stathz = 100
kern.monotonic_clock = 200112
kern.drivers = [160 -1 crypto], [161 -1 pf], [163 163 fss], [164 -1
pps], [165 -1 ptm], [166 -1 atabus], [167 -1 drvctl], [168 168 dk], [169
-1 tap], [170 -1 veriexec], [171 -1 fw], [172 -1 ucycom], [173 -1 gpio],
[174 -1 utoppy], [175 -1 bthub], [176 -1 amr], [177 -1 lockstat], [178
-1 puffs], [181 -1 bio], [187 -1 twa], [0 -1 cons], [1 -1 ctty], [2 -1
mem], [3 0 wd], [4 1 swap], [5 -1 pts], [6 -1 ptc], [7 -1 log], [8 -1
com], [9 2 fd], [10 3 wt], [11 15 scd], [12 -1 pc], [13 4 sd], [14 5
st], [15 6 cd], [16 -1 lpt], [17 -1 ch], [18 16 ccd], [19 -1 ss], [20 -1
uk], [21 -1 apm], [22 -1 filedesc], [23 -1 bpf], [24 17 md], [26 -1
joy], [27 -1 spkr], [28 -1 lkm], [38 -1 cy], [39 7 mcd], [40 -1 tun],
[41 14 vnd], [42 -1 audio], [43 -1 svr4_net], [44 -1 ipl], [45 -1
satlink], [46 -1 rnd], [47 -1 wsdisplay], [48 -1 wskbd], [49 -1
wsmouse], [50 -1 isdn], [51 -1 isdnctl], [52 -1 isdnbchan], [53 -1
isdntrc], [54 -1 isdntel], [55 -1 usb], [56 -1 uhid], [57 -1 ulpt], [58
-1 midi], [59 -1 sequencer], [60 -1 vcoda], [61 -1 scsibus], [62 18
raid], [63 -1 esh], [64 -1 ugen], [65 -1 wsmux], [66 -1 ucom], [67 -1
(Continue reading)

Kristoff Bonne | 1 Mar 19:27 2009
Picon

Re: setting system clock-rate

Hi Cyrille,

Cyrille Vladimirov schreef:
> why shouldn't you try with ntpdate. just put this small sh script into
> crontab and start it every 10 or 20 minutes
>   
Well, in my  case, I would probably need to run it every minute. :-)

The problem is that I want to use this box for testing and playing
around and there are some application (like asterisk) which do not like
sudden jumps in system-time, especially as -in my case- the clock runs
to fast so I need to switch "back" every minute.

I know I can do this, but it's a "solution" I like to avoid as much as
possible.

Cheerio! Kr. Bonne.

--

-- 
jabber/gtalk: kristoff <at> krbonne.net

Attachment (kristoff_bonne.vcf): text/x-vcard, 198 bytes
David Lord | 1 Mar 20:10 2009

Re: setting system clock-rate

On 1 Mar 2009 at 17:54, Kristoff Bonne wrote:

> 
> David,
> 
> 
> 
> David Lord schreef:
>     
>     Due to some reason (probably hardware I guess), the system-
clock runs
>     about 3 % to fast. The RTC-clock is correct, but the system-
clock goes 1
>     to 2 seconds more in advance every minute.
>     
>     The time-difference is that large, that ntpd is unable to sync.
>         
> 
>     
>     
>     On NetBSD-3 I have compiled kernels with "options 
TIMER_FREQ=nnnnnnn"
>     with nnnnnnn adjusted from default so that ntpd frequency 
offset
>     settles down to < 10ppm. Some of the systems have needed 500ppm 

>     frequency adjustment then ntpd doesn't have a problem.
>       
> 
> Do you mean I need to re-compile my kernel, or is this something 
(Continue reading)

Kristoff Bonne | 1 Mar 22:47 2009
Picon

Re: setting system clock-rate

David,

(trying out the "nntp"-interface to this mailing-list. I hope this
message gets posted).

David Lord schreef:
>> Do you mean I need to re-compile my kernel, or is this something 
> that 
>> can be set during boot-time (option of grub or something like 
> that?)

> I've recompiled kernels including that option.

> I've just checked my kernel configs for NetBSD-4.0.1 and even one 
> I've found with a large offset on NetBSD-3 (approx +300ppm) has 
> been commented out as no longer needed on NetBSD-4.
> 
> The drifts you mention are orders of magnitude above those I've 
> been correcting for so it's possibly worth trying kernels with 
> TIMER_FREQ values adjusted by a similar amount +/- 30000ppm and 
> see if that makes a difference (I can't remember in which 
> direction the adjustment works). I have a note that default for
> TIMER_FREQ=1193182. Having a fast clock and making step 
> corrections backwards isn't considered a good idea :-(

Thanks for the help, ... but ... euh ... I fear you kind of lost me.

If I understand correctly, netbsd 4.0.1 (the version I am running) is
supposed to be "auto-syncronizing" (at least, if it can handle a drift
that large), but based on what does it do this syncronisation?
(Continue reading)

David Lord | 2 Mar 01:43 2009

Re: setting system clock-rate

On 1 Mar 2009 at 19:10, David Lord wrote:

> On 1 Mar 2009 at 17:54, Kristoff Bonne wrote:
> 
> > 
> > David,
> > 
> > 
> > 
> > David Lord schreef:
> >     
> >     Due to some reason (probably hardware I guess), the system-
> clock runs
> >     about 3 % to fast. The RTC-clock is correct, but the system-
> clock goes 1
> >     to 2 seconds more in advance every minute.
> >     
> >     The time-difference is that large, that ntpd is unable to 
sync.
> >         
> > 
> >     
> >     
> >     On NetBSD-3 I have compiled kernels with "options 
> TIMER_FREQ=nnnnnnn"
> >     with nnnnnnn adjusted from default so that ntpd frequency 
> offset
> >     settles down to < 10ppm. Some of the systems have needed 
500ppm 
> 
(Continue reading)


Gmane