Add a question explaining why laptops may gain or lose time at a very

rapid rate, and how to use sysctl(8) to select a new timecounter to fix
it.
This commit is contained in:
Nik Clayton 2001-04-23 08:43:39 +00:00
parent 133e99c0dc
commit dbe66e3d35
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=9278
2 changed files with 100 additions and 2 deletions

View file

@ -14,7 +14,7 @@
<corpauthor>The FreeBSD Documentation Project</corpauthor>
<pubdate>$FreeBSD: doc/en_US.ISO_8859-1/books/faq/book.sgml,v 1.176 2001/04/21 05:00:58 jkh Exp $</pubdate>
<pubdate>$FreeBSD: doc/en_US.ISO_8859-1/books/faq/book.sgml,v 1.177 2001/04/23 08:19:56 nik Exp $</pubdate>
<copyright>
<year>1995</year>
@ -4470,6 +4470,55 @@ kern.maxfiles: 1064
</screen>
</answer>
</qandaentry>
<qandaentry>
<question id="laptop-clock-skew">
<para>The clock on my laptop keeps incorrect time, losing or gaining
seconds at a very rapid rate.</para>
</question>
<answer>
<para>Your laptop has two or more clocks, and FreeBSD has chosen to
use the wrong one.</para>
<para>Run &man.dmesg.8;, and check for lines that contain
<literal>Timecounter</literal>. The last line printed is the one
that FreeBSD chose, and will almost certainly be
<literal>TSC</literal>.</para>
<screen>&prompt.root; <userinput>dmesg | grep Timecounter</userinput>
Timecounter "i8254" frequency 1193182 Hz
Timecounter "TSC" frequency 595573479 Hz</screen>
<para>You can confirm this by checking the
<literal>kern.timecounter.hardware</literal>
&man.sysctl.3;.</para>
<screen>&prompt.root; <userinput>sysctl kern.timecounter.hardware</userinput>
kern.timecounter.hardware: TSC</screen>
<para>The BIOS may modify the TSC clock&mdash;perhaps to change the
speed of the processor when running from batteries, or going in to
a power saving mode, but FreeBSD is unaware of these adjustments,
and appears to gain or lose time.</para>
<para>In this example, the <literal>i8254</literal> clock is also
available, and can be selected by writing its name to the
<literal>kern.timecounter.hardware</literal>
&man.sysctl.3;.</para>
<screen>&prompt.root; <userinput>sysctl -w kern.timecounter.hardware=i8254</userinput>
kern.timecounter.hardware: TSC -> i8254</screen>
<para>Your laptop should now start keeping more accurate
time.</para>
<para>To have this change automatically run at boot time, add the
following line to <filename>/etc/sysctl.conf</filename>.</para>
<programlisting>kern.timecounter.hardware=i8254</programlisting>
</answer>
</qandaentry>
</qandaset>
</chapter>

View file

@ -14,7 +14,7 @@
<corpauthor>The FreeBSD Documentation Project</corpauthor>
<pubdate>$FreeBSD: doc/en_US.ISO_8859-1/books/faq/book.sgml,v 1.176 2001/04/21 05:00:58 jkh Exp $</pubdate>
<pubdate>$FreeBSD: doc/en_US.ISO_8859-1/books/faq/book.sgml,v 1.177 2001/04/23 08:19:56 nik Exp $</pubdate>
<copyright>
<year>1995</year>
@ -4470,6 +4470,55 @@ kern.maxfiles: 1064
</screen>
</answer>
</qandaentry>
<qandaentry>
<question id="laptop-clock-skew">
<para>The clock on my laptop keeps incorrect time, losing or gaining
seconds at a very rapid rate.</para>
</question>
<answer>
<para>Your laptop has two or more clocks, and FreeBSD has chosen to
use the wrong one.</para>
<para>Run &man.dmesg.8;, and check for lines that contain
<literal>Timecounter</literal>. The last line printed is the one
that FreeBSD chose, and will almost certainly be
<literal>TSC</literal>.</para>
<screen>&prompt.root; <userinput>dmesg | grep Timecounter</userinput>
Timecounter "i8254" frequency 1193182 Hz
Timecounter "TSC" frequency 595573479 Hz</screen>
<para>You can confirm this by checking the
<literal>kern.timecounter.hardware</literal>
&man.sysctl.3;.</para>
<screen>&prompt.root; <userinput>sysctl kern.timecounter.hardware</userinput>
kern.timecounter.hardware: TSC</screen>
<para>The BIOS may modify the TSC clock&mdash;perhaps to change the
speed of the processor when running from batteries, or going in to
a power saving mode, but FreeBSD is unaware of these adjustments,
and appears to gain or lose time.</para>
<para>In this example, the <literal>i8254</literal> clock is also
available, and can be selected by writing its name to the
<literal>kern.timecounter.hardware</literal>
&man.sysctl.3;.</para>
<screen>&prompt.root; <userinput>sysctl -w kern.timecounter.hardware=i8254</userinput>
kern.timecounter.hardware: TSC -> i8254</screen>
<para>Your laptop should now start keeping more accurate
time.</para>
<para>To have this change automatically run at boot time, add the
following line to <filename>/etc/sysctl.conf</filename>.</para>
<programlisting>kern.timecounter.hardware=i8254</programlisting>
</answer>
</qandaentry>
</qandaset>
</chapter>