a problem of CMOS clock

we have a device installed qnx 4.25c. these days we are doing some
test. that is: restart the deviece again and again, and each time
record the system clock of the start time. when the test going on for
about 7 to 8 hours, the CMOS clock return to 8:00 Jan,1 1970. that
means, at begin, the time recorda in the record file are normal time.
and then, after 7 or 8 hours, every record in the record file is 8:00
Jan,1 1970.

in our sysinit.1, we use “rtc -l hw” to get the CMOS clock as our
system clock. so when we found this strange time record, we checked
our system clock, and it realy has changed to 8:00 Jan,1 1970. so has
the CMOS clock.

can anyone tell me the reason?

On Thu, 16 Jun 2005 11:49:44 +0400, fenny
<fenny5555@hotmail-dot-com.no-spam.invalid> wrote:

can anyone tell me the reason?
Are you sure the CMOS battery is OK?

The second thing I don’t like in what you’ve said is “rtc -l hw”.
You’d better define your local time-zone, set it in the
/etc/config/sysinit.$NODE (at the very begining), adjust CMOS to be on
UTC, and edit “rtc hw”.

Tony.

PS
Assuming you are in Central Europe:
export TZ=CET-1CEST-2,M3.5.0/2,M10.5.0/3

Tony <mts.spb.suxx@mail.ru> wrote:

On Thu, 16 Jun 2005 11:49:44 +0400, fenny
fenny5555@hotmail-dot-com.no-spam.invalid> > wrote:
can anyone tell me the reason?
Are you sure the CMOS battery is OK?

Yup, unless you do something like an rtc -s hw before the rtc -l hw,
it is not a software problem.

The second thing I don’t like in what you’ve said is “rtc -l hw”.
You’d better define your local time-zone, set it in the
/etc/config/sysinit.$NODE (at the very begining), adjust CMOS to be on
UTC, and edit “rtc hw”.

If the machine dual-boots Windows, he probably wants to leave the
CMOS clock in local time, cause I think Windows is much happier with
that.

-David

David Gibbs
QNX Training Services
dagibbs@qnx.com

so maybe it’s my problem not discribed very clearly.

I’ll give more details this time:

  1. In my sysinit.1, I have set my local time zone, and then use rtc -l
    hw. we use the same sysinit.1 in other devices(I mean, other CPU and
    other chipset, in a word, other hardware, but are all based on X86)
    as well, and they all work very normal. We have not use “rtc -s hw”
    in our test programme, and neither in anywhere else. What we do is
    only restart the machine, and get the system clock, and record it to
    a log file.

2)about the battery, if there is no battery, or the battery does not
work, I should get the CMOS time as 8:00 Jan,1 1970 from the very
beginning. But what I meet is, at beginning, I get a correct time,
and after quite a lot time, the CMOS time changed, and after a
restart, the system clock changed too.
But we also found that, when we stop the test for a certain time, set
the correct clock to the hardware(use rtc -s hw), and then redo the
test, the correct clock can maintain for some time.

so I’m thinking of one thing about the battery: maybe the battery is
ok at the beginning, and because of our restarting again and again(
the time between two restart is about 1’20’’, but we use showdown -f,
so I think the poweroff time is very short), the power of the battery
is effected. perhaps the effection is slightly, but is cumulated. and
when the time of restart is much enough, the battery invalidated. Can
this be true?

In article <d8s70m$rkb$1@inn.qnx.com>, dagibbs@qnx.com says…

Tony <> mts.spb.suxx@mail.ru> > wrote:
On Thu, 16 Jun 2005 11:49:44 +0400, fenny
fenny5555@hotmail-dot-com.no-spam.invalid> > wrote:
can anyone tell me the reason?
Are you sure the CMOS battery is OK?

Yup, unless you do something like an rtc -s hw before the rtc -l hw,
it is not a software problem.

Unless you do something like read/write I/O ports at 0x70, 0x71 as well
:slight_smile:

The second thing I don’t like in what you’ve said is “rtc -l hw”.
You’d better define your local time-zone, set it in the
/etc/config/sysinit.$NODE (at the very begining), adjust CMOS to be on
UTC, and edit “rtc hw”.

If the machine dual-boots Windows, he probably wants to leave the
CMOS clock in local time, cause I think Windows is much happier with
that.

Yeah, Windows is much happier with local time in CMOS clock (I hope they
change it in nearest future, may be couple of years :slight_smile:). For guys like
Tony there is this page

http://ed1k.qnx.org.ru/timesync.html

And thanks Tony that page is there :slight_smile: I’m gonna put that NT native
application on the page, did you try it, Tony?

Eduard.

On Sat, 18 Jun 2005 05:44:26 +0400, ed1k <ed1k@fake.address> wrote:

application on the page, did you try it, Tony?
Not yet.

You’ve scared me to death with those warnings regarding what I’d do to get
rid of it if things go wrong…
:slight_smile:
But I’ll try.

Tony.

On Sat, 18 Jun 2005 05:44:26 +0400, ed1k <ed1k@fake.address> wrote:

And thanks Tony that page is there > :slight_smile:
I gonna put that NT native application on the page, did you try it, Tony?
Hm…

Not yet tryed the utility (ntiks.exe) you’ve mailed me way then…

But the “timesync.exe” is now launched by means of “srvany.exe” and I was
able to turn my everyday account to a regular user (i.e. dropped it’s
administrative rights).

Thanks a lot, Eduard!

Tony.

OK.
NTiks.exe v0.13L works on winXP-SP1 too. (But you really frightened me
with the splash screen! I thought “This is it!” the first time I restarted
it.)

Tony.

In article op.ssxv4qyho93ri4@mobile, mts.spb.suxx@mail.ru says…

OK.
NTiks.exe v0.13L works on winXP-SP1 too. (But you really frightened me
with the splash screen! I thought “This is it!” the first time I restarted
it.)

Don’t be so easy to scare. What you can lose? Just winXP… it’s not
worth :slight_smile: BTW, splash screen means it works, though it may report some
errors. When it doesn’t work you will see BSOD or just black screen with
no evidence of life.

To remove splash screen run regedt32 (exactly this editor as it works
much better with REG_MULTI_SZ), go to
HKLM\SYSTEM\CurrentControlSet\Control\SessionManager
highlight BootExecute key, go to menu Edit → Multi String… and add
/q command line option to ntiks.

Remove srvany service that launch timesync because you don’t need it
anymore and keep timesync just to check settings from win32 environment.

Thanks for testing. Now I know it works with win2k and winXP.

Eduard.

Tony.