Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I know that hardware clock is RTC, which is running still, even when PC (or another device with RTC) is off. (in linux we can see this time by typing "hwclock") The second mentioned time, system time, is the time it is really used by OS, by linux. I can see it by comamnd "date"

But I still don't know, how is system time assigned after PC start. Is there some offset value set in linux, which is then used, and the calculation of system time is done using the hardware time and this offset?

Or it is working in another way?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

Yes there are these two clocks. The RTC (aka CMOS Clock/ Hardware Clock) as you referred, and the System Clock (aka Kernel Clock, Software Clock) whose value is saved in the OS config. This system clock is based on Timer Interrupts.

And as is obvious these two may some fractional offset due to which they will deviate and the OS has multiple strategies to deal with the timer drift. One of the common modern ways to keep both in sync using a Time Server like time.windows.com based on the Network Time protocol.

share|improve this answer
    
Iunknown: "and the System Clock (aka Kernel Clock, Software Clock) whose value is saved in the OS config" - this value of clock would be deprecated by next start of OS –  srnka Jan 26 '12 at 10:45
1  
The time is synchronized with the RTC, at the bootstrap to compensate for the offset one might have configured due to various reasons, some like to have a clock faster by few min, or the DST settings etc. After that the clock is forwarded using Programmable Interval Timer or the newer HPET. –  IUnknown Jan 26 '12 at 18:10
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.