kernel time and RTC - Help

This is a discussion on kernel time and RTC - Help ; Hi Im having a problem in understanding the relation between the RTC and the kernel time. When the user call the "date" shell command to update the kernel time, is the RTC is updated too? and vice versa, is setting ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: kernel time and RTC

  1. kernel time and RTC

    Hi
    Im having a problem in understanding the relation between the RTC and
    the kernel time.
    When the user call the "date" shell command to update the kernel time,
    is the RTC is updated too? and vice versa, is setting the RTC via
    /dev/rtc updated the kernel time?
    Thanks
    Hagit

  2. Re: kernel time and RTC

    Hagit wrote:

    > Im having a problem in understanding the relation between the RTC and
    > the kernel time.
    > When the user call the "date" shell command to update the kernel time,
    > is the RTC is updated too? and vice versa, is setting the RTC via
    > /dev/rtc updated the kernel time?


    The RTC, or "hardware clock" is consulted at bootup time to find out what
    time it is. After that, the kernel keeps its own time, independent of the
    RTC. It's possible to set the RTC's time without changing the kernel's
    time while the system is up and running.

    More importantly, changing the kernel's idea of what time it is doesn't
    usually reset the RTC under linux. Most distros come with a command called
    "hwclock" (for "hardware clock") which can set the RTC's time.

    The most useful commands are:

    hwclock --systohc (copy system time to the RTC)
    hwclock --hctosys (copy RTC time to the system)

    hwclock --hctosys is generally called in the startup scripts. If you've
    reset the time manually, you'll want to use hwclock --systohc.

    It has a bunch of other options; see the man page if you want the gory
    details. It also explains a bunch about how the system keeps time.

    Among other things, it talks about how Linux has a mode where it resets the
    hardware clock to the system time every 11 minutes, and how to find out if
    your system uses that or not.

    --
    ZZzz |\ _,,,---,,_ Travis S. Casey
    /,`.-'`' -. ;-;;,_ No one agrees with me. Not even me.
    |,4- ) )-,_..;\ ( `'-'
    '---''(_/--' `-'\_)

  3. Re: kernel time and RTC

    Travis Casey wrote:

    > The RTC, or "hardware clock" is consulted at bootup time to find out what
    > time it is.**After*that,*the*kernel*keeps*its*own*time,*in dependent*of*the
    > RTC.**It's*possible*to*set*the*RTC's*time*without* changing*the*kernel's
    > time while the system is up and running.


    .... and some distros will write the time back
    out to the RTC upon shutdown
    ..
    --
    << http://michaeljtobler.homelinux.com/ >>
    It is impossible to experience one's death
    objectively and still carry a tune. - Woody Allen


+ Reply to Thread