Year 2000 on a PC and the BIOS
 Peter M DeVita, P.Eng.
 DeVita Associates

Phone: 905-784-4400; Fax: 905-784-4404



Contents:

Abstract:
Year 2000 - why the fuss?
Getting More Specific - Large Machines or PC's
The PC problems
How the BIOS works
User to Hardware link via BIOS
Details
Memory map for vectoring of INT 1Ah
The Fix for PC's
Fixing Older BIOS's
Conclusion:
References:
About the Author and Company:
CMOS locations
Some INT 1Ah Functions
Appendix
AMIDate Guide
Operation and Installation
AMIDate Card Layout
Installing AMIDate

Abstract:
This paper will look at the details of the BIOS operation and how the
year 2000 problem occurs on a PC. Some of the broader issues of board design and BIOS interaction will be presented to provide the attendees a perspective on what are practical changes. The details of how a Personal Computer 'ticks' will be examined. The AMIDATE board operation will be described as a hardware solution to the Y2K issue for older PC's.

Year 2000 - why the fuss?
For a few years now, we have been warned about the coming computer disasters due to the year 2000. At the heart of this problem is the fact that in the early days of computers, memory was expensive and therefore was to be used sparingly. Given this climate, the 'good' programers of the day were praised for doing much with little code (getting back to some this today would not be so bad!). Hence, using 2 digits instead of 4 digits saved space, especially since dates are used very often, so that saving these two bytes of data was multiplied many times.

In the 1960's, 70' and even the 80's, this was not really a big deal. However, today we find ourselves with a great deal of older code still in use with the 2 digit short form.

The problem is that a computer will not automatically know the difference between 00 being 2000 or 1900 or any other millennia! A calculation of interest rates on Jan 1, 2000 might be a 100 years out. This would clearly make a mess of the accounts. Ages could also be out of wack, so that computers that remove all over an age limit would loose a number of members.

Though the problem is rather simple, it gets very complex to find all the specific code instances in which dates are used. Some one needs to go through the code with a fine comb to correct all the code.

 
Getting More Specific - Large Machines or PC's

Actually the problem needs to be split into the kind of computer, hardware versus software and the kind of software.
In the 1960's the PC did not exist. So it does not have the same kind of problems that the larger machines do. Furthermore, large machines tend to have multiple users with sophisticated, custom written software. PC's on the other hand are more likely to be single user systems (certainly the older ones). The PC software tends to be off-the -shelf rather than custom.
 

Hardware type

Custom Software

Semi-Custom

Off-the-Shelf

Large Systems

a

b

c

PC's

d

e

f

 (a) represents the most costly to fix, while (f) is the least.
 

The Large Systems tend to have custom software. Hence they have a BIG problem. The PC's having off-the-shelf software, have a much less expensive problem which is most likely resolved by the vendors of the software.

Large Systems have a custom issue to worry about and therefore will not be considered further herein.
 


The PC problems

 The problem in the PC can be broken down into two parts. The first part already discussed above deals with the software. If you are using custom software then you have a 'Large Problem'. Semi-custom (typically, a modified off-the-shelf package) will have similar problems as the custom software. The Off-the-Shelf software problem comes down to buying the Y2000 version or update of the product.

The second part of the problem deals with the 'BIOS' and is our main focus of attention. The BIOS is the first piece of code that is executed from non-volatile memory. It provides the basic input/output functions for a PC. It is the BIOS that also reads the clock and does the date/time settings. Like the main frame issue, the BIOS also uses a 2 digit storage for the date.

The fix for the BIOS is reasonably straight forward - use 4 digits, except that the IBM spec calls for only 2 digits and software calls need to be preserved for older code (DOS for example).

To see what is really going on requires some more depth in describing the problem and how it gets solved.

How the BIOS works
The BIOS provides a low level link between the hardware and the software. The shell diagram below is conceptually what is happening.

 
User to Hardware link via BIOS
 
The computer's user needs to control the hardware in order to change the physical world around them. The commands flow through the layers of software finally coming to the BIOS. The BIOS provides a set of routines to connect the software to the hardware. These routines provide the hard disc utilities, device drivers, interrupt service routines, and other code and data.

 
Details

Now let's get into some of the details on how dates and times are updated in a PC.  This will require some basic review of X86 CPU operations and how the BIOS code works.

The BIOS is actually divided into several parts.  The two most fundamental parts are the POST and the System BIOS.  The POST (Power on Self Test) is the first code run on power up or reset of the computer.  It is this code that gets everything ready as required by the Intel processor and the IBM specification.  The System section provides the remaining computer device driver routines as discussed above.

