How to adjust clock frequency in FreeBSD 10.1 ?

Rick Thomas rbthomas at pobox.com
Sat Mar 7 09:33:47 UTC 2015


On Mar 6, 2015, at 5:30 AM, Lena at lena.kiev.ua wrote:

>> From: Rick Thomas <rbthomas at pobox.com>
> 
>>>> I?ve got a machine with a really bad clock.
> 
> Motherboards usually have several timers, not single clock.
> At boot time, FreeBSD kernel assigns a number called "quality" to each timer
> and chooses which timer to use.
> Using some hints in /etc/device.hints, you can forbid FreeBSD kernel
> to use the faulty timer.
> 
> ~ $ dmesg | egrep -i 'time|clock'
> Timecounter "i8254" frequency 1193182 Hz quality 0
> Timecounter "ACPI-fast" frequency 3579545 Hz quality 1000
> acpi_timer0: <24-bit timer at 3.579545MHz> port 0x4008-0x400b on acpi0
> acpi_hpet0: <High Precision Event Timer> iomem 0xfefff000-0xfefff3ff irq 0,8 on acpi0
> Timecounter "HPET" frequency 25000000 Hz quality 900
> atrtc0: <AT realtime clock> port 0x70-0x73 on acpi0
> pmtimer0 on isa0
> Timecounter "TSC" frequency 2204612489 Hz quality 800
> Timecounters tick every 1.000 msec
> 
> sysctl -a | egrep -i 'time|clock' | less
> ...
> kern.timecounter.choice: TSC(800) HPET(900) ACPI-fast(1000) i8254(0) dummy(-1000000)
> kern.timecounter.hardware: ACPI-fast
> 
> If that doesn’t help, look for TIMER_FREQ in /sys/i386/conf/NOTES .

Thanks very much for the hints!  The machine in question is a PowerPC G4 Apple Macintosh.  So the timers aren’t quite so varied as you’d have on an i386 machine.  Here’s what I get…  Is any of it likely to be helpful?

> rbthomas at grey:~ % dmesg | egrep -i 'time|clock'
> Timecounter "timebase" frequency 33290001 Hz quality 0
> Event timer "decrementer" frequency 33290001 Hz quality 1000
> Timecounters tick every 1.000 msec

> rbthomas at grey:~ % sysctl -a | egrep -i 'time|clock
> kern.clockrate: { hz = 1000, tick = 1000, profhz = 8127, stathz = 127 }
> ...
> kern.eventtimer.choice: decrementer(1000)
> kern.eventtimer.et.decrementer.flags: 7
> kern.eventtimer.et.decrementer.frequency: 33290001
> kern.eventtimer.et.decrementer.quality: 1000
> kern.eventtimer.periodic: 0
> kern.eventtimer.timer: decrementer
> kern.eventtimer.idletick: 0
> kern.eventtimer.singlemul: 2
> ...
> 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: 2876823599
> kern.timecounter.tc.timebase.frequency: 33290001
> kern.timecounter.tc.timebase.quality: 0
> ...
> machdep.wall_cmos_clock: 0
> p1003_1b.realtime_signals: 200112
> p1003_1b.timers: 200112
> p1003_1b.delaytimer_max: 2147483647
> p1003_1b.timer_max: 32

And /sys/*/conf doesn’t seem to exist…

> rbthomas at grey:~ % ls -l /sys
> lrwxr-xr-x  1 root  wheel  11 Nov 11 17:21 /sys -> usr/src/sys
> rbthomas at grey:~ % ls -l /usr/src/
> total 0
> rbthomas at grey:~ % 

Am I missing something?

Thanks again!
Rick


More information about the freebsd-questions mailing list