[coyotos-dev] coyotos.sleep, sleepTill, the epoch
Jonathan S. Shapiro
shap at eros-os.com
Fri Feb 9 14:40:49 CST 2007
I want to try to dis-entangle some of my confusion in this conversation.
Really, it comes down to two very simple statements:
1. It's not the kernel's job to tell you what time it is.
2. Even if it *is* the kernel's job, the kernel can't do that job.
In principle, the kernel can only do two things:
1. Keep an accurate tick counter.
2. Record a baseline system wall-clock value that correlates to
the "zero point" on the tick counter.
The kernel cannot tell you what time it is in TAI, UTC, or anything
else. For starters, most hardware doesn't have any sort of reference
clock that is even approximately accurate. The most the kernel can do is
record enough information that higher-level software may be able to
clean up the mess or come up with an independently calibrated time.
In fact, it is *very* expensive for the kernel to maintain an accurate
tick counter. Regrettably, the tick counter rates on most hardware
scales up and down with the clock -- even in places (like the APIC)
where it isn't *supposed* to do this. The end result of this is that you
can have low power consumption or accurate time keeping, but you have to
Something you definitely do NOT want is a 1ms granularity interrupt to
maintain a tick counter. On current hardware this will account for a
measurable fraction of the machine.
Jonathan S. Shapiro, Ph.D.
The EROS Group, LLC
+1 443 927 1719 x5100
More information about the coyotos-dev