[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] UTC documentation uploaded



Hi,

On Wed, Dec 06, 2000 at 11:24:48AM +0100, Petr Stehlik wrote:
> On Tue, 5 Dec 2000, Guido Flohr wrote:
> 
> > Just a proposal: I have finally had a look how other operating systems
> > that typically share a machine with non-Unix OSes handle the UTC/Localtime
> > problem. I was quite surprised to see that Linux for instance doesn't even
> > try to change the hardware clock when the system time changes.  MiNT often
> > behaves in the same way and until lately I have considered that a bug.
> > Under Linux you need a special program hwclock to write back the system
> > time to the CMOS clock.
> 
> My Linux reports "setting CMOS time" (or "setting hardware clock" or
> something close to that) when it is shutting down.

But we have no shutdown scripts for MiNT, not yet.

> > What if we would do the same in MiNT? Simply don't even try to change the
> > hardware clock but leave that task to external software.  You would still
> > use tzinit to tell the kernel whether the system clock is UTC or
> > localtime.  But the kernel would never write that back.  Instead a new
> > program - maybe hwclock - would do that.
> 
> I personally don't like that. I like to change time in XControl. Why
> couldn't you change the system clock as well? You know the offset so there
> shouldn't be any problem. Simply pass the GEMDOS time +- the offset to the
> XBIOS call.

It shouldn't be a problem but it is obviously beyond my programming
skills. ;-)

I try to do exactly what you propose, look in the kernel sources.  But it
doesn't work reliably and I am at the end of my wits now.

One advantage of the Linux or BSD solution: Imagine you have a
radio-controlled hardware clock (I was told that they are available for
Atari as well).  In that case even smarter kernel routines than mine will
fail to modify the hardware clock permanently.  If I leave the hardware
clock alone and leave it to the user to write the time back the user will
experience no problems.  Simply don't use hwclock.

Ciao

Guido