From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: X-Archive-Original-Message-ID: <3.0.1.32.19970507092250.006d0828@ellpspace.math.ualberta.ca> Date: Wed, 7 May 1997 16:27:19 +0100 From: Nikita Schmidt Subject: Re: Wrong date with RHL4.1 on PC164 In-Reply-To: Gentlemen, I think that we need a more permanent solution to our problem. We must switch to using /dev/rtc. It seems to be the only acceptable way of dealing with the CMOS clock, and the list of reasons why it is so is attached below. /dev/rtc is now broken on Alphas (at least in 2.0.x), but there is a patch to fix it (21-RTC-alpha2.diff somewhere at http://www.linuxhq.com). I have modified it to provide more flexible epoch support (that ugly 2017 stuff) with epoch autodetection on Alphas (no more ARC=true!). I'm going to submit the patch for inclusion into 2.0.31 if nobody stops me. The patch was posted to axp-kernel-list some days ago. If anybody wants to give it a try, it is also available by ftp from genie.ucd.ie:/pub/alpha/kernel/ as rtc-alpha.diff. The (slightly modified) hwclock program from util-linux-2.6 is in /pub/alpha/hwclock in both source and binary (compiled with glibc-2) formats. Now, why I think that /dev/rtc approach is superior. 1. Direct hardware access as practiced by /sbin/clock is getting more messy with every new supported platform. /dev/rtc is a unified interface (at least for ix86 and Alpha). The kernel has to be system specific anyway, and it's always the kernel's task to hide the system dependent stuff from userland programs. 2. /dev/rtc is the only SMP-safe way to go. I doubt that SMP-aware alternatives for cli/sti or for atomic() hack as found in Alpha version of /sbin/clock are going to be provided to user processes in a near future. 3. /sbin/clock is being phased out by the authors of util-linux package in favour of /sbin/hwclock. In my opinion, it is not worth the effort to bring the numerous Alpha specific changes (-J, -A, atomic(), /dev/port) from clock to hwclock, as compared to fixing /dev/rtc in the kernel. Staying with no longer supported /sbin/clock and watching the rest of Linux community enjoy bells and whistles of hwclock is no good either. After all, kernel interface to hardware is much cleaner than direct access from the userland, isn't it? That's how all other devices get accessed by programs. (Except for video cards.) I realise that the epoch autodetection may not really be a kernel issue, but that's the way it best fits the current scheme. Thanks. Kit -- To unsubscribe: send e-mail to axp-list-request@redhat.com with 'unsubscribe' as the subject. Do not send it to axp-list@redhat.com