Messages in this thread | | | Date | Tue, 15 Aug 2000 00:33:34 +0200 | From | Jan-Benedict Glaw <> | Subject | Setting the clock at boot time on Alpha |
| |
Hi!
I discovered some files that were created in 2048(!) some time ago and now I've tracked down the problem.
./linux/drivers/char/rtc.o: The RTC driver is correct in detecting "epoch = 1952" for my board (AXPpci33 aka NoName). The stored value for "year" is "48" so rtc.o calculates 1952+48=2000. Fine.
./linux/arch/alpha/kernel/time.c: In time_init() the kernel's time is set by the value of the RTC's year field. However, 1900 is assumed to be the correct epoch value as it is for normal PCs (originally, this time.c was copied from ia32 port AFAIthink): 1900+48=1948. 1948 is smaller than 1970 so 100 is added: 2048. Not so fine...
Later in the boot process (after rtc.o is loaded) hwclock sets the kernel's time to the right value. However, some daemons were started before so some files have got timestamps in 2048;(
Solution 1: ~~~~~~~~~~~ Double the code from rtc.c which does the Right Thing just now. I think that this is the good thing to do. Alphas simply do have different epoches so we should take care for that... Unfortunately doubling the code may break some systems at their next boot if the person didn't use the rtc module befort to access RTC by hwclock: hwclock tries to work through rtc.o. If it is loaded - good. If not, hwclock uses ISA I/O. Not so good, as wrong values (wrt to the really correct epoch) may be stored. This results in wrong year values after correcting time.c.
Solution 2: ~~~~~~~~~~~ Keep everything as it is just right now. This is IMHO the Wrong Way as wrong values are stored. Quite a number of systems *are* running with wrong boot-up values. These wrong values are (normally) corrected during the userland boot up process (as it was for me). But some files are there with wrong time stamps (for me, they are in 2048). This is not so good.
I'd like you to comment on this (of course, I've already got that simple patch for Solution 1;)
MfG, JBG
-- Fehler eingestehen, Größe zeigen: Nehmt die Rechtschreibreform zurück!!! /* Jan-Benedict Glaw <jbglaw@lug-owl.de> -- +49-177-5601720 */ keyID=0x8399E1BB fingerprint=250D 3BCF 7127 0D8C A444 A961 1DBD 5E75 8399 E1BB "insmod vi.o and there we go..." (Alexander Viro on linux-kernel) [unhandled content-type:application/pgp-signature] | |