How to adjust clock frequency in FreeBSD 10.1 ?

Rick Thomas rbthomas at pobox.com
Sat Feb 14 19:17:09 UTC 2015


On Feb 14, 2015, at 4:50 AM, Adam Vande More <amvandemore at gmail.com> wrote:

> On Sat, Feb 14, 2015 at 5:42 AM, Rick Thomas <rbthomas at pobox.com> wrote:
> 
>> When I try to change the frequency with (e.g.)
>>    sysctl kern.timecounter.tc.timebase.frequency=36000000
>> 
>> I get
>>    sysctl: oid ‘kern.timecounter.tc.timebase.frequency' is read only
>> 
> 
> Yeah, pretty clear that sysctl isn't going to help you in any way in "man 4
> timecounters"
> 
> Is there some other way to set the frequency?
>> 
> 
> Sure, but I thought keeping accurate time was the goal?  If so, sharing the
> output from the first command I gave you is a good start.

Ooops…  Sorry! I thought I had already done that.  In any case, here it is:

> [root at grey ~]# sysctl kern.timecounter
> kern.timecounter.fast_gettime: 1
> kern.timecounter.tick: 1
> kern.timecounter.choice: timebase(0) dummy(-1000000)
> kern.timecounter.hardware: timebase
> kern.timecounter.alloweddeviation: 5
> kern.timecounter.stepwarnings: 0
> kern.timecounter.tc.timebase.mask: 4294967295
> kern.timecounter.tc.timebase.counter: 1981288884
> kern.timecounter.tc.timebase.frequency: 33290001
> kern.timecounter.tc.timebase.quality: 0
> [root at grey ~]# 

I’m guessing that by tuning the timebase.frequency number, I can make the clock run effectively slower or faster.  If I find the right value, I can correct the problem I’m seeing with ntpd.

In case it matters, this is a powerpc Macintosh G4, so the only available timecounter is “timebase”.  Switching to a different timecounter is not an available option.

Rick


More information about the freebsd-questions mailing list