Click Here
home features news forums classifieds faqs links search
6071 members 
Amiga Q&A /  Free for All /  Emulation /  Gaming / (Latest Posts)
Login

Nickname

Password

Lost Password?

Don't have an account yet?
Register now!

Support Amigaworld.net
Your support is needed and is appreciated as Amigaworld.net is primarily dependent upon the support of its users.
Donate

Menu
Main sections
» Home
» Features
» News
» Forums
» Classifieds
» Links
» Downloads
Extras
» OS4 Zone
» IRC Network
» AmigaWorld Radio
» Newsfeed
» Top Members
» Amiga Dealers
Information
» About Us
» FAQs
» Advertise
» Polls
» Terms of Service
» Search

IRC Channel
Server: irc.amigaworld.net
Ports: 1024,5555, 6665-6669
SSL port: 6697
Channel: #Amigaworld
Channel Policy and Guidelines

Who's Online
26 crawler(s) on-line.
 144 guest(s) on-line.
 0 member(s) on-line.



You are an anonymous user.
Register Now!
 Gunnar:  6 mins ago
 zipper:  31 mins ago
 Templario:  37 mins ago
 NutsAboutAmiga:  51 mins ago
 RobertB:  57 mins ago
 GPTNederlands:  1 hr 12 mins ago
 janelancy:  1 hr 13 mins ago
 -Sam-:  1 hr 22 mins ago
 OlafS25:  2 hrs 4 mins ago
 pixie:  2 hrs 5 mins ago

/  Forum Index
   /  Amiga OS4.x \ Workbench 4.x
      /  Is AmigaOS 4.1 Y2K38 compliant?
Register To Post

PosterThread
drHirudo 
Is AmigaOS 4.1 Y2K38 compliant?
Posted on 20-Sep-2008 6:24:12
#1 ]
Super Member
Joined: 26-Apr-2004
Posts: 1113
From: Sofia

Hello,
I noticed that now with AmigaOS 4.1 you can set the date up to December 31st 2099. Does that mean that after January 19, 2038 AmigaOS 4.x will not have any problems? How they solved it. Did they extend the time_t variable to 64-bit or some other trick? Many games use the time_t to get pretty random seed, which would mean that they may became unplayable after 2038. One more reason to switch from older AmigaOSes to AmigaOS 4.1, heh.

_________________
Games, programs, reviews

 Status: Offline
Profile     Report this post  
salass00 
Re: Is AmigaOS 4.1 Y2K38 compliant?
Posted on 20-Sep-2008 7:42:03
#2 ]
Elite Member
Joined: 31-Oct-2003
Posts: 2707
From: Finland

@drHirudo

Why do you think it will run out 2038? AmigaOS uses a 32-bit unsigned integer for counting seconds since 1970 (IIRC or was it slightly later?).

The largest number a 32-bit unsigned integer can hold:
2^32 - 1 = 4294967295

1970 + (4294967295 / (60 * 60 * 24 * 365)) = 2106

Only if it used a signed integer would it run out at about 2038...

Last edited by salass00 on 20-Sep-2008 at 07:46 AM.
Last edited by salass00 on 20-Sep-2008 at 07:42 AM.

 Status: Offline
Profile     Report this post  
xeron 
Re: Is AmigaOS 4.1 Y2K38 compliant?
Posted on 20-Sep-2008 8:20:55
#3 ]
Elite Member
Joined: 22-Jun-2003
Posts: 2440
From: Weston-Super-Mare, Somerset, England, UK, Europe, Earth, The Milky Way, The Universe

@salass00

The AmigaOS epoch is 1st of January 1978.

DOS timestamps go really far into the future since it has a 32bit number for days since 1st Jan 1978, one for minutes past midnight and another for "ticks" into the current minute (1/50th of a second per tick).

For some reason, those are signed (but i think negative values are invalid), so you have

2147483647 days + 2146483647 minutes + 2146483647 ticks before you run out.

Unfortunately, not everywhere in AmigaOS uses datestamps, so some things will have trouble after 1st Jan 1978 + 4294967295 seconds.

Last edited by xeron on 20-Sep-2008 at 08:24 AM.
Last edited by xeron on 20-Sep-2008 at 08:24 AM.

_________________
Playstation Network ID: xeron6

 Status: Offline
Profile     Report this post  
Kotler 
Re: Is AmigaOS 4.1 Y2K38 compliant?
Posted on 20-Sep-2008 9:25:02
#4 ]
Regular Member
Joined: 27-May-2005
Posts: 255
From: Sweden


Will amigas really be in use in 30 years? I wonder...

 Status: Offline
