Der Amiga und das Jahr-2000-Problem
Auf amiga.de wurde der Artikel über das Jahr 2000 Problem aktualisiert, leider steht nicht dabei, welcher Teil bzw. was aktualisiert wurde. Wenn jemand Infos darüber hat, was sich genau geändert, bitte ins News Forum posten.
Nachtrag 11.04.1999: Olaf Barthel schreibt im Forum: Es hat fast sechs Monate gedauert, ein Update für den ursprünglichen Y2K-Artikel veröffentlicht zu bekommen. Die überarbeitete Version korrigiert sachliche Fehler im Originaltext, berücksichtigt Informationen, die nach der Veröffentlichung des Originalartikels eingegangen sind, versucht die Problematik etwas klarer darzustellen und gibt neue Hilfestellung. Die jetzt aktuelle Version des Artikels enthält leider noch nicht die ursprünglich vorgesehenen Verweise auf aktualisierte Versionen von SetClock und dem Version-Befehl. Ich hoffe, daß das demnächst folgen wird.
Nachtrag 17.08.2017: Den Artikel, der unter amiga.de schon länger nicht mehr verfügbar ist, mit freundlicher Genehmigung von Olaf Barthel in die Meldung aufgenommen. Download-Links verweisen nun auf cloanto.com.
The Year 2000 problem and the Amiga
Written by Olaf Barthel
To make a long story short, the Amiga in general does not suffer from the
Year 2000 problem in the context known to the PC world. Still, the Amiga
faces three distinct date problems and a single, specific Year 2000 problem
with limited scope which will be described in this paper.
This document will show you how to find out if your Amiga might have a Year 2000 problem
and will then go into detail, explaining the technical aspects of the
problems and how they may be addressed.
(This is a revised version of the document of the same name which appeared
on September 20, 1998, on the Amiga, Inc. web site).
1. How to tell if an Amiga is Year 2000 compliant?
The Amiga runs under control of an operating system called AmigaOS which,
depending on the operating system version, is either fully Year 2000
compliant or may have a problem in the Year 2000. To tell which operating
system an Amiga is running you can perform a simple test. The test works
by invoking an operating system feature that is unavailable in the
operating system versions that may have a problem in the Year 2000.
For this test, hold down both the leftmost and the rightmost mouse buttons before
you switch on the computer and keep holding down both buttons until
a picture appears on your monitor.
The picture to appear should look like one of the three illustrations
shown below. Please see the description for each illustration to
find out what the pictures mean.
Figure 1: The Amiga 3000 Kickstart menu
This is a picture of the Amiga 3000 computer prompting you to choose the
operating system to use. Two principal choices are possible, you can either
use the older Kickstart version 1.3 or the newer version 2.x. On this
machine, either choice will pick an operating system version that is
Year 2000 compliant (the Amiga 3000 is not vulnerable to the SetClock
problem described in this paper since it uses a special version of
that utility). If a picture like this appears, it means that your Amiga is Year 2000
compliant.
Please note that the picture you will see on your screen need not be
completely identical to Figure 1.
Figure 2: The AmigaOS 2.0/2.1 boot menu
This picture shows an Amiga prompting you to choose the device to bootstrap
from. If a picture like this appears, it means that your Amiga is Year 2000
compliant.
Please note that the picture you will see on your screen need not be
completely identical to Figure 2.
Figure 3: The AmigaOS 3.0/3.1 boot menu
This picture shows an Amiga prompting you to choose an early startup option to change.
If a picture like this appears, it means that your Amiga is Year 2000
compliant.
Please note that the picture you will see on your screen need not be
completely identical to Figure 3.
If the picture to appear does not look like any of the three illustrations shown
above, then your Amiga is probably not entirely Year 2000 compliant. To find
out how to address the problems, see section 5 of this document.
1.1 Is the software written for the Amiga Year 2000 compliant?
Software written for the Amiga computer is not automatically
Year 2000 compliant. While the Amiga operating system provides
time and date keeping services which are Year 2000 compliant,
it was always left to the individual software developers to
use them properly. Amiga, Inc. neither supports nor maintains 3rd party application software.
2. Scope of this document
The following text refers to Amiga desktop computers built between 1986 and
1997. It covers only computer hardware configurations designed and built by
Commodore-Amiga, Inc., Amiga Technologies GmbH and Amiga, Inc. This specifically excludes 3rd party hardware
extensions, such as the Microbotics "StarBoard" which among other features offered
a battery backed up clock.
It should be noted that, as far as the ROM operating system and Amiga software
is concerned, this document only covers the features and/or shortcomings of the
Amiga operating system as designed and implemented by Commodore-Amiga, Inc.
3rd party application software designed to run under control
of the Amiga operating system may not show the same behaviour as the operating
system itself. It may show bugs which AmigaOS does not exhibit, and the other
way round.
3. How the Amiga handles date and time
The Amiga operating system has always followed the Unix model in measuring
time as the number of seconds that have elapsed since a fixed point of time.
Under AmigaOS that fixed point of time (also known as 'epoch') is 00:00:00
of January 1, 1978 (Unix uses 00:00:00 GMT, January 1, 1970). The operating
system manages time and date through a module known as
timer.device. This module reads and stores date and time information
using a data structure known as timeval which, in 'C' language notation,
is shown below:
struct timeval
{
ULONG tv_secs;
ULONG tv_micro;
};
In this context an ULONG refers to an unsigned 32 bit quantity. The
tv_secs structure member holds the number of seconds that have elapsed
since the AmigaOS epoch. The tv_micro member denotes the number of
microseconds (the 10-6th part of a second) that have elapsed since the last
second has passed.
3.1 The AmigaDOS date and time handling is special
"AmigaDOS" and "AmigaOS" are not two names for the same thing.
AmigaDOS is (in a nutshell) the name of the AmigaOS layer which
implements filing systems and their actions, the command line interpreter, and
the means to load and relocate executable binary files. AmigaDOS is
more or less a port of the Cambridge University TRIPOS 32 bit kernel. It has
its own peculiar data structures, including its own version of the timeval
structure described above. The AmigaDOS variant is known as DateStamp, as
shown below:
struct DateStamp
{
LONG ds_Days;
LONG ds_Minute;
LONG ds_Tick;
};
In this context a LONG refers to a signed 32 bit quantity. The ds_Days
member contains the number of days (each day consists of exactly 24 hours)
that have passed since the AmigaOS epoch. The ds_Minute member denotes the
number of minutes that have passed since midnight (00:00:00) of the given day.
The ds_Tick member contains the number of "ticks" that have passed
since the last minute. A minute consist of 3,000 "ticks", i.e. there are exactly 50
ticks in a second.
The term "tick" is often confused with the "tick" signals which the Amiga hardware
can generate either through the power supply or the custom chip
set. The frequency at which the hardware generates "tick" signals is controlled by
the power supply frequency (50 Hz or 60 Hz) or the jumper settings on the main
board (PAL = 50 Hz, NTSC = 60 Hz). There is no relation between the hardware "tick" signals
and the "tick" quantities used in the context of the
DateStamp data structure. For the DateStamp ds_Tick
member, there are always 50 ticks in a second, regardless of the power supply
frequency or the main board jumper settings.
AmigaDOS uses DateStamps to describe file and volume creation dates. All
shell commands follow the same model, i.e. if the system date is set through
the shell Date command, it will calculate time and date in DateStamp
format.
3.2 Local time vs GMT
The Amiga operating system never knew the concept of local and global time.
While the AmigaOS 2.1 update (1992) introduced a locale preferences editor
that allowed for the time zone to be selected, the operating system itself
never put this feature to use or encouraged application software developers
to use it. One might argue that with this background, the AmigaOS was always
tuned to local time.
3.3 How the Amiga maintains its system time
The early Amiga computer models did not support a battery backed up real time
clock that would keep ticking and maintaining local time even until after
the machine was switched off. For example, the first Amiga computer ever
(later christened the Amiga 1000) did not offer a battery backed up clock.
For the Amiga 500 the battery backed up clock was an extra hardware feature
one could buy separately with a memory expansion.
Amiga computer models without battery backed up clock hardware include:
- Amiga 500
- Amiga 600
- Amiga 1000
- Amiga 1200 (note: only a few early machines were built with battery backed up clock hardware)
Amiga computer models with battery backed up clock hardware include:
- Amiga 500+ (this is a variant of the Amiga 500)
- Amiga 2000
- Amiga 2500 (this is a variant of the Amiga 2000)
- Amiga 3000
- Amiga 3000T; also known as "Amiga 3000 Tower" or "Amiga 3000, floor standing model" (this is a variant of the Amiga 3000)
- Amiga 3500 (this is the precursor of the Amiga 3000T; only few of these machines were built)
- Amiga 4000
- Amiga 4000T; also known as "Amiga 4000 Tower" or "Amiga 4000, floor standing model" (this is a variant of the Amiga 4000)
These two lists do not mention the CDTV and CD32 devices
since these machine types do not really count as desktop computers.
On machines without battery backed up clock hardware, the Amiga sets its system time
according to the modification date of the boot volume. In other words, the
point of time the last file was modified or created on a disk would determine
the system time. As this was by no means accurate, the AmigaOS boot process
would suggest and prompt you to adjust the system date once the system had
booted (as pictured below).
Figure 4: The shell window prompting you to adjust the date
On machines equipped with battery backed up clock hardware the system time was
read during the boot process. As of AmigaOS versions 1.2 and 1.3 a special
program, called SetClock, was responsible for reading the current clock
settings and setting the system time accordingly. Starting with AmigaOS
version 2.0 that functionality was integrated into the ROM operating system,
making the SetClock utility at least in part redundant.
If the system starts up without being able to set its system time, it defaults
to 00:00:00 January 1, 1978.
4. Setting and reading the time
The Amiga offers both a command line interface and a graphical user
interface. Both went through a number of changes over the years as will be
described below.
4.1 The command line interface
There are two shell commands which deal with the system date, these being
SetClock and Date. The Date command is for reading and setting the
current system date whereas the SetClock command deals with the battery
backed up clock: it reads and stores the current system time from/in it. The
Date command is of particular interest due to the human readable date format
it uses by default. Today you might invoke the Date command and receive the
following output:
19-Sep-98
As one can see the year number is limited to two digits only. Even if a
different locale is used (e.g. french), the year will always be displayed with
its two last decimals only. Luckily, this numbering is consistent with the
following rule:
- If the number is greater than or equal to 78, the year number is 1900 plus the number given (i.e. numbers 78..99 indicate years 1978..1999).
- If the number is less than 78, the year number is 2000 plus the number given (i.e. numbers 00..77 indicate years 2000..2077).
To set the system time to any year beyond 1999, you reverse the
rule, i.e. entering date 01-jan-01 will set the time to
1 January, 2001.
All versions of the AmigaDOS Date command (version 1.1 through
version 37.1) display and parse the data format in the same
fashion. They behave consistently and predictably throughout all
Amiga operating system revisions. The same holds true for the other
two Shell commands that deal with dates, namely SetDate
and List (the List command can list files and
drawers created/modified since a specific date).
4.2 The graphical user interface
The system time is set through the preferences editor which in AmigaOS
versions 1.0-1.3 used to be a single, monolithic program as pictured below:
Figure 5: The Workbench 1.1 Preferences editor
The controls for setting the system time are located in the top left corner of
the window. They allow the last two digits of the year to be adjusted; the
model follows the AmigaDOS Date command in that a year number less than
78 denotes a year in the range 2000..2077 and all other settings refer to a
year in the range 1978..1999.
With the introduction of AmigaOS 2.0, the time preferences editor was moved
into a single program named Time, as pictured below:
Figure 6: The Workbench 2.0 Time Preferences editor
In this editor, the year can be entered as a four digit number. However, the
range is limited to the years 1978..2113.
When the AmigaOS 2.1 update was released, the time preferences editor was revised, as can be seen below:
Figure 7: The Workbench 2.1 Time Preferences editor
Just like with the previous version of the Time Preferences editor, the year can be entered as a four digit
number. In this case, the range is limited to the years 1991..2099.
5. The problems
As far as is known today, the Amiga faces four date problems. Two are design
problems caused by numeric overflow, one is caused by hardware limitations and
one is a real bug that will strike in the year 2000.
5.1 SetClock stops working in the year 2000
The Amiga Workbench disk revisions 1.2 and 1.3 would ship with a program by
the name of SetClock which was responsible for reading the battery
backed up clock time upon system startup. The SetClock program
suffers from a bug which causes it to miscalculate the battery backed up clock
time starting with the year 2000. It is accurate only for the years
1978..1999. Once the year counter rolls over to 00, SetClock will believe
that the year is 1978 until the year 2079 is reached; that's when it will
believe that the year is 1979 -- which is not necessarily an improvement.
Please note that only the SetClock program found on the AmigaOS 1.2 and 1.3
Workbench disks suffers from this problem. Several versions of this program
were distributed, each between 4,000 and 7,000 bytes in size. To tell whether
you have a version that works or not, check the file size; if it is less than
1,000 bytes in size you will probably have the properly working version (and not
one of the older versions). If it is larger than 4,000 bytes, you probably have
the faulty version. Size isn't everything, though. Some 3rd party
hardware extensions would use their own versions of the SetClock program.
They went by the same name, but read the system time from a different hardware
location. Do not replace these custom versions. You will probably
be using such a custom version if your real time clock is hooked up to a mouse
port or the keyboard connector.
A fix for this problem is provided in this archive. Download it and unpack it,
then read the enclosed SetClock_ReadMe file!
5.2 Negative time
As was outlined above, the Amiga measures time in seconds. As it turns out,
the number of seconds to accumulate until 19 January, 2046, 03:14:07 will form
the largest value a signed 32 bit integer number can hold. This is not a
problem for the time keeping module (timer.device). However, application software
and other operating system components which treat the number of seconds as a
signed quantity will get into trouble one second later: the number of seconds
will rise to 2,147,483,648 which in two's complement format represents the
negative number -2,147,483,648. AmigaDOS, which always treats time as a signed
quantity, will consider this date to be invalid because it is "negative". Worse,
the ROM date conversion routines exhibit a bug which, once the date is later
than 19 January, 2046, 03:14:07, causes all subsequent date operations to be
inaccurate. The immediate effect this has is that calculations on dates can be
off by more than two years.
This behaviour is consistent through all AmigaOS versions. A fix is not
available yet, but research is in progress to investigate whether this bug could
be fixed by updating several AmigaOS modules (locale.library, dos.library).
After all, this bug is "just" a side-effect of treating an unsigned quantity
as signed.
5.3 Time rolling over
An unsigned 32 bit integer can hold a maximum value of 4,294,967,295. When the
Amiga has accumulated that many seconds, it will be 7 February, 2114,
06:28:15. One second later the seconds counter will roll over and restart
at 0. In other words, on 7 February, 2114, 06:28:16 the Amiga will believe
that it is midnight on 1 January, 1978.
No fix for this problem is available yet.
5.4 The battery backed up clock can count only to 99
Amiga computers equipped with battery backed up real time clock hardware use one of
two different hardware designs: either the Oki MSM6242RS (A500, A2000) or the
Ricoh RP5C01 (A3000, A1200, A4000) chip. As is common with clock chips of that
type, the year counter is implemented as a two digit BCD number. Once it
reaches the year 99, the counter will roll over and start again at 00.
Starting with Amiga operating system version 2.0, the boot process will read
the battery backed up clock time and set the system time accordingly. This
takes place every time the Amiga is reset. Because the year number covers only
two digits, the same algorithm as used by the AmigaDOS Date command is
employed. Consequently, the Amiga system date set at
system startup time will always be in the range 1978..2077. While the system
clock will keep ticking beyond 31 December, 2077 a system reset will set
the clock back to 1 January, 1978.
No fix for this problem is available yet.
6. Other hazards
The following section covers topics which are related to time keeping, but not
quite in the same context as was discussed in the previous sections.
6.1 In a version tag a year only has two digits
The AmigaDOS Version command (which was introduced in AmigaOS 2.0) can extract the
version and revision numbers and the creation time of any file which includes a string
like this:
$VER: version 40.1 (9.2.93)
A string like this is called a "version tag". The date, as it appears in brackets,
consist of a day, a month and a year number (exactly in that order), none of which may contain more than two digits.
This was not such a big problem with versions 37 and 38 of the Version command,
which extracted the string and printed it verbatim. However, starting with version 39 of
the Version command, the date extracted was converted and printed using the
default locale. The conversion process involved has a major flaw in that it always takes
the year number, adds 1900 and prints the date. This is not consistent with how the Date
command treats year numbers beyond 99. In fact, in order to print properly, the year 2000 would
have to show up as the year 100 in a version tag (which is guaranteed to cause some confusion).
The problem described above exists only in version 39.1 and 40.1 of the Version command.
To find out which version of this command you have, open a Shell window and enter the following
command:
version c:version full
A fix for the date parsing problem in the Version program is provided
in this archive. Download it and unpack it,
then read the enclosed Version_ReadMe file!
6.2 Leaking clock batteries
A battery provides the necessary power to keep the battery backed up clock hardware ticking while the
Amiga computer is switched off. As time passes and the clock hardware keeps ticking, the batteries
age: some must be more than ten years old by now. Old batteries can leak acid, causing great damage
to the Amiga motherboard hardware. Often such leakages go unnoticed until critical parts of the Amiga
hardware begin to fail. Of course, once you notice it, it is probably already too late...
It has been recommended to replace the clock batteries on every Amiga main board that is more
than three years old. The batteries are small, barrel-shaped
objects about 18mm long and 15mm in diameter. They look as if they were being held between two clamps
(they are not; the batteries are soldered) and have a blue or red plastic
covering. The covering is often labeled with the name of the manufacturer (e.g. GP or Varta) and the battery
properties (3.6V, 60mAh). Also, the anode ("plus pole") should be marked clearly.
Where is that battery? Try looking for it: the battery may look like a capacitor on first glance, but
it is unique in that it appears to be held between clamps. It is larger than any capacitor on the
main board and the labeling should be unique. Here are some hints on finding the battery:
- Amiga 2000: under the drive bridge, where the floppy disk drives are mounted
- Amiga 3000: near the left edge, right in the middle of the main board
- Amiga 3000T: right below the power supply, next to the two Kickstart ROM chips
- Amiga 4000: left side of the main board, near the mouse ports; note that only older Amiga 4000 boards use the barrel-shaped nickel cadmium storage batteries, the newer boards use disk-shaped lithium batteries
You should really start worrying if corrosive salts are covering the metal casing of the battery: it should be replaced as soon as possible. Do not attempt to replace the battery on your own. You should consult a specialist, such as your nearest Amiga technical support centre.
(ps)
[Meldung: 10. Apr. 1999, 08:00] [Kommentare: 0]
[Per E-Mail versenden] [Druck-Version] [ASCII-Version]
|