Re: arch/alpha/kernel/time.c kernel 2.2.1 (ARC +20 years bug)

Andries.Brouwer@cwi.nl
Mon, 15 Feb 1999 12:32:17 +0100 (MET)


Alex Rhomberg writes:

: This is a patch for 2.2.* kernels for Alphas
: With this patch, the kernel reads the correct time from BIOS when
: booting from ARC/AlphaBIOS console (detection of starting epoch 1980
: as opposed to 1900 for SRM console

Note that the kernel already maintains an epoch in the rtc code
(see linux/drivers/char/rtc.c). There similar heuristics are used
to determines the epoch. Moreover, there are ioctl's to set the
epoch from userspace.

linux/drivers/char/rtc.c now knows about 1900, 1952 and 1980.
The unpatched linux/arch/alpha/kernel/time.c now seems to
reckon with 1900 and 1958; the patch adds 1980.

Clearly linux/drivers/char/rtc.c and linux/arch/alpha/kernel/time.c
must use precisely the same epoch value. It should be defined
outside of #ifdef CONFIG_RTC.

Furthermore, note that this patch is a heuristic only,
and that it may fail. For example, when booting SRM via ARC
the epoch is probably 1900 and not 1980.

Andries

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/