kernel time and RTC - Redhat

This is a discussion on kernel time and RTC - Redhat ; 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 4 of 4

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_guy@hotmail.com (Hagit) wrote in message news:<2503fc9c.0404230146.13cdda9f@posting.google.com>...
    > 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


    Why are you asking?

    AFAIK ...

    Linux provides access to RTC via /dev/rtc (a _read_only_ dev file) and
    /proc/rtc (for status info) but does not use it except at boot and
    shutdown -- at boot to read rtc and set kernel UTC "clock" and at
    shutdown to re-set rtc to adjust for "drift".

    $ man hwclock
    to get the details of "normal" use of rtc. Also,

    $ info date
    to see how to set rtc from Linux and/or read it's source code to see
    _how_ they set the rtc from Linux user space ( it's not handy to me
    for a peek).

    Embedded, real-time Linux systems _are_ concerned with/use the rtc
    facilities but do so by hacking kernel code and/or installing
    interrupt handlers.

    hth,
    prg
    email above disable

  3. Re: kernel time and RTC

    rdgentry1@cablelynx.com (P Gentry) wrote in message news:...
    > hagit_guy@hotmail.com (Hagit) wrote in message news:<2503fc9c.0404230146.13cdda9f@posting.google.com>...
    > > 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

    >
    > Why are you asking?
    >
    > AFAIK ...
    >
    > Linux provides access to RTC via /dev/rtc (a _read_only_ dev file) and
    > /proc/rtc (for status info) but does not use it except at boot and
    > shutdown -- at boot to read rtc and set kernel UTC "clock" and at
    > shutdown to re-set rtc to adjust for "drift".
    >
    > $ man hwclock
    > to get the details of "normal" use of rtc. Also,
    >
    > $ info date
    > to see how to set rtc from Linux and/or read it's source code to see
    > _how_ they set the rtc from Linux user space ( it's not handy to me
    > for a peek).
    >
    > Embedded, real-time Linux systems _are_ concerned with/use the rtc
    > facilities but do so by hacking kernel code and/or installing
    > interrupt handlers.

    I am working with real-time Linux systems. What should I do in order
    to synchronize the system clock and the RTC??? user can set and get
    the RTC through /dev/rtc entry. Should I set the kernel clock whenevr
    the user set the RTC? When is the right time to update the RTC from
    the kernel time?
    Thanks

    >
    > hth,
    > prg
    > email above disable


  4. Re: kernel time and RTC

    hagit_guy@hotmail.com (Hagit) wrote in message news:<2503fc9c.0404242336.2f53dd64@posting.google.com>...
    > rdgentry1@cablelynx.com (P Gentry) wrote in message news:...
    > > hagit_guy@hotmail.com (Hagit) wrote in message news:<2503fc9c.0404230146.13cdda9f@posting.google.com>...


    [snip]

    > > Embedded, real-time Linux systems _are_ concerned with/use the rtc
    > > facilities but do so by hacking kernel code and/or installing
    > > interrupt handlers.

    > I am working with real-time Linux systems. What should I do in order
    > to synchronize the system clock and the RTC??? user can set and get
    > the RTC through /dev/rtc entry. Should I set the kernel clock whenevr
    > the user set the RTC? When is the right time to update the RTC from
    > the kernel time?
    > Thanks


    Well, this is _way_ beyond my limited experience -- 10 years old at
    that -- with audio signal generating/processing with DOS code.

    Mainstream Linux distros do _not_ use RTC -- if yours makes any
    "regular" use of it, then it's a "special" build. It's also not clear
    to me why you want to synch the RTC with kernel time on an ongoing (?)
    basis. If so, take a close look at hwclock and adjtimex.

    Do you _really_ want to allow non-root users to set RTC? This is
    rightfully considered a real security risk on multi-user systems.

    For true real time applications you will have to look around embedded
    Linux sites and be prepared to write an RTC device driver -- or get
    docs for the one on your system. The situation is much improved for
    2.6 kernels from what I read, so you _may_ be able to come up with a
    userland solution.

    Using Google web search with:
    embedded linux
    provided the following (maybe useful?):
    http://www.sabalsoftware.com/article...ncyInLinux.php
    http://www.linuxjournal.com/article.php?sid=5694
    http://www.linuxjournal.com/article.php?sid=4417
    http://www.linuxjournal.com/article.php?sid=6900
    http://www.lynuxworks.com/
    http://www.lynuxworks.com/products/w...linux-2.6.php3
    http://www.rtcmagazine.com/

    hth,
    prg
    email above disabled

+ Reply to Thread