Re: Timers (was Trivial pc-speaker problem.)

看板DFBSD_kernel作者時間21年前 (2004/09/28 02:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串5/5 (看更多)
: Thanks for the long answer. But I don't get where hz comes from. It's :obviously not timer <not 0> then. (And 18.2 Hz might be a bit slow.) : : So is the "hz tick" just another event that timer 0 checks (and sets up :an interval) for then? Right. The 'hz' tick is just a periodic SYSTIMER in DFly, whereas in FreeBSD the 'hz' tick is the primary timer 0 timebase interrupt. : (And is then timer <not 0> used to calculate how many cycles there are to :go until the next tick? (Since timer 0 is "unsuitable for keeping track :of ''real'' time") ) Right. The timer <not 0> is used to calculate the elapsed time in microsecond granularity. It does not need to generate an interrupt or anything, it just needs to be consistent. In fact, the TSC or APIC ltimer or other hardware timers could be used for this purpose (though each has its quirks, which is why I'd really like to use one of the 8254 timers). The real time clock (rtc) chip does not have enough resolution to use for this purpose. : This stuff is interesting, had to think for a bit too. Thanks again. : :Magnus -Matt Matthew Dillon <dillon@backplane.com>
文章代碼(AID): #11M5Lr00 (DFBSD_kernel)
文章代碼(AID): #11M5Lr00 (DFBSD_kernel)