On Thu, 18 Nov 2004, fooler wrote:
> i think you are confuse between hardware clock, system clock and
> uptime....
>
> when your pc is turn off, your hardware clock (also known as real time
> clock, cmos clock or bios clock) is always ticking until the cmos
> battery is
> run out of power... when you boot up, linux will update its system clock
> from the hardware clock only once...
>
The story should be when your system is booted, it reads the
hardware clock more precisely known as real-time clock (RTC) and updates
the wall time (not system time) saved in variable xtime in kernel-space.
Each PC has a system timer in the form of programmable interrupt
timer (PIT). Some PCs use APIC. It is programmed to generate timer
interrupt at a periodic rate equal to 1/HZ.
> after that, linux kernel also initialiaze its internal variable named
> *jiffies* to *zero* and incremented 100 times per second or every 10
> milliseconds when the value of HZ is 100 by a clock interrupt... uptime
> is based on jiffies divided by HZ....
That's right. However, 2.6 kernel has HZ = 1000 for i386.
> as you can see, uptime has
> nothing to do
> with the hardware clock nor with the system clock...
>
Not really since both wall time and uptime are updated by timer
interrupt handler driven by the system timer.
The wall time is in fact periodically saved to hardware clock or
RTC at a periodic rate approx equal to 11 mins. This is implemented by
set_rtc_mmss() of do_timer_interrupt() in arch/i386/kernel/time.c .
rowel
--
Philippine Linux Users' Group (PLUG) Mailing List
[EMAIL PROTECTED] (#PLUG @ irc.free.net.ph)
Official Website: http://plug.linux.org.ph
Searchable Archives: http://marc.free.net.ph
.
To leave, go to http://lists.q-linux.com/mailman/listinfo/plug
.
Are you a Linux newbie? To join the newbie list, go to
http://lists.q-linux.com/mailman/listinfo/ph-linux-newbie