Profile     Report this post  
Deniil715 
Re: Is AmigaOS 4.1 Y2K38 compliant?
Posted on 20-Sep-2008 10:55:18
#5 ]
Elite Member
Joined: 14-May-2003
Posts: 4236
From: Sweden

@salass00

Quote:
Only if it used a signed integer would it run out at about 2038...


It does use a signed integer.

The DOS timestamp is one thing, but the battclock.resource uses seconds that it delivers in a signed 32-bit int and it will run out in 2038.

If it were to be retyped into an unsigned int (why this hasn't happened is a big mystery for me) we would double the time to 21xx something.

EDIT:
I seem to be wrong here! battclock.resource/ReadBattClock does return an ULONG so we are fine until 21xx

So where do people get that 2038 is the limit in that case..?? I know I must have got it from AmigaE which does not have an unsigned long int type, only signed.

Last edited by Deniil715 on 20-Sep-2008 at 10:58 AM.

_________________
- Don't get fooled by my avatar, I'm not like that (anymore, mostly... maybe only sometimes)
> Amiga Classic and OS4 developer for OnyxSoft.

 Status: Offline
Profile     Report this post  
Swisso 
Re: Is AmigaOS 4.1 Y2K38 compliant?
Posted on 20-Sep-2008 12:28:28
#6 ]
Regular Member
Joined: 13-Mar-2004
Posts: 211
From: Bournemouth

@Kotler
I hope so, I for one don't intend letting go of my A1XE. Whether it will still be running then is another story.

_________________
Swisso Bournemouth A1XEG4 1.3Ghz 7457 CPU

er....CDTV!

 Status: Offline
Profile     Report this post  
Swisso 
Re: Is AmigaOS 4.1 Y2K38 compliant?
Posted on 20-Sep-2008 12:29:34
#7 ]
Regular Member
Joined: 13-Mar-2004
Posts: 211
From: Bournemouth

@Deniil715 Then when that runs out you can always set your time prefs back to 1978 and start all over again

_________________
Swisso Bournemouth A1XEG4 1.3Ghz 7457 CPU

er....CDTV!

 Status: Offline
Profile     Report this post  
OldFart 
Re: Is AmigaOS 4.1 Y2K38 compliant?
Posted on 20-Sep-2008 12:55:33
#8 ]
Elite Member
Joined: 12-Sep-2004
Posts: 3059
From: Stad; en d'r is moar ain stad en da's Stad. Makkelk zat!

@Kotler

Quote:
Will amigas really be in use in 30 years?

They call them 'Classics' then...

OldFart

_________________
More then three levels of indigestion and you're scroomed!

 Status: Offline
Profile     Report this post  
_Steve_ 
Re: Is AmigaOS 4.1 Y2K38 compliant?
Posted on 20-Sep-2008 14:14:14
#9 ]
Team Member
Joined: 17-Oct-2002
Posts: 6807
From: UK

@Deniil715

Quote:
So where do people get that 2038 is the limit in that case..??


Windows

_________________
Test sig (new)

 Status: Offline
Profile     Report this post  
Thematic 
Re: Is AmigaOS 4.1 Y2K38 compliant?
Posted on 20-Sep-2008 14:24:39
#10 ]
Super Member
Joined: 28-Oct-2003
Posts: 1616
From: I'm actually flying into a bug!

2038 bug

A portion of Amiga software uses runtime libraries that would be affected.

_________________
: AmigaOneXE (unmod.) 750FX/512 MB +stuff & AmigaOS 4.(0|1)
: A1200/68060&96MB/SCSI/EM1200-Voodoo3 & OS 3.5
: A500/1MB
: Pegasos (ff) 512 MB & MorphOS
Praise seitan.

 Status: Offline
Profile     Report this post  
Hans 
Re: Is AmigaOS 4.1 Y2K38 compliant?
Posted on 20-Sep-2008 14:52:17
#11 ]
Elite Member
Joined: 27-Dec-2003
Posts: 5066
From: New Zealand

@drHirudo

Time to switch to using a 64-bit integer I think. I challenge people to calculate the date and time at which that will expire.

Hans

_________________
http://hdrlab.org.nz/ - Amiga OS 4 projects, programming articles and more. Home of the RadeonHD driver for Amiga OS 4.x project.
https://keasigmadelta.com/ - More of my work.

 Status: Offline
Profile     Report this post  
AmigaPhil 
Re: Is AmigaOS 4.1 Y2K38 compliant?
Posted on 20-Sep-2008 15:21:08
#12 ]
Cult Member
Joined: 21-Jan-2005
Posts: 563
From: Earth (Belgium)

After 9th September 2009, ARexx scripts dealing with dates might behave strangely without a "NUMERIC DIGITS 10" statement, as the number of seconds since 1978 will have more than the 9 digits ARexx can handle by default. (Cf.
this post.)

 Status: Offline
Profile     Report this post  
nbache 
Re: Is AmigaOS 4.1 Y2K38 compliant?
Posted on 20-Sep-2008 17:48:21
#13 ]
Super Member
Joined: 8-Apr-2003
Posts: 1034
From: Copenhagen, Denmark

@thread
Back in 1998 (I think), Olsen fixed the Amiga's most pressing Y2K problems. He also wrote an analysis of the various other calendar-related limitations, which could be found on Amiga.com in the years after that. It may be gone now, at least it is not where it once was. I don't know if somebody has seen it living elsewhere?

Best regards,

Niels

 Status: Offline
Profile     Report this post  
Kotler 
Re: Is AmigaOS 4.1 Y2K38 compliant?
Posted on 20-Sep-2008 20:49:01
#14 ]
Regular Member
Joined: 27-May-2005
Posts: 255
From: Sweden

@nbache

Yes, I do remember that article also. I thought it was an interesting read.

I had a look, and found it Wayback Machine.
http://web.archive.org/web/19981203142814/http://www.amiga.com/092098-y2k.html

For easy access, I pasted the article below. I hope it's OK.

It would be most interesting to see hear from Olsen how many of the "No fix is available for this yet" have been fixed with the recent revisions of AmigaOS.


"The Year 2000 problem and the Amiga"
Written by Olaf Barthel • © Copyright 1998 Amiga, Inc.


The Year 2000 problem and the Amiga
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. However, the Amiga faces three distinct date problems and a single, specific Year 2000 problem with limited scope which will be described below.

1. Scope of this document
The following text refers to Amiga desktop computers built between 1986 and 1997 and only covers computer hardware configurations designed and built by Commodore-Amiga, Inc. This specifically excludes 3rd party hardware extensions, such as the Microbotics "StarBoard" which among other features offered a battery backed up clock, but it includes Amiga computers built by Amiga Technologies GmbH and Amiga, Inc.

2. 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 central component known as timer.device. This component 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 and the tv_micro member denotes the number of microseconds (the 10-9th part of a second) that have elapsed since the last second has passed.

Until AmigaOS 2.0 was introduced in 1989/1990 the operating system only provided the methods for time keeping but did not offer any means to convert the number of seconds elapsed since the AmigaOS epoch into human readable format. This work was left to application software developers who implemented different conversion algorithms with varying success.

2.1 The AmigaDOS date and time handling is special
"AmigaDOS" and "AmigaOS" are not two names for the same thing. Exactly the opposite is true: AmigaDOS is (in a nutshell) the name of the AmigaOS layer which implements filing systems and their actions, the command line interpreter and which handles loading and relocation of 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 flavour 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 and 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 50 ticks in a second.

AmigaDOS uses DateStamps to describe file and volume creation dates, and 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.

2.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.

2.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 on 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 had to buy separately with a memory expansion. The Amiga 2000 and (with the exception of the Amiga 600 and Amiga 500+ models) all models to follow did feature a built-in battery backed up clock.

On machines without battery backed up clocks, 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).



With machines that featured battery backed up clocks, 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.

3. 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.

3.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 year number is greater than or equal to 78, the year is 1900 plus the number given (i.e. numbers 78..99 indicate years 1978..1999).
If the year number is smaller 78, the year 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.

3.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:



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 smaller 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:



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:



Just like with its predecessor, the year can be entered as a four digit number. In this case, the range is limited to the years 1991..2099.

4. 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.

4.1 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 will hold. This is not a problem for the time keeping module (timer.device), but 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 may 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.

4.2 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.

4.3 The battery backed up clock can count only to 99
Amiga computers that feature a battery backed up real time clock 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 with 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. The consequence this has is that the Amiga system date set at system startup time will always be in the range 1978..2077. While the system clock will keep on 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.

4.4 SetClock stops working in the year 2000
The SetClock program shipped with the Amiga Workbench disk revisions 1.2 and 1.3 exhibits 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. If it is larger than 4,000 bytes, you probably have the faulty version.

A fix for this problem is provided in this archive. Download it and unpack it, then read the enclosed SetClock_ReadMe file.

 Status: Offline
Profile     Report this post  

[ home ][ about us ][ privacy ] [ forums ][ classifieds ] [ links ][ news archive ] [ link to us ][ user account ]
Copyright (C) 2000 - 2019 Amigaworld.net.
Amigaworld.net was originally founded by David Doyle