image provider

CMOSSave


View the latest version of this manual online at http://mindprod.com/utility/cmossave.manual.html.
Introduction Getting Help From Roedy
Author Verification Fire Drill
Freeware Status False Alarm CMOSChk Corruption Messages
Warranty and Support What If You Have Already Crashed?
Getting the Latest Version WINDOWS 95/98/ME
Purpose Windows NT/2000/XP/Vista
What Is CMOS? Modern Large CMOS
Syntax Y2K Year 2000 Compliance
Hints XT Computers
Belt and Suspenders Repeated Failures
Running Under DOS CMOS Offsets. How each byte of CMOS is used
How It Works CMOS Offset Notes
How to Use CMOS Note to Computer Manufacturers
DOS Bootable Device Extended CMOS
Troubleshooting Books

Introduction

CMOSSAVE is Freeware to restore damaged CMOS (Complementary Metal Oxide on Silicon)

CMOSSAVE is not a program for the naïve user. You must be familiar with composing ASCII (American Standard Code for Information Interchange) text command files and booting to DOS (Disk Operating System) to be able to use it.

  1. The most important fact is you must use CMOSSAVE BEFORE you have trouble. If you have not done so, CMOSREST won’t do you a lick if good once your CMOS is corrupted.
  2. The second most important fact is you must boot from DOS and have access to the saved CMOS file on the boot diskette/CD in order to restore your CMOS.
  3. The third most important fact is you must redo you CMOSSAVE any time you change your CMOS, e.g. upgrade your disk. You also need to redo your BOOTSAVE at the same time.

Author

Roedy Green of Canadian Mind Products wrote this suite. CMOSSAVE, CMOSREST and CMOSCHK are copyrighted but may be freely used for any purpose except military. If you pass the files on, please pass on this documentation too.

Please report bugs and problems to roedyg@mindprod.com

Harvey Fishman wrote a pair of programs similar to CMOSSAVE and CMOSREST, but to the best of my knowledge, never released them.

Freeware Status

CMOSSAVE CMOSREST and CMOSCHK are freeware for non-military use only.
Roedy Green
Canadian Mind Products
Precise address withdrawn due to too many death threats.
Victoria, BC Canada

Tel: (250) 361-9093
mailto:roedyg@mindprod.com
http://mindprod.com

Big companies such as Sony, NCR (National Cash Register) and Chemineer use cmossave to protect all their machines and to clone CMOS settings across machines.

Warranty and Support

This is a free program, so there is no guarantee. However, I will fix any bugs.

Keep in mind, CMOSSAVE won’t do you any good unless you have used it before you have trouble. I have no magic to bail you out after the fact. Pleading with me won’t help.

Happily, so long as you have done a CMOSSAVE and have not overwritten it, almost any problem can be rectified even if CMOSREST or CMOSCHK should fail.

Getting the Latest Version

You can find the latest CMP (Canadian Mind Products) utilities, including CMOSSave via page at: http://mindprod.com/products1.html#CMOSSAVE

Purpose

  1. Naive users sometimes fiddle with CMOS settings. We need a fast way to put the scores of subtle CMOS configuration settings back the way they were.
  2. Power surges can corrupt CMOS. We need a way for a naïve user to quickly restore all the CMOS settings.
  3. If the battery fails, the contents will be lost. We need a way to restore a known working CMOS configuration.
  4. You may want to alter some obscure CMOS setting and you don’t have a program to set it.
  5. CMOSRest can also be used to toggle between two CMOS configurations, for example with and without a removable hard drive installed. If you had removable hard disks, you could rapidly switch between the various disks.
  6. CMOSChk can detect subtle corruption to CMOS, as might be caused by a rogue program or a virus, something that might slow your machine or make it unreliable.
  7. CMOSSave can create a backup of your CMOS on floppy. This way you may safely experiment with CMOS settings. You can always get back to where you started by using CMOSRest to restore the original settings. Any time you fiddle with the computer innards, you might accidentally disconnect the battery, losing CMOS. CMOSSAVE lets you put it back the way it was.
  8. Testing a machine for year Y2K 2000 compliance, to make sure the BIOS (Basic Input Output System) will kick the date over properly in the year 2000. Not so important anymore.
  9. If you build machines for a living, you can rapidly clone the CMOS settings of one template machine in a dozen others. You create a DOS bootable removable device (floppy, USB (Universal Serial Bus) drive etc), with a copy of CMOSSAVE.com and CMOSREST.com on it. You set up one machine, do a CMOSSAVE to the DOS bootable device, then insert that device into each machine to clone, boot and do a CMOSREST.