The system time and date is controlled in hardware by a device known as the RTC (Real Time Clock).  The device is battery backed up so that, when the system is off, dates and times can be updated and saved in a memory device referred to as 'CMOS' which is also battery backed up.  The actual locations used in CMOS for dates and time is shown in the chart below.  The century byte at location 32 was added by IBM to the spec after the introduction of the original PC.

During POST, the time information (location 00, 02, 04 in CMOS)  is read and stored in the BIOS DATA  area.  The BIOS data area runs from 4OOh to 4FFh.  The times data is written to location 46C to 46E. When running, the RTC updates the time in RAM at  these locations. The date is also updated in RAM except that each operating system (DOS, Windows, OS/2, Unix) must define its own data space for the date.

To complete the picture, we need to know a bit about how X86 interrupts work.  An "interrupt" is a break in the normal sequence of the running program in order to handle an urgent request. Hardware interrupts are initiated by hardware devices like a key pressed on the keyboard.  The timing interrupts are  interrupts generated internal to the computer.  The Intel processor has a command called INT with a parameter number 00 to FF.  These are specifically assigned to a "vector" table.  We are interested in INT 1Ah.

The diagram shows that on issuing an INT 1Ah, location 028h to 02Bh is read which provides the address FFE6Eh, the location of the actual service routine's code.  The routine at this location uses the contents of the AH register to determine what function to provide. The function table below is a partial list of the INT 1Ah functions (clock only).  An assembly code example illustrates:
 

        MOV AH, 02k     ; function to read time from RTC
        INT 1Ah
 

Prior to the year 2000 issue, the date was incremented whenever the timer value would overflow (over 24 hr).  This was followed by function 04 to read and update the year, month and day. Note that the century byte was not updated.
 

 
Memory map for vectoring of INT 1Ah
 
 
The Fix for PC's

In order to fix the year 2000 problem in the BIOS, AMI has added three parts.

First, INT 1Ah, function 4 has been changed to update the century byte.

Second, during startup of the system, it is desirable to have the century properly updated if it has changed (system was off at New Year's Eve).  This is handled by issuing a dummy INT 1Ah, Fn4 during POST.

These two changes handle the major changes to obtain the proper year 2000 date.

Third, if the system is on across midnight but does not issue and INT 1Ah (no date function requested) the Century will not be updated.  To solve this problem a change is made in hardware interrupt 8 (IRQ 8) which services the Timer.  The timer generates 18.2 ticks per second.  The service routine for this interrupt (at location FFEA5h) has been modified so that it checks the century byte directly, even if INT1Ah is not issued.  The caution in this third part, is that the chipset must support shadowing of the CMOS data to get around possible date corruption due to a Timer Interrupt issued while CMOS is being accessed (by some other routine).  Of course, a system reset or issuing the date command will issue an INT 1Ah making this third part a "nice to have" rather than necessary.

 
Fixing Older BIOS's

For older computers, a full new BIOS is not likely.  Once a board is out of production, there is not sufficient payback to a manufacturer to divert Engineering resources to fixing an old BIOS.  The   Engineers are far better used on new designs.

For this reason, AMI has created a card that is sensed during start-up.  The code from this card is read into memory just before going  to the boot device.  The new code modifies the appropriate INT 1Ah function so that the year 2000 issue is overcome.

The Product to do this is called AMIDATE and is available in Canada through DeVita Associates.

Also, free of charge to those with Internet accounts is a test program to determine if  your older computers are year 2000 compatible.
 
Conclusion:
The consequences for wrong dates are enornous for those with main frames and custom software. The costs for fixing the problem is also large. Fortunately, the problem for the PC is not as costly to fix. The 'hardware' part of the fix for older machines (approx pre 1996) can be easily accomplished with an add-in card (AMIDATE) which essentially adds the updating of the Century byte. New machines are generally all year 2000 compliant today. The Software part of the solution rests with the software vendor who is likely to have an off-the-shelf solution.
 

 
References:
1. "AMIBIOS 95 Technical Reference",
        American Megatrends, Inc.,
        6145 Nroth Belt Parkway, Norcross GA, 30071
This manual is available for sale in Canada, through DeVita Associates.
 

2. Various internal memos and Notes from AMI engineers.

3. AMIDATE installation Guide (abrideged version attached below).

NOTE: FREE: Those who would like a free copy of the year 2000 test program leave your business card with an email address with the author or send an email request..
 
About the Author and Company:
Peter M DeVita, MASc, MBA, P.Eng is a graduate of UofT faculty of Engineering. He is a member of the PEO and is currently active on its Council as its elected VP. Eng. DeVita's MBA is from York U. Eng. DeVita is part owner of DeVita Associates. The firm has been Associated with AMI since 1986 and represents AMI in Canada as an agent and a Value added Distributor for all of AMI's products including the BIOS, Diagnostic tools, motherboards , RAID controllers and Cluster Systems. As well, DeVita Associates integrates non-desk top solutions with AMI and American Advantech components, a supplier of 19" rack mount components and real time data acquisition products. DeVita Associates customized hardware integrated with customers' software of choice.

 
CMOS locations
The standard AT-compatible RTC registers and Status registers are located from CMOS locations 00h - 0Fh.

CMOS Offset
Description
00h
Seconds field
01h
Seconds alarm (RTC alarm)
02h
Minutes field
03h
Minutes alarm (RTC alarm)
04h
Hours field
05h
Hours alarm (RTC alarm)
06h
Day of week field
07h
Date field (0-31)
08h
Month field
09h
Year field
0Ah
Status Register A
0Bh
Status Register B
0Ch
Status Register C
0Dh
Status Register D
0Eh
Diagnostic Status
0Fh
Shutdown Status
32h
Century byte (BCD value for the century) i.e. 19h
 

 
Some INT 1Ah Functions
 
Appendix
 : AMIDate Guide
 
Operation and Installation
The AMIDate adapter card makes sure that your computer is not adversely affected by the Year 2000 rollover problem. In some computers, files and programs will not work after December 31, 1999 because they will think that January 1st, 2000 is actually January 1st, 1980. AMIDate modifies the system BIOS code so the BIOS will read the time and date correctly.
AMIDate adapter card works with any system BIOS.
Who is Affected?
All IBM(r) PC/AT(r)-compatible and EISA computers that have an American Megatrends system BIOS with a core date of 07/25/94 or later already take care of this problem and will not be affected on January 1, 2000. However, many other computers will be affected.
AMIDate takes care of the Year 2000 problem, no matter what kind of IBM-compatible PC you have.

 
AMIDate Card Layout
 

 
Installing AMIDate
 

1  Turn the computer off.
2   Remove the computer cover. See the computer owners manual for instructions on removing the cover and installing     adapter cards.
3 Set ROM Size Jumper
Pins 7 and 8 of J1 on the AMIDate adapter card configure the ROM size. A 32 KB, 128-bit ROM is always installed on AMIDate. The factory setting is Pin 7 CLOSED and Pin 8 OPEN. You must not change this setting. The jumper settings determine the memory address that the card occupies and the ROM size. The J1 settings are printed on the adapter card. There are 16 holes, counted as two rows of eight pins each. Although the pin numbers are not printed on the card, 1 is designated by a square:

1
Install a shorting bridge on the two holes for the numbered pin to enable the desired address range. Leave the pin open to disable an address range. The following graphic shows a shorting bridge installed on Pin 1.2
 
  

4   If you have the American Megatrends AMIDiag system diagnostic utility, run the AMIDiag System Information component to list free ROM space. The J1 ROM Adaptor physical ROM Address range selections are:

Physical Address Range  Jumper
C8000h - CBFFFh Enabled Short Pin 1 of J1 (factory setting)
CC000h - CFFFFh Enabled Short Pin 2 of J1
D0000h - D3FFFh Enabled Short Pin 3 of J1
D4000h - D7FFFh Enabled Short Pin 4 of J1
D8000h - DBFFFh Enabled Short Pin 5 of J1
DC000h - DFFFFh Enabled Short Pin 6 of J1
 

5 Install the AMIDate adapter card in any open ISA expansion slot,

6 Replace the computer cover. Turn the computer on.

 

 
Disclaimer

AMIDate remedies the Year 2000 rollover feature in system BIOS only. AMIDate is not designed or intended to fix or repair other Year 2000 problems that exist in any other software such as operating systems, application software, or other hardware components. The customer accepts all responsibility for compatibility with other hardware and software components in their PC. The product is "sold as is" with no warranty expressed or implied and has no return privilege unless the board is found to be defective by AMI.

AMI MAKES NO WARRANTIES WITH RESPECT TO THE LICENSED SOFTWARE AND EXPRESSLY DISCLAIMS ANY WARRANTIES EXPRESS OR IMPLIED AND WHETHER OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
 



[Home] [Systems] [Components / Software] [Design Service] [Geophysical Survey] [Technology] [Profile] [Feedback] [How to Buy]

DeVita Associates, 250 Harding Blvd, Box: 32228, Richmond Hill, Ontario L4C-9S3
Tel: (905) 784-4400, Toll Free: (888)-523-9105  Fax:  (905)784-4401 Email: