Re: [PATCH] HZ=100 assumptions

Albert D. Cahalan (acahalan@cs.uml.edu)
Fri, 30 Jul 1999 02:21:01 -0400 (EDT)


First of all, fix your mail software and/or account information.
(try the "chfn" command) The linux-kernel archives think you are
Stephen C. Tweedie, but the email address isn't right for him.

Unidentified person writes:
> On Thu, 29 Jul 1999, Steve Underwood wrote:
>> "Albert D. Cahalan" wrote:
>>> Eric Lammerts writes:
>>>> On Wed, 28 Jul 1999, Riley Williams wrote:

>>>>> However, the standard used by MSDOS (which I assume is what you're
>>>>> referring to) is for the clock to tick ~18.2 times per second (to
>>>>> be more accurate, 65536 ticks per hour), in which case the correct
>>>>
>>>> This is incorrect. The BIOS/MSDOS clock is generated from a 14.31818MHz
>>>> crystal clock divided by 12 * 65536.
>>>
>>> Nope. Clock frequency varies. Originally it was related to a standard
>>> video frequency. More recent computers use a frequency designed to make
>>> DOS timekeeping be more accurate. (the 65536 ticks/hour I suppose)
>>
>> Nope. Many modern computers use an el. cheapo clock that is just plain
>> inaccurate, and they don't keep time very well. Any Compaq ProLiant
...
> 65536 ticks per hour would be approx 18.2hz, which definitely can't be

There is a divider that gives an approximately 18.2 Hz clock.
Linux resets this to get approximately 100 Hz.

The original PC used a video standard crystal. The divider was set
to give approximately 65536 ticks per hour, which made it easy to
detect an hour change. The BIOS needed to update something hourly.

DOS was designed to use this. DOS timekeeping was poor because it
didn't get a perfectly even number of ticks in an hour. After video
cards switched to other clock sources, the frequency could be adjusted
to make everything come out perfect. Now the clock is often made to
agree with what used to be just an approximation used by the BIOS.

This isn't a very big difference of course. (14.316558 vs. 14.31818)
DOS would use an "hour" of 3599.592 seconds with the old frequency.
Linux seems to assume a frequency of 14.31816 -- none of the above.

Only one way to resolve this: somebody measure a few thousand modern
computers from different vendors, years, and production runs.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/