What Is CMOS?

Your computer has three kinds of memory, RAM (Random Access Memory), CMOS and hard disk. When the power turns off, your computer forgets everything in RAM. Your much slower hard disk retains its magnetic memory. When the power is off, your tiny CMOS memory is kept alive by battery backup (ideally a lithium battery, sometimes a rechargeable nicad battery, or worst of all a pack of ordinary alkaline batteries.) In the CMOS is recorded basic facts about your configuration — the size and geometry of your hard disk, how many floppy drives you have and what type, how much RAM you have, how many wait states need to be added to slow down the CPU (Central Processing Unit) enough to work with your RAM, etc. etc.

The data in CMOS RAM can only be examined or changed with a special program such as CMOSSAVE. It is not a file. If you are curious about how CMOSSAVE does the access, have a look at the notes in the source code in CMOS.ASM.

When the battery dies, or does when a rechargeable battery not get sufficient on time to recharge, the CMOS fails and it forgets all it knows about your configuration.

CMOSSAVE is designed to restore this lost information by storing copies of it on floppy and/or hard disk.

Syntax

There are three utilities in the CMOS suite:
CMOSSAVE.COM A:Myfile.Sav
IF ERRORLEVEL 1 GO TO Trouble
saves a copy of CMOS in a file on hard disk or floppy.
CMOSREST.COM A:MyFile.Sav
IF ERRORLEVEL 1 GO TO Trouble
restores CMOS from a file on hard disk or floppy.
CMOSCHK.COM A:MyFile.Sav /Q
IF ERRORLEVEL 1 GO TO FixIt
checks that CMOS has not been fiddled with since the last CMOSSAVE. Compares CMOS with a file on hard disk or floppy.

/Q suppresses unnecessary banner messages.

Hints

