See below.
Matt Reimer wrote:
On 9/4/07, Tamas Szabo <[EMAIL PROTECTED]> wrote:
Hello,
There is 10 years of difference between Linux and WM5 clock (everybody
has this problem?). It seems Linux count time from 1970-01-01 while WM5
count it from 1980-01-01 (try to set 1970-01-01 in WM5...).
It does not matter whether boot natively or by HaRET (at least for me).
I made a patch to rtc-sa1100.c (/drivers/rtc) which add/subtract ten
years to/from time. However I am absolutely not sure that this is an
exact solution.
I am using the constant (10*365+3)*24*60*60. It seems to be correct in
many cases, but maybe not always. I also applied this for alarm register.
Of course I think Linux's clock management is the right one, but I
cannot modify WM5 internals, so I chosen this way.
Please take a look at the patch and feedback to me.
Better would be to write a script to detect that WM5 had booted
previously and adjust the time, so those that run linux "natively"
(using sdgboot) won't be affected.
Matt, maybe I can understand you or you cannot understand how the system
works.
At first, scripts can execute only after Linux already booted. However
you may need to know the time earlier. It may cause undesirable side
effects if you simply jump 10 years during other programs running.
Second, this means in WM5 you need to store something in the flash and
reading in Linux. This can be very tricky. There is (still) no WM5 flash
filesystem driver for Linux (am I right?).
I also use SDG's boot loader, and run Linux "natively" (thanks to my
bootldr patch:-)))
I think it is better to keep the time in RTC and add a constant to it if
necessary, than changing the value in the RTC chip every time you reboot
in different OS.
/sza2
Matt
_______________________________________________
Hx4700-port mailing list
[email protected]
https://www.handhelds.org/mailman/listinfo/hx4700-port