Messages in this thread | | | Date | 3 Jun 2015 02:27:42 -0400 | From | "George Spelvin" <> | Subject | Re: [PATCH RFC] x86, tsc: Allow for high latency in quick_pit_calibrate() |
| |
Linus wrote: > The only *well-defined* clock in a modern PC seems to still remain the > PIT. Yes, it's very sad. But all the other clocks tend to be > untrustworthy for various reasons
Actually, there is one more: the CMOS RTC clock is quite reliably 32768 Hz.
The reas process is very similar, although you only have a single PE bit rather than a count for sanity checking. You can program a rate between 2 Hz and 8192 Hz at which the PE bit (register C, 0x06) will be set.
A rate of 4096 Hz would work similarly to the current PIT-based 1193182/256 = 4661 Hz code.
Then you just poll until you capture the transition (it's cleared automatically by read) and do similar filtering.
(It would also be very nifty to use some of the values collected by this calibration to seed boot-time entropy.)
| |