There are three ways you can use the suite:
  1. manually,
  2. automatically
  3. with a rescue diskette.
  1. Manually. Prepare a bootable floppy with the command:
    Format A: /S /V /U /F:1.44MB
    Unfortunately Windows NT W2K and XP can no longer create a bootable DOS floppy, though Vista and Windows 7 can. Borrow a DOS bootable disk from someone with FORMAT on it and duplicate it or boot from it to create another bootable dos floppy, or get a friend to create you a bootable DOS floppy with . Install CMOSSAVE.com and CMOSREST.com on your hard disk into J:\com\mindprod\cmossave\. You can create such a directory with:
    MD J:\com\mindprod\cmossave
    This directory need not be on the path, but if it is not, you will have to type
    J:\com\mindprod\cmossave\CMOSSAVE.exe
    instead of just
    CMOSSAVE
    Backup your CMOS to the bootable floppy with:
    CMOSSAVE.com A:\CMOS.SAV
    COPY J:\com\mindprod\cmossave\ CMOS *.com A:
    CMOSSave is a DOS utility and thus can only use short 8.3 file names. If ever your CMOS becomes corrupted, correct it by booting DOS from floppy and typing:
    CMOSREST.com A:\CMOS.SAV
    CMOSRest is a DOS utility and thus can only use short 8.3 file names. Then reboot. In this case you don’t bother with CMOSCHK.com at all.
  2. With a rescue diskette. Prepare a bootable DOS floppy with an autoexec.bat that invokes the following commands to correct most CMOS and hard disk problems with DOS :
    CMOSREST A:\CMOS.SAV
    BOOTREST A:\BOOT.SAV
    CHKDSK C:/F
    SYS C:
    COPY A:\COMMAND.COM C:\
    COPY A:\COMMAND.COM C:\ DOS
    (BootRest.com freeware is separately available. You need to make a separate rescue disk for each machine unless the machines are absolutely identical including hard disk size.

Belt and Suspenders

Do a CMOSSAVE both to hard disk and to floppy. The hard disk copy can be used for quick restores with the following two lines added to your DOS AUTOEXEC.BAT file. (This won’t work in Windows). Use a text editor to add these lines.
CMOSChk.com J:\com\mindprod\cmossave\CMOS.Sav
IF ERRORLEVEL 1 cmosrest.com J:\com\mindprod\cmossave\CMOS.Sav
CMOSChk is a DOS utility and thus can only use short 8.3 file names. Beware! the above code will also under deliberate changes. To someone unfamiliar with CMOSSAVE, having his deliberate CMOS changes undone can be very disconcerting.

At that point you must reboot before the restored CMOS settings take effect. Sometimes CMOS will be so badly damaged the hard disk parameters will be corrupt and your hard disk will stop working. In that case you will have to revert to using the floppy copy.

Whenever you change your CMOS setting deliberately, you need to redo the CMOSSAV.COM. However, use a new filename, so that you can easily revert to the old version if your new settings do not pan out.

Running Under DOS

There are three reasons why the CMOSSave utilities must run under DOS , not Windows:
  1. CMOSSave is a very old program, that was created in the DOS days, before Windows was a twinkle in Bill Gates’ eye.
  2. CMOSSave will run under Windows, it is just that the Windows OS (Operating System) now prevents it from accessing or changing CMOS, making it useless. Windows does this to protect CMOS from malicious corruption by malware. Windows has no way of knowing that CMOSSave is benign.
  3. Windows itself will usually not run at all if CMOS is corrupted. If CMOSRest ran under Windows it would not be able to run to restore CMOS.
What are the ways to run under DOS ?
A DOS box/window/compatibility box/penalty box/command prompt is not the same as DOS. It is a DOS emulator, part of Windows, with many features of DOS blocked to enhance the security of the computer. Microsoft rightly considers meddling with CMOS a potentially dangerous thing to do and blocks programs running in the DOS box from doing it. For CMOSsave/CMOSrest, you need real DOS, e.g. booting from a DOS floppy, not just the DOS command prompt.
CMOSSAVE/CMOSTREST will run in very early versions of Windows before Microsoft added the safety blocks, but they won’t run in the more recent versions such as Vista and Windows 7.

How It Works

CMOSSAVE.COM simply copies the 128 byte contents of the CMOS bytes to a file. CMOSREST.COM copies them back. CMOSCHK compares them with the file contents. If they are not equal it sets ERRORLEVEL 1.

Modern computers have larger CMOS memories than 128 bytes, but you access them via proprietary ways, which CMOSSAVE does not know. So CMOSSAVE just saves the first 128 bytes, which are accesses in a uniform way on all PCs (Personal Computers).

CMOSREST does not touch bytes 0 to 09 and 32h because these are volatile — they contain the date and time. Similarly CMOSCHK, does not panic if any of these volatile bytes differ. However, CMOSSAVE saves all 128 bytes, so that you can browse the generated file with a hex editor to learn more about how CMOS works.

You need some sort of hex viewer to see the contents of the CMOS.SAV file. The hex list of bytes is not that meaningful if you are not a computer programmer.

Daring users could even patch the CMOS.SAV file with a hex editor and restore to get special effects, e.g. to switch between two different CMOS configurations e.g. one with and one without some hard disk. Don’t attempt to edit the file with a non-hex viewer such as NotePad, WordPad, Write or Word For Windows. If you do, you will scramble the file beyond recognition.

Because CMOSSave also saves the extended CMOS bytes, CMOSRest will restore the esoteric options like shadow RAM, wait states, processor clock speed, HMA (High Memory Area) enable etc. It works on ISA (Industry Standard Architecture), EISA (Extended Industry Standard Architecture) and PCI (Peripheral Component Interconnect) machines.

These is no need for any of the three utilities to calculate checksums, since the checksum is saved and restored just like any other CMOS byte.

You might wonder why CMOSSave saves only 128 bytes of CMOS even though some modern computers have many times that amount. The problem is the way you get at the rest of it is proprietary. The vendors won’t disclose how you get at it. It is possible to disassemble the ROM BIOS to figure it out in an individual case, but that won’t work on other machines. So it is usually not worth the bother unless you wanted a special version of CMOSSAVE for thousands of identical machines.

How to Use CMOS

CMOS is battery backed RAM that stores configuration information when the power is off. It is on my top ten worst ideas list of all time. The problem is, CMOS is far too easily corrupted, by programs, power or naïve users experimenting.

See CMOS.OFS for a detailed list of what each byte in the CMOS is used for. This is usually of interests to technophiles only.

DOS Bootable Device

CMOSsave is a very old program. I wrote it before Windows was even a twinkle in Mr. Gates’ eye. Back then, everyone had boxes full of DOS bootable floppies and at least one DOS-bootable hard disk. You need some sort of DOS bootable device to boot up DOS to run CMOSSave. Here are some of your options for a DOS-bootable device today: Here are two ways to get a bootable DOS floppy:
  1. Copy an old DOS bootable floppy, deleting any files you don’t need.
  2. Format an empty floppy with Windows, ticking off the DOS-bootable option. It will have a FAT16 files system with 512-byte sectors.
To get a bootable USB Flash drive:
  1. Download the free USB formatting software from ExtremeOverclocking.
  2. Download the DOS boot files for Windows 98 from the same place.
  3. Use the software to format a USB drive as a bootable DOS drive.
  4. Copy CMOSave.com, CMOSRest.com and CMOSChk.com to the USB drive.
  5. Adjust your BIOS to boot from the USB drive.
  6. Boot from the USB.
  7. Do your thing with CMOSSave.
  8. Adjust your BIOS to boot from hard disk again.
I was able to create a DOS-bootable USB drive, but I was unable to get my BIOS to boot from it. Please let me know about your successes and failures with USB flash drives.

Troubleshooting

CMOSSAVE is compatible with every machine I have so far encountered. There are a few that have additional proprietary CMOS that CMOSSAVE does not see, but CMOSSAVE saves the crucial areas. Because different vendors use CMOS in different ways, CMOSCHK can give false alarms when bits of CMOS change legitimately.

What is considered volatile and what is not, might vary for different motherboards. If you have trouble restoring, Do not despair. All is recorded. A variant of the CMOSREST program could get you back. All you need do in make a slight modification to the assembler source VOLATILE routine that decides which bytes to consider volatile. Even a very junior MASM (Microsoft Assembler) programmer could make that modification for you using the assembler source.

If you do a CMOSSAVE from the DOS prompt and from true DOS there may be some subtle differences and CMOSCHK may complain about them. This is nothing to worry about since when you restore, those bits in the CMOS will be automatically corrected the next time you boot to either DOS or Windows. It is quite safe to save from the DOS prompt with CMOSSAVE, check with CMOSCHK from autoexec.bat or other bat file and do your restore with CMOSREST from true DOS.

Sometimes your CMOS will be so wrecked you cannot even get your machine limping enough to run CMOSREST from floppy. In that case you must clear CMOS. Do this on AMI (American Megatrends Inc) BIOS es by holding down the Ins key, powering off, powering on, then releasing the Ins key. In the worst case, remove the battery and let the capacitance on the board drain overnight to clear it. On some CMOS es you can clear CMOS by selecting universal default settings from the normal CMOS setting menu.

You can then get a bare bones CMOS configured — that just has the floppies right. Nothing else much matters. From there you can run CMOSREST.COM.

The SSTOR disk formatting utility from Storage Dimensions makes it look as though it had modified CMOS. If you boot without the SSTOR driver, CMOS will appear to have changed because SSTOR is not doing its standard trickery.

The NCR CMOSDR6X program interferes with CMOSSAVE and CMOSREST. Make sure you do your CMOSSAVE CMOSREST work before loading this program.

The TURBO setting is part of CMOS. If you accidentally turn turbo mode off, CMOS will appear to be changed and CMOSCHK will complain. To clear the problem, set turbo back on and allow the CMOSCHK to restore CMOS. This way CMOSCHK will remind you if you have accidentally turned off turbo mode. This feature can be turned off by making the byte where your turbo info is stored volatile. If you want this feature, just send the CMOSCHK listing that complains about CMOS being changed.

I repeat: CMOSREST won’t do you a lick of good unless you run CMOSSAVE BEFORE you have trouble. Make sure you have copies of CMOS.SAV both on hard disk and on floppy.
There is a companion program called BOOTSAVE that works in a similar way to protects your boot track from damage by rogue programs or viruses. Again, you must use it BEFORE you have trouble.

CMOSREST does not take effect until you REBOOT!!

Getting Help From Roedy

If you want help from me diagnosing trouble, first read this manual several times and try the various things it suggests. Only if that does not work, email me at email Roedy Green including the following:

Verification Fire Drill

CMOSSave and CMOSTRest have internal checks to warn you if they are not functioning. However, you can assure yourself they are working properly by using CMOSSave, then changing some minor setting in CMOS (e.g. to add an extra unneeded wait state), then use CMOSChk to detect the damage then CMOSRest to restore the CMOS back the way it was. If all is working correctly, the minor change should be undone.

False Alarm CMOSChk Corruption Messages

Some non-standard BIOS es have additional volatile portions that CMOSCHK does not know about. It will report false corruptions. There are three ways you can handle the problem:
  1. Send me a screen print of what CMOSCHK is saying. I will send you a custom version with those false mismatches considered as volatile bytes.
  2. Modify the VolatileList line in CMOS.ASM yourself to include the extra offsets your BIOS is treating as volatile. Then reassemble. CmosChk.com will give you a list of offsets where it thinks there are mismatches. It is up to you to determine which ones you think are false alarms.
  3. Simply avoid using CMOSChk. Just use CMOSSAVE and CMOSREST. Most of the time damaged CMOS is fairly obvious.

What If You Have Already Crashed?

CMOSSAVE is prophylaxis, not a cure. You have to use it BEFORE you have trouble. (Hmm. Is there is an echo in here?) However, what can you do if your CMOS is wrecked and you have no CMOS.SAV backup of it?

You had best get an expert to help you set the CMOS back to defaults and guess the fine tuning for the parameters. The dealer who sold you the machine is the best person to help. He may be able to contact the disk manufacturer to find out how many heads and cylinders it has. He may be able to find hints in the motherboard manual.

If your machine has an exact twin, you may still be in luck. You can make a backup of the CMOS on that machine, then restore it into the ruined one. Don’t try this unless the machines are absolutely identical. There is a good chance you will destroy your hard disk data if you transplant a CMOS from a different sized disk.

You can manually set CMOS back if you hit the magic keys during hard boot, often DEL, F2, or Ctrl-Alt-Esc. Sometimes you need a diskette to set up CMOS. Check the manual that came with your motherboard, or check with the company that sold it to you.

Usually there is a way to set CMOS settings to default. In a pinch you can do it by removing the battery for a day or two.

WINDOWS 95/98/ME

CMOSSAVE is a DOS program that gets its data from the command line. The most common mistake is to try to run CMOSSAVE directly from Windows 95 Explorer, rather than by first starting a DOS box or setting up the CMOSSAVE command line in the properties for the icon.

Windows 95 still has a C:\autoexec.bat just as under DOS. Alternatively go into a DOS box and use the CMOSSSAVE utilities just as you would under DOS to add the call to CHKCMOS.BAT or to directly invoke CHKCMOS.COM. still use CMOSSAVE and CMOSREST just as under previous versions of DOS and Windows. Putting cmoschk.com in your autoexec just helps you detect CMOS corruption the instant it occurs.

Windows 95 users often have no understanding of the DOS CD, MD and path commands, how to edit autoexec.bat or even how to run a DOS program. If you are one of this new breed, your best bet is to get help from someone who is familiar with DOS, since if CMOS is corrupt you will need to revert to DOS to get Windows going again.

You can run the utilities either in autoexec.bat, in DOS or 4DOS box, in a BAT (Batch) file, or by creating a shortcut, complete with parameters on the command line.

However, here is a crude, but fool-proof recipe to use cmossave manually under Windows 95.

Copy the files cmossave.com, cmoschk.com and cmosrest.com to a freshly formatted floppy in your A: drive.

In Win 95, select Start, Programs, MS DOS Prompt to get you to the Win 95 DOS box. Type:

c:
sys a:
a:
cmossave cmos.sav
exit
If later suspect your CMOS is corrupted boot from that floppy. Then type:
A:
cmoschk cmos.sav
If it turns out it is indeed corrupt, then type
cmosrest cmos.sav
Then remove the floppy and reboot by hitting either Ctrl-Alt-Del, the reset button, or if all else fails, power off/power on.

Windows NT/2000/XP/Vista

Windows NT interferes with CMOSREST, though it will allow CMOSSAVE and CMOSCHK to run properly. The restore appears to work, but when you exit the DOS box, NT undoes the restore. Should you need to restore, you will have to boot from a DOS floppy or dual boot to Windows to run CMOSREST. It would be wise to have a copy of your CMOS.SAV file and cmosrest.com on that bootable floppy or CD.

You can acquire a bootable floppy by digging in your old DOS diskettes, asking an old timer for one, or you can right click Format and select bootable DOS disk. It may be possible to use memory sticks, thumbdrives, CDs (Compact Discs) and DVDs (Digital Video Discs) too with appropriate DOS-formatting software.

Modern Large CMOS

Most modern computers have a CMOS larger than 128K. However, instructions to access it are only published for the first 128K. I can create special versions of CMOSSAVE to handle large CMOS es if you give me documentation on the CMOS accessing, or if I can get a sample machine for a week to experiment with to figure out how the BIOS accesses the additional CMOS. I would have to charge you for that and the special version would only work on machines very similar to the one you sent me.

Y2K Year 2000 Compliance

Some older machines will not work properly in the year 2000 because the BIOS will not handle dates past 1999. You would probably want to know if your machine will have this problem. Unfortunately, if you perform an experiment by setting the date to 2000-01-01, some BIOS es forget everything. If you make a backup first with CMOSSAVE, you can easily restore CMOS to its original settings.

If you are testing a number of machines, make sure you erase the CMOS.SAV file on floppy between tests. You don’t want to accidentally restore the CMOS.SAV file from one machine into another (unless they were absolutely identical, including hard disk size.)

XT Computers

You will find that XT computers don’t have a CMOS, so CMOSSAVE will not do you much good.

You can configure XT floppies using DOS ’s DRIVPARM.

Back in the good old days of the XT you had to use proprietary methods to format hard disks and tell DOS how big they are. Typically you fired them up with debug g=c800:5 and talked with a proprietary ram-based low level formatting program. Then you later used DOS format. HDSNIFF goes into this in much more detail. Briefly:

XT Drive Settings
Brand Debug Init Step byte code = step pulse rate
Adaptec g=c800:ccc 3=13 µs, 2=30 µs, 5=70 µs, 4=200 µs, 0=3 ms
DTC5150CRH g=c800:5 2=12 µs, 5=70 µs, 4=200 µs, 0,1,6,7=3 ms
DTC5150XL g=c800:5 0=5,10,20,30,40,50,60,70 µs (cannot tell which!)
IBM/Xebec 5=70 µs, 4=200 µs, 0,6,7=3 ms
Omti g=c800:6 1=10 µs, 2=25 µs, 3=40 µs, 5=70 µs, 4=200 µs, 0,6,7=3 ms
WD-old g=c800:5 5=70 µs, 4=200 µs, 0,6,7=3 ms
Wd1002-Wx1 g=c800:5 3,7=10.5 µs, 2=22.5 µs, 6=28.5 µs, 1=46.5 µs, 5=70.5 µs, 4=202.5 µs, 0=3.1 ms
WD10025WX2 g=c800:5 3,7=18 µs, 6=30 µs, 1=45 µs, 2=60 µs, 5=75 µs, 4=210 µs, 0=3ms
Wd1002-27X g=c800:5 3,7=8 µs, 1,2,4,5,6=24 µs, 0=3 ms
Wd1004-Wx1 g=c800:5 3,7=12 µs, 6=27 µs, 1=51 µs, 2=63 µs, 5=75 µs, 4=207 µs, 0=3 ms
Wd1004-27X g=c800:5 3,7=8 µs, 1,2,4,5,6=24 µs, 0=3 ms
WD1004A27X g=c800:5 3,7=11 µs, 1,2,4,5,6=24 µs, 0=3.3 ms
WD-XT-GEN1 g=c800:5 3,7=18 µs, 6=30 µs, 1=45 µs, 2=60 µs, 5=75 µs, 4=210 µs, 0=3ms
WD-XT-GEN2 g=c800:5 3,7=18 µs, 6=30 µs, 1=45 µs, 2=60 µs, 5=75 µs, 4=210 µs, 0=3ms

Repeated Failures

What happens if your machine routinely loses CMOS. What are the causes:

CMOS Offsets. How each byte of CMOS is used

Understanding this offset documentation is not needed to use CMOSSAVE. It is provided mainly for the insatiably curious. Every machine under the sun uses CMOS a different way, so this is only a rough guide. CMOSSave touches only the standard first 128 bytes of CMOS. It does not touch the proprietary extended CMOS.

! = must be restored
* = checksummed
v = volatile

CMOS Offsets
Type Offset Contents
v 00h Seconds time of day
v 01h Seconds Alarm
v 02h Minutes time of day
v 03h Minutes Alarm
v 04h Hours time of day
v 05h Hours Alarm
v 06h Day of the Week
v 07h Day of the Month
v 08h Month
v 09h Year 1980 = 0
v 0Ah Status Register A
bit 7 = updating time
bit 6:4 = system clock divider
bit 3:0 = periodic interrupt rate
! 0Bh Status Register B alarm
bit 7 = abort update cycle
bit 6 = enable periodic interrupt
bit 5 = enable alarm interrupt
bit 4 = enable update-ended interrupt
bit 3 = enable square wave generator
bit 2 = 1 = calendar in binary, 0 = bcd
bit 1 = 1 = 24 hour clock, 0 = 12 hour clock
bit 0 = 1 enable daylight savings
v 0Ch Status Register C flags
bit 7 = interrupt active
bit 6 = periodic interrupt flag
bit 5 = alarm flag
bit 4 = update end flag
bit 3:0 = reserved
! 0Dh Status Register D battery bit 7 = Real Time Clock has power
bit 6:0 = reserved
! 0Eh Diagnostic Status Byte
bit 7 = RTC (Real Time Clock) lost power
bit 6 = CMOS checksum bad
bit 5 = invalid system config
bit 4 = invalid memory size
bit 3 = fixed disk adapter failure
bit 2 = invalid CMOS time
bit 1 = reserved
bit 0 = reserved
! 0Fh Shutdown Status Byte
!* 10h Disk Drive Type for Drives A: and B:
The drive-type bytes use bits 7:4 (most significant nibble)
for the first floppy drive A: and 3:0 for B:
floppy drive types:
00h no drive present
01h 360KB
02h 1.2MB
03h 720KB
04h 1.44MB
05h 2.88MB
03h-0Fh reserved
!* 11h (AT (Advanced Technology)):Reserved (PS/2):drive type for hard disk C:
AMI bios uses it like this:
bit 7 mouse enabled
bit 6 test memory above 1 MB
bit 5 tick sound during memory test
bit 4 memory parity enabled
bit 3 at bootup display setup keystroke
bit 2 specify hard disk data location
bit 1 pause on error
bit 0 numlock on
!* 12h (AT, XT/286):hard disk type for drives C: and D:
bits 7:4 C: bits 3:0 D:
(PS/2):drive type for hard disk D:
Format of drive-type entry for AT, XT/286:
0 number of cyls in drive (0-1023 allowed)
2 number of heads per drive (0-15 allowed)
3 starting reduced write compensation (not used on AT)
5 starting cylinder for write compensation
7 max. ECC (Error Correcting Code) data burst length, XT only
8
Bits Function
7 disable disk-access retries
6 disable ECC retries
5-4 reserved, set to zero
3 more than 8 heads
2-0 drive option on XT (not used by AT )
9 timeout value for XT (not used by AT )
12 landing zone cylinder number
14 number of sectors per track (default 17, 0-17 allowed)
!* 13h Reserved, keyboard repeat rate
!* 14h Equipment Byte (corresponds to sw. 1 on PC (Personal Computer) and XT)
bits 7:6 - 00 = 1 floppy 01 = 2 floppies
bits 5:4 = 10 = colour 11 = mono
bit 1 = coprocessor present
bit 0 = 0 = floppies present
!* 15h-16h Base Memory Size in K (low,high)
!* 17h-18h Expansion Memory Size in K (low,high)
!* 19h drive C: extended info
!* 1Ah drive D: extended info
!* 1Bh-20h Reserved
(PS/2) POS (Point Of Sale) information Model 50 (60 and 80 use a 2K
CMOS RAM that is not accessible through software)
!* 1Bh-1CH AMI type 46 cyls
!* 1Dh AMI type 46 head count
!* 1Eh-1Fh AMI type 46 write precomp starting cyl
!* 20h AMI type 46 control byte
!* 21h-22h AMI type 46 landing zone cylinder
!* 23h AMI type 46 sectors per track
!* 24h-25H AMI type 47 cyls
!* 26h AMI type 47 head count
!* 27h-28h AMI type 47 write precomp starting cyl
!* 29h AMI type 47 control byte
!* 2Ah-2Bh AMI type 47 landing zone cylinder
!* 2Ch AMI type 47 sectors per track
!* 21h Used in AMI bioses
bit 7 Weitek present
bit 6 floppy seek on boot
bit 5 first C: then A:
bit 4 fast clock
bit 3 external cache enabled
bit 2 internal cache enabled
bit 1 fast A20
bit 0 allow turbo switch
!* 22h-2Dh Reserved (possibly checksumed)
!* 2Eh-2Fh Checksum of Bytes 10..20 or 10..2F (low,high)
! 30h-31h Exp. Memory Size as Det. by POST (low,high)
v 32h Date Century Byte
! 33h Information Flags (set during power-on)
! 34h-36h Reserved
! 37h Date Century on MCA (Micro-Channel Architecture)
v 38h volatile Why??
! 39h Reserved
v 3Ah bit 1 of 3Ah used to mark whether have Plug & Play OS in Sony.
! 3Bh Reserved
! 3Ch 90/91 AMI Bios boot order A/C or C/A
! 3Dh Reserved
! 3Eh Reserved
! 3Fh quasi-volatile in Pentiums (We restore, but ignore in CMOSCHK)
!v 40h-42h Reserved for chipmaker
! 43h-49h Reserved for chipmaker
4Ah AST laptop backlight timeout in minutes
4Bh AST laptop hard disk timeout in minutes
4Ch-52h system password scan codes
!* 60h-61H Phoenix type 48 cyls
!* 62h Phoenix type 48 head count
!* 63h-64h Phoenix type 48 write precomp starting cyl
!* 65h-65h Phoenix type 48 landing zone cylinder
!* 67h Phoenix type 48 sectors per track
!* 75h-76H Phoenix type 49 cyls
!* 77h Phoenix type 49 head count
!* 78h-79h Phoenix type 49 write precomp starting cyl
!* 7Ah-7Bh Phoenix type 49 landing zone cylinder
!* 7Ch Phoenix type 49 sectors per track

CMOS Offset Notes

The alarm function is used to drive the BIOS WAIT function (int 15h function 90h).

To access the configuration RAM write the byte address (00-3Fh) you need to access to I/O port 70h, then access the data via I/O port 71h.

CMOS RAM chip is a Motorola 146818

The equipment byte is used to determine the configuration for the POST power-on diagnostics.

Bytes 00-0Dh are defined by the chip for timing functions, bytes 0Eh-3Fh are defined by IBM (International Business Machines).

compaq 386 uses the same CMOS chip as IBM at. extra functions:
byte 45 (2Dh) store additional info not maintained by AT
bit 0 indicates is Compaq dual-mode monitor installed
bit 1 indicates whether keyclick is enabled
bit 2 not used
bit 3 if non-Compaq graphics adapter installed

Some CMOS es, (SXs) appear to store duplicates of registers 0:3F in 40:7F, others (DXs) store some other advanced configuration information in these registers. Thus there are 64 byte and 128 byte CMOSes (Complementary Metal Oxide on Silicons). We tell them apart by looking for a match in bytes in the checksum range.

Offsets 10..2F are included in the checksum. We do not ever need to compute a checksum in CMOSREST since we just save and restore. Exactly what is included in the checksum varies with the BIOS. Sometimes only 10..20 is included.

For further information see the IBM AT Technical reference page 1-56. PC Magazine did an article on CMOS on page 344 of the 1994-09-13 edition.

For a detailed list, especially for vendor specific bytes is in The Undocumented PC, A Programmer’s Guide To I/O, CPU s and Fixed Memory Areas by Frank van Gilluwe, Addison-Wesley. For exhaustive detail, see CMOS.LST available as part of Ralf Brown’s interrupt list:

You can modify the VOLATILIST in CMOS.ASM if you find other volatile bytes in your CMOS, in other words, bytes in CMOS that seem to change even when CMOS is not corrupted.

Note to Computer Manufacturers

You might create several different versions of CHKCMOS or CMOSSAVE with different volatile byte definitions. They would then only work on a subset of CMOS, e.g. Motherboard settings, hard disk settings… You could then use these programs to clone CMOS settings between machines.

You can rapidly clone the CMOS settings of one template machine in a dozen others. You create a DOS bootable removable device (floppy, USB drive etc), with a copy of CMOSSAVE.com and CMOSREST.com on it. You set up one machine, do a CMOSSAVE to the DOS bootable device, then insert that device into each machine to clone, boot and do a CMOSREST.

Extended CMOS

CMOSSAVE is concerned with saving a restoring the first standard 256 bytes of CMOS. Most motherboard manufacturers extend this in proprietary ways. Since the ways you get at this extra CMOS are not published CMOSSAVE ignores it. If you are a motherboard manufacturer willing to divulge the technique to accessing your RAM would be happy to write custom versions for your motherboards.

Books

book cover recommend book⇒The Undocumented PC, A Programmer’s Guide To I/O, CPUs and Fixed Memory Areasto book home
by Frank van Gilluwe 978-0-201-62277-5 paperback
publisher Addison-Wesley
published 1993
A fasciting book about CPU detection, undocumented CPU instructions, how adapter cards work, how the BIOS works, how DMA works and, of course, how CMOS works and how the various parts of CMOS are used.
Australian flag abe books anz abe books.ca Canadian flag
German flag abe books.de amazon.ca Canadian flag
German flag amazon.de Chapters Indigo Canadian flag
Spanish flag amazon.es Chapters Indigo eBooks Canadian flag
Spanish flag iberlibro.com abe books.com American flag
French flag abe books.fr amazon.com American flag
French flag amazon.fr Barnes & Noble American flag
Italian flag abe books.it Nook at Barnes & Noble American flag
Italian flag amazon.it Kobo American flag
India flag junglee.com Google play American flag
UK flag abe books.co.uk O’Reilly Safari American flag
UK flag amazon.co.uk Powells American flag
UN flag other stores
Greyed out stores probably do not have the item in stock. Try looking for it with a bookfinder.

This page is posted
on the web at:

http://mindprod.com/utility/cmossave.manual.html

Optional Replicator mirror
of mindprod.com
on local hard disk J:

J:\mindprod\utility\cmossave.manual.html
Canadian Mind Products
Please the feedback from other visitors, or your own feedback about the site.
Contact Roedy. Please feel free to link to this page without explicit permission.

IP:[65.110.21.43]
Your face IP:[18.218.108.24]
You are visitor number