Y2K date fix for 2017?

All about the serious stuff.

Moderators: Mug UK, Zorro 2, Moderator Team

User avatar
Fujiyama
Atari Super Hero
Atari Super Hero
Posts: 574
Joined: Thu Jul 12, 2007 8:21 am
Location: Norway

Y2K date fix for 2017?

Postby Fujiyama » Mon May 08, 2017 8:50 am

Which Y2K patch will work properly with 2017 dates?

I found a page called Dallas RTC sync + TOS Y2K fix where I also downloaded Dallas RTC 1.0 from, which should include a Y2K fix valid up to 2030, and according to the readme also works as a Y2K fix even if you don't have a Dallas clock in your ST. It's called DALLRTC.PRG and goes in the AUTO folder, but doesn't appear to work with my MegaSTe (TOS 2.06) -I just created a folder and its date is shown as "47-05-08" (I expected it to show 17-05-08 of course).

As my clock battery has died and I haven't bought a new (expensive) replacement battery (and also haven't decided if I should replace the clock altogether with a button-cell based RTC module to connect to my MonSTer board, or get some other, cheaper type 3.6V battery replacement) I put a program called DATE.PRG in the AUTO folder for now (sorry, can't remember where I downloaded it from) which is to be renamed by adding the year (i.e. DATE2017.PRG), so whenever I boot/reboot I'm asked to enter the current time and date. A nice and quick way to set the time and date if you don't have a battery-backed clock or like me, the battery is dead. But obviously, without a working Y2K fix it doesn't help for anything but the time of day.

Are there other Y2K fixes I could use that actually work?
Mega STe | MonSTer with dual IDE-CF memory card adapter | STe | SM-144 |NEC Multisync 1990SXi | IDE doubler | ST_ESSC | RSVE | ICD Link II | Link '97 | HD floppy drive/AJAX | HD floppy module | Minolta PCMCIA card-drive | Realtime Clock module | Discovery cartridge | Unitor-2 | Export | Combiner | Steady Eye | Human Touch | Unicorn USB

User avatar
troed
Atari God
Atari God
Posts: 1179
Joined: Mon Apr 30, 2012 6:20 pm
Location: Sweden

Re: Y2K date fix for 2017?

Postby troed » Mon May 08, 2017 12:57 pm

My fix works fine ;) (The DallRTC program). Since it works by winding and rewinding the date with 30 years, you need to first set the date to 1987 _with the fix not loaded_. After that, put the fix in your auto or bootsector - the date will then become +30, that is, 2017.

(This works fine on both my own Mega STE and a friends. For those who have the Dallas RTC and don't use the control panel to set the date you can have the fix loaded when setting the date as well).

I should update that post with the info for non-Dallas use cases.

/Troed

User avatar
Fujiyama
Atari Super Hero
Atari Super Hero
Posts: 574
Joined: Thu Jul 12, 2007 8:21 am
Location: Norway

Re: Y2K date fix for 2017?

Postby Fujiyama » Wed May 10, 2017 7:36 am

You're right -it works!
For some reason the time changed to 1989, but it might just be that some capacitor inside the ST (partly) kept the time between each power cycle when testing.

So for now, until I get a new battery (or clock module) I've got a time-setter program called TIME22.PRG in the AUTO folder (I don't know if DATE2017.PRG (DATE.PRG) to set the correct time and date was the reason for the above problems) to set the correct time/date, but with 1987 instead of 2017, then manually run DALLRTC.PRG (which will as you say, correct 1987 to 2017).
I also put LEDPANEL.PRG in the AUTO folder and configured it so it'll show the time and date in the upper right hand corner of the screen. Nice!
Things will get a little easier when the clock gets battery-backed up :wink:

Yes, please do add the correct procedure to the Readme file. Thanks.
Mega STe | MonSTer with dual IDE-CF memory card adapter | STe | SM-144 |NEC Multisync 1990SXi | IDE doubler | ST_ESSC | RSVE | ICD Link II | Link '97 | HD floppy drive/AJAX | HD floppy module | Minolta PCMCIA card-drive | Realtime Clock module | Discovery cartridge | Unitor-2 | Export | Combiner | Steady Eye | Human Touch | Unicorn USB

joska
Hardware Guru
Hardware Guru
Posts: 3574
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway
Contact:

Re: Y2K date fix for 2017?

Postby joska » Wed May 10, 2017 8:23 am

Fujiyama wrote:Are there other Y2K fixes I could use that actually work?


