[comp.sys.atari.st.tech] Setting a 2000 year date *HELP*

rosenkra@convex.com (William Rosencranz) (01/09/91)

---
stupid question: why is setting the date in the next millenium of any
importance now? do u really expect to be using TOS 10 years from now?
i don't even think much of the software available now will even be
around in 10 years, including TOS. 10 years from now u will be using
a 64-bit/64MB/50Mhz/unix(?) system that'll cost u $500 in 1990 dollars...

maybe u should explain what u are doing. there may be a better solution.

-bill
rosenkra@convex.com

--
Bill Rosenkranz            |UUCP: {uunet,texsun}!convex!c1yankee!rosenkra
Convex Computer Corp.      |ARPA: rosenkra%c1yankee@convex.com

rosenkra@convex.com (William Rosencranz) (01/09/91)

---
i just checked out an ST version of unix date(1) i wrote. it correctly
sets the date on a mega4 (tos 1.2). however, i needed to do 2 things:

	1) call GEMDOS Tsettime/Tsetdate to tell GEMDOS of the change
	2) call XBIOS Settime/Setdate to tell the ikbd of the change
	   (Tset* does NOT do this).

you need to do both as far as i can tell. at any rate, it does not seem
to hurt. maybe apratt can elucidate...

try that. if u insist, i can mail u the src for this program...

-bill
rosenkra@convex.com

--
Bill Rosenkranz            |UUCP: {uunet,texsun}!convex!c1yankee!rosenkra
Convex Computer Corp.      |ARPA: rosenkra%c1yankee@convex.com

Roger.Sheppard@bbs.actrix.gen.nz (01/10/91)

<1991Jan09.012718.16813@convex.com>
Sender: 
Followup-To: 
Distribution:world
Organization: Actrix Information Exchange, Wellington, New Zealand
Keywords: 
Comment-To: rosenkra@convex.com
 
In article <1991Jan09.012718.16813@convex.com> rosenkra@convex.com
(William Rosencranz) writes:
> 
> ---
> stupid question: why is setting the date in the next millenium of any
> importance now? do u really expect to be using TOS 10 years from now?
> i don't even think much of the software available now will even be
> around in 10 years, including TOS. 10 years from now u will be using
> a 64-bit/64MB/50Mhz/unix(?) system that'll cost u $500 in 1990
dollars...
> 
> maybe u should explain what u are doing. there may be a better
solution.
> 
> -bill
> rosenkra@convex.com
> 
> --
> Bill Rosenkranz            |UUCP:
{uunet,texsun}!convex!c1yankee!rosenkra
> Convex Computer Corp.      |ARPA: rosenkra%c1yankee@convex.com
 
Some people like to think that there machines will last forever, there
are some funny things with the Date Commands, that is why there are a
lot of Date setting programs, by the way you seem to be of the same
opinion, will Unix last that long, I thought it was allready dead !!
by the way I vote for ZIP, :-)
 
-- 
Roger W. Sheppard   85 Donovan Rd, Kapiti New Zealand...

alex@hpgnd.grenoble.hp.com (Alexis MERMET-GRANDFILLES) (01/11/91)

Hello,

Please send flames to /dev/null.

Some people has been using apple for near 10 years. Why ST or TT machines
should not still be appreciated as home computers in 9 years.

Back to our problem:
-------------------

1)

TOS 1.6 has corrected a early TOS bug that was :
Any change to the GEMDOS clock was not forwarded to the keyboard internal
clock.

This now works on my TOS 1.62 . If I call a (GEMDOS) TSetTime() , I can
retreive the value I put by calling a (BIOS) gettime().


2)

But my problem is different. Everythings works well if the date is before 2000.
If I try to set a date after the 2000 year , the GEMDOS seems to accept
the request , then it tries to forward it to the keyboard clock which seems
to refuse it. Then the GEMDOS clock is set back to the previous value it had.


Actually, If a program sets a 2000 year date with Tsettime() ,then gets the 
date with a Tgettime() call, the Tgettime() returns the correct 2000 year date!

But then, if you quits it, return to the desktop
and run a little program that read the date, you get the previous value ???

Strange isn't it.

Atari users, is it reproducable on your systems ? on the TT ?

I am wondering if this may be a side effect of any French adaptation of the
TOS.

Alexis MERMET.

wilson (Paul Wilson) (01/15/91)

In article <17750005@hpgnd.grenoble.hp.com> alex@hpgnd.grenoble.hp.com (Alexis MERMET-GRANDFILLES) writes:
>Hello,
>
>Please send flames to /dev/null.
         .
         .
         .
>
>
>2)
>
>But my problem is different. Everythings works well if the date is before 2000.
>If I try to set a date after the 2000 year , the GEMDOS seems to accept
>the request , then it tries to forward it to the keyboard clock which seems
>to refuse it. Then the GEMDOS clock is set back to the previous value it had.
>
>
>Actually, If a program sets a 2000 year date with Tsettime() ,then gets the 
>date with a Tgettime() call, the Tgettime() returns the correct 2000 year date!
>
>But then, if you quits it, return to the desktop
>and run a little program that read the date, you get the previous value ???
>
>Strange isn't it.
>
>Atari users, is it reproducable on your systems ? on the TT ?
>
I have seen something similar on TOS 1.4 on my system. However, at the time
I was not all that concerned about it so I did not investigate it as thoroughly
as you have. From what you describe, I believe that the problem that I saw
is the same one.

Paul Wilson

Bang path: ...!uunet!van-bc!mdivax1!wilson
Compuserve: 72057,2374

apratt@atari.UUCP (Allan Pratt) (01/15/91)

I assure you it has nothing to do with being in France.  The countries
that we do ROMs for get their ROMs from headquarters, and there are no
differences in low-level time handling.

I have just done some research on the clock handling, and I think
you're  right: if you don't have a clock chip in your system (i.e. not
a Mega ST or Mega STe or TT) then the keyboard clock is regarded as the
most correct one, and it uses the "last two digits of the year" method
of keeping time.  This is too bad.  If you have a clock chip, either
the kind in the Mega ST and Mega STe (from Ricoh) or the kind in the TT
(from Motorola), then your IKBD clock is never used, and this problem
does not arise.  Also, of course, if you have some third-party clock
chip and a TSR that intercepts the Xbios Settime/Gettime calls, you
won't have this problem.  

Sorry I blew you off earlier: I forgot that there was so much variation
in timekeeping in the Atari computer line.

It is certainly possible to fix this in the BIOS or with a TSR, but
I don't think it'll be a priority for 9 years or so :-)

============================================
Opinions expressed above do not necessarily	-- Allan Pratt, Atari Corp.
reflect those of Atari Corp. or anyone else.	  ...ames!atari!apratt

hvaalde@cs.vu.nl (Aalderen van Harold) (01/16/91)

I checked the problem on my computer 1040STf running TOS 1.0 11/20/1985 and
on a 1040STE running TOS 1.6 (don't know the date)

As Allan Pratt stated the problem lies entirly in reading the year byte
from the keyboard clock what happens is the following

The 'clockvec' vector from the Kbdvbase structure reads the year byte
from the keyboard procsessor 
It is converted from BCD format to normal binary form
an offset of 80 is substracted which ofcourse is correct if the year was between
80-99 but is wrong for years from 00-79
in this case one should add an offset of 20
if you don't you have a very wrong year number which according to the GEMDOS
format indicates the year 2028

A simular bug is in the Settime code when writing the year byte to the keyboard


I am trying to write a patch for it and a small test program which shows the
problem, but I don not have much time so it is coming slowly.
One problem I have is the fact that I must use undocumented and ROM depend
addresses

If some one wants to help me, please email me (hvaalde@cs.vu.nl)

Harold van Aalderen , Vrije Universiteit Amsterdam

rlcollins@miavx1.acs.muohio.edu (Ryan 'Gozar' Collins) (01/17/91)

In article <2808@atari.UUCP>, apratt@atari.UUCP (Allan Pratt) writes:
> I have just done some research on the clock handling, and I think
> you're  right: if you don't have a clock chip in your system (i.e. not
> a Mega ST or Mega STe or TT) then the keyboard clock is regarded as the
> most correct one, and it uses the "last two digits of the year" method
> of keeping time.  This is too bad.  If you have a clock chip, either

I remember reading something about this awhile ago. But form what I 
remember, the way it was supposed to work was that any number less than 85 
was supposed to be 20xx (i.e. 2084) and any number between 85 and 99 to be 
19xx. (the number being the two digits from the keyboard regarding year.) 
But TOS would be able to figure out the correct date, maybe the code has 
changed from 1.0 - 1.62 somewhere along the line?

~~~~~~~~~~~~~~~~~~~~~~~~~ Ryan 'Gozar' Collins ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            o__)\			     rlcollins@miavx1.BITNET
           /     )			      RC1DSANU@miamiu.acs.muohio.edu
          /     /  ____                       R.COLLINS1  (On GEnie)
         /(____/__(_) o)_/
                      /)			[ || ]   Atari Computers,
      "There is no Substitute."                 [ || ]    They're not just
 Vs lbh pna ernq guvf, lbh'er geniryvat        // || \\   for breakfast 
            gbb pybfr!                        //  ||  \\  anymore
~~~~~~~~~~~~~~~~~~~~~~Yea, right, thats what I said.~~~~~~~~~~~~~~~~~~~~~~~~~