I've done a binary patch to TOS itself. Tested with 1.04, 1.06 and 2.06 on ST's with and without RTC. With this patch there is no need for any autofolder programs.

I don't remember the details now, but if there's any interest I can have a look at my notes tonight.
Jo Even

Firebee - Falcon060 - Milan060 - Falcon040 - MIST - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64

User avatar
Fujiyama
Atari Super Hero
Atari Super Hero
Posts: 574
Joined: Thu Jul 12, 2007 8:21 am
Location: Norway

Re: Y2K date fix for 2017?

Postby Fujiyama » Wed May 10, 2017 8:48 am

Yes, definitely interested!
For TOS 2.06, have you added any other patches as well? Now that my MonSTer is working I'm ready to load TOS into its flash memory.

Troed: silly me... why make it complicated? I just put DALLRTC.PRG in the AUTO folder, so now (using AUTOSORT) I've rearranged it to first run TIME22.PRG followed by DALLRTC.PRG. When I get the clock battery (or new RTC module) I won't need TIME22.PRG.
I also made nice boot-floppy with the same programs with the addition of HDDRIVER.PRG (running first).
Mega STe | MonSTer with dual IDE-CF memory card adapter | STe | SM-144 |NEC Multisync 1990SXi | IDE doubler | ST_ESSC | RSVE | ICD Link II | Link '97 | HD floppy drive/AJAX | HD floppy module | Minolta PCMCIA card-drive | Realtime Clock module | Discovery cartridge | Unitor-2 | Export | Combiner | Steady Eye | Human Touch | Unicorn USB

joska
Hardware Guru
Hardware Guru
Posts: 3574
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway
Contact:

Re: Y2K date fix for 2017?

Postby joska » Wed May 10, 2017 9:25 am

Fujiyama wrote:Yes, definitely interested!


I actually found it in my dropbox :)

Code: Select all

/*

Y2K-patch for TOS 1.04, 1.06, 1.62 and 2.06
Jo Even Skarstein 2016 ->

Problem:
  GEMDOS and XBIOS epoch is 1980. The year-part in all
  dates is an offset from this.
  XBIOS use the keyboard clock to store date/time between
  reboots. This clock only handles two digit years, and
  TOS store the two least significant digits of the YEAR
  in this clock. Not the offset, but the actual year.
  Since the ST was made in 84/85, they simply added 80
  to the GEMDOS year before passing it to the keyboard.
  This works fine until year 2000. 00+80 is not 2000...
  Likewise when reading from the keyboard, GEMDOS year is
  keyboard year - 80. Does not work well after 2000.
 
  This fix simply removes the 80 offset, so the two least
  significant digits of the GEMDOS year is stored in the
  keyboard. This is good until 2080.
 
  Please note that this problem does not affect machines
  with an RTC, i.e. the Mega ST, Mega STE and Stacy. Applying
  this fix won't hurt, but won't be of any use on either of
  these machines.

*/


See attached archive. It contains two programs. y2ktest.prg sets both XBIOS and GEMDOS time to 1/1-2016 and then reads it back. Run this program without *any* y2k-related patches in your auto-folder. If both XBIOS and GEMDOS time reads back 1/1-2016, then your machine does not have the y2k-problem. If it reads back the wrong year, then run your TOS image through y2kpatch.ttp and flash the resulting "patched.img". Reboot to the patched TOS and run y2ktest.prg again.

Y2KPATCH.zip


This patch was tested on 520STM (no RTC) with 1.04 and 2.06, STE (no RTC) with 1.06, 1.62 and 2.06 and Mega ST (RTC) with 1.04 and 2.06. Please note that when I say "RTC" I mean the stock Atari RTC as used in the Mega, Mega STE and Stacy.

Fujiyama wrote:For TOS 2.06, have you added any other patches as well? Now that my MonSTer is working I'm ready to load TOS into its flash memory.


I have an unreleased version of the flash-tool that can do some simple TOS patches when flashing TOS. The Y2K-fix is one of them. It can also replace the boot-logo in 2.06 with a user-defined image (PI3 file).
You do not have the required permissions to view the files attached to this post.
Jo Even

Firebee - Falcon060 - Milan060 - Falcon040 - MIST - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64

joska
Hardware Guru
Hardware Guru
Posts: 3574
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway
Contact:

Re: Y2K date fix for 2017?

Postby joska » Wed May 10, 2017 9:49 am

Fujiyama wrote:As my clock battery has died and I haven't bought a new (expensive) replacement battery (and also haven't decided if I should replace the clock altogether with a button-cell based RTC module to connect to my MonSTer board, or get some other, cheaper type 3.6V battery replacement) I put a program called DATE.PRG in the AUTO folder for now (sorry, can't remember where I downloaded it from) which is to be renamed by adding the year (i.e. DATE2017.PRG), so whenever I boot/reboot I'm asked to enter the current time and date. A nice and quick way to set the time and date if you don't have a battery-backed clock or like me, the battery is dead. But obviously, without a working Y2K fix it doesn't help for anything but the time of day.


Even with a dead RTC battery your Mega STE should not suffer from the Y2K-problem. The IKBD clock is not used by TOS on the Mega STE. I think it's your time setting tool that fools you here.
Jo Even

Firebee - Falcon060 - Milan060 - Falcon040 - MIST - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64

User avatar
Fujiyama
Atari Super Hero
Atari Super Hero
Posts: 574
Joined: Thu Jul 12, 2007 8:21 am
Location: Norway

Re: Y2K date fix for 2017?

Postby Fujiyama » Sun Sep 24, 2017 3:27 pm

joska wrote:
Fujiyama wrote:Yes, definitely interested!


See attached archive. It contains two programs. y2ktest.prg sets both XBIOS and GEMDOS time to 1/1-2016 and then reads it back. Run this program without *any* y2k-related patches in your auto-folder. If both XBIOS and GEMDOS time reads back 1/1-2016, then your machine does not have the y2k-problem. If it reads back the wrong year, then run your TOS image through y2kpatch.ttp and flash the resulting "patched.img". Reboot to the patched TOS and run y2ktest.prg again.


You're right! With a working Mega STe I tried it there (with no Y2K related software) and both XBIOS and GEMDOS values show the same right after powering up the computer. But If I set the date/time (using the Xcontrol accessory) the first line "Get XBIOS date" differs, showing the actual year/month/day instead of just 2016, 1, 1. If I run "Y2KTEST.PRG" again it's reset to 2016, 1, 1 like the rest.

With the DS3231-based RTC module attached to the MonSTer (its battery is a standard coin cell which is cheaper to replace than the lithium battery of the Mega STe clock) the result is a little different. After powering up the computer all the values of Y2KTEST.PRG are the same (2016, 1, 1) except for the first line which shows:

GET XBIOS DATE: 1980 + >14< = 1994, month = 1, day = 1

But it appears to work fine. I've set the date/time with XCONTROL.ACC, turned off the computer for a while and the time has been shown correctly when powering up again. The date/time stamp of creating some new folders also looks fine.
UPDATE: I had powered turned off for about 5 minutes but when booting up the date had changed to 00-09-95 while the clock had no relation with the current time (it showed 15:11). The clock battery is brand new, so this is strange.
Could it be due to a conflict between the internal Mega STe clock and the RTC module attached to the MonSTer, or more likely something else?
I almost forgot that there's a MonSTer RTC program for setting the date/time, which I didn't try for this. Is this a special time-setter which differs from setting the time with say the Xcontrol accessory as it handles specifically those RTC modules, and no other software should be used for that, or are they all the same?
I'll look further into the pullup resistors discussed in that other thread, though for another RTC module.

When I figure that out, next is getting the STe out and trying out the clock there as well (I have a battery-backed clock board from way back in the early 90s plugged into one of the TOS EPROM sockets, with the TOS chip on top of it). From what I understand things won't go that smoothly there though.

joska wrote:
Fujiyama wrote:For TOS 2.06, have you added any other patches as well? Now that my MonSTer is working I'm ready to load TOS into its flash memory.


I have an unreleased version of the flash-tool that can do some simple TOS patches when flashing TOS. The Y2K-fix is one of them. It can also replace the boot-logo in 2.06 with a user-defined image (PI3 file).


Will this flash tool be released soon, replacing the existing MonSTer download?
I have yet to try flashing the board with TOS. Currently I'm still using the two EPROMs on the motherboard for TOS (the "FLASHON" jumper on the MonSTer board is in place/enabled).
Mega STe | MonSTer with dual IDE-CF memory card adapter | STe | SM-144 |NEC Multisync 1990SXi | IDE doubler | ST_ESSC | RSVE | ICD Link II | Link '97 | HD floppy drive/AJAX | HD floppy module | Minolta PCMCIA card-drive | Realtime Clock module | Discovery cartridge | Unitor-2 | Export | Combiner | Steady Eye | Human Touch | Unicorn USB


Social Media

     

Return to “Applications”

Who is online

Users browsing this forum: No registered users and 1 guest