[comp.sys.ibm.pc] Parameter Ram Backup Needed

spj@hropus.UUCP (03/14/87)

I recently purchased an AT clone, which has four penlight batteries
inside. My friend says this is to backup the parameter ram which
stores the hard disk partitioning info, amoung other things, and that
when the batteries are removed for replacement or just plain run down,
I will lose the ability to access my hard disk.

Are there any programs or known methods for backing up and reloading
this parameter ram after the batteries are replaced?

Steve Johnson  (201) 615-4980

ralf@b.gp.cs.cmu.edu (Ralf Brown) (03/15/87)

I tried to mail this message, but lanl.arpa complained "user unknown"
given the address <ihnp4!riccb!hropus!spj@lanl.arpa>.  Others might also be
interested in the two small programs contained herein.

Date: Sun, 15 Mar 1987 14:21-EDT
From: Ralf.Brown@b.gp.cs.cmu.edu
To: ihnp4!riccb!hropus!spj@lanl.arpa
Subject: Re: Parameter Ram Backup Needed
Message-ID: <542834530/Ralf.Brown@b.gp.cs.cmu.edu>
In-Reply-To: <910@hropus.UUCP>


I too have an AT clone with 4 penlight batteries for the clock.  Here are 
two small BASIC programs I hacked up a few months ago: the first reads the 
NV-RAM and displays its contents on the screen, and the second restores the 
contents from DATA statements in the program (which you would put in according
to the values displayed by the first program).

The first program displays three columns of three numbers on the screen.  For
each group of three numbers, the first is the address (in hex), the second and
third are the value in hex and in decimal.
------------------------------
10 FOR X = 0 TO 63
20 OUT &H70,X+128
30 Y=INP( &H71 )
40 IF X < 16 THEN PRINT "0";
50 PRINT HEX$(X);"  ";
60 IF Y < 16 THEN PRINT "0";
70 PRINT HEX$(Y);"  ";
80 PRINT RIGHT$("   "+STR$(Y),3);
90 IF X MOD 3 = 2 THEN PRINT ELSE PRINT ,,
100 NEXT
110 END
1000 CLS
1010 FOR X = 1 TO 2500:LOCATE 1,1
1020 OUT &H70,128
1030 Y=INP( &H71 )
1060 IF Y < 16 THEN PRINT "0";
1070 PRINT HEX$(Y);"  ";
1080 PRINT RIGHT$("   "+STR$(Y),3);
1090 NEXT
------------------------------------------
change the DATA statement in the following to contain the values displayed
by the previous program for locations 0E to 32 (hex) inclusive.
------------------------------------------
10 FOR X = 14 TO 50: READ Y: OUT &H70,X:OUT &H71,Y:NEXT
20 DATA 0,0,16,0,240,0,49,128,2,128,1,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,69,128,1,25

+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+
| ARPA:  RALF@B.GP.CS.CMU.EDU            "Teaching COBOL ought to be          |
| AT&T:  (412) 268-3053 (school)          regarded as a criminal act"         |
| Snail: Ralf Brown                           --- Edsger Dijkstra             |
|        Computer Science Department                                          |
|        Carnegie-Mellon University      DISCLAIMER?  Who ever said I claimed |
|        Pittsburgh, PA 15213            anything?                            |
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+
-- 
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+
| ARPA:  RALF@B.GP.CS.CMU.EDU            "Teaching COBOL ought to be          |
| AT&T:  (412) 268-3053 (school)          regarded as a criminal act"         |
| Snail: Ralf Brown                           --- Edsger Dijkstra             |
|        Computer Science Department                                          |
|        Carnegie-Mellon University      DISCLAIMER?  Who ever said I claimed |
|        Pittsburgh, PA 15213            anything?                            |
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+

reintom@rocky2.UUCP (Tom Reingold) (03/15/87)

In article <910@hropus.UUCP>, spj@hropus.UUCP (Stephen P. Johnson) writes:
> I recently purchased an AT clone, which has four penlight batteries
> inside. My friend says this is to backup the parameter ram which
> stores the hard disk partitioning info, amoung other things, and that
> when the batteries are removed for replacement or just plain run down,
> I will lose the ability to access my hard disk.
> 
> Are there any programs or known methods for backing up and reloading
> this parameter ram after the batteries are replaced?
> 
> Steve Johnson  (201) 615-4980

It's not really hard to do it the "hard way".  Go through the setup
program that was supplied with the computer.  Write down the values
that you have already entered.  When you have to re-enter them after
changing a battery, refer to your sheet.  In my program, there are only
nine options to set:

	1. Date
	2. Type
	3. Type of floppy drive for drive A:
	4. Type of floppy drive for drive B:
	5. Type of drive for first hard disk
	6. Type of drive for second hard disk
	7. Type of display adaptor
	8. Amount of memory below 1 Megabyte
	9. Amount of memory above 1 Megabyte


-- 
Tom Reingold;  The Rockefeller University; 1230 York Av; NY 10021
PHONE: (212) 570-7709 [office]; (212) 304-2504 [home]
ARPANET: reintom@rockefeller.arpa BITNET: REINTOM@ROCKVAX
UUCP: {seismo|ihnp4|yale|harvard|philabs|phri}!cmcl2!rna!rocky2!reintom

ralf@b.gp.cs.cmu.edu (Ralf Brown) (03/15/87)

Oops!  In my last message, I forgot to mention that you will need to set the
time and date after restoring the NV-RAM (unless you want to modify the second
program).  I didn't include the locations containing time and date since
they obviously change while the rest of the RAM doesn't unless you run the 
setup program.

	RALF@B.GP.CS.CMU.EDU

-- 
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+
| ARPA:  RALF@B.GP.CS.CMU.EDU            "Teaching COBOL ought to be          |
| AT&T:  (412) 268-3053 (school)          regarded as a criminal act"         |
| Snail: Ralf Brown                           --- Edsger Dijkstra             |
|        Computer Science Department                                          |
|        Carnegie-Mellon University      DISCLAIMER?  Who ever said I claimed |
|        Pittsburgh, PA 15213            anything?                            |
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+

neighorn@qiclab.UUCP (Steven C. Neighorn) (03/17/87)

In article <910@hropus.UUCP> spj@hropus.UUCP (Stephen P. Johnson) writes:
>I recently purchased an AT clone, which has four penlight batteries
>inside. My friend says this is to backup the parameter ram which
>stores the hard disk partitioning info, amoung other things, and that
>when the batteries are removed for replacement or just plain run down,
>I will lose the ability to access my hard disk.
>
>Are there any programs or known methods for backing up and reloading
>this parameter ram after the batteries are replaced?
>
>Steve Johnson  (201) 615-4980

Many PC clones come with penlite batteries glued to the power supply instead
of a battery pack on the motherboard. They are a bit easier to replace and
you can steal them from your camera flash or radio if the computer set runs
down. The batteries are used to power the cmos RAM that contain several
paramters in the PC/AT system: These paramters are: Time, Date, Type of
Floppy disk drive for A:, Type of Floppy disk drive for B:, Hard disk unit
0 type, Hard disk unit 1 type, Type of display (mono, 80 column color, 40
column color, or special, ie ega), amount of memory below 1meg (640k for
DOS), and amount of memory above 1meg (extended memory in the AT accessible
by unix, xenix, vdisk /E, and disk caches).

If you remove the batteries from the system, after a few seconds the cmos
RAM will revert to system default values, which are: Drive A: High Density,
Drive B: None, Hard Drive Unit 0: none, Hard Drive Unit 1: none, Display
type is read from a switch on the motherboard, and memory is set to what
the system detects.

The reason you lose access to your hard drive is not that you lose partition
information on the drive, that is stored *on* the drive. Since after battery
power loss, the drive unit types are set to 0. The system doesn't think you
have *any* hard drives.

All you have to do to regain access to your hard drives is replace the
batteries, and run any of numer of setup programs, IBM's original AT
setup disk included. If the clone is worth its salt, it should boot IBM's
disk. Most clone packages I have seen come with their own (usually better)
setup programs.

Remember after changing cmos information, you must reboot the system for
the new settings to be usuable.

-- 
Steven C. Neighorn                tektronix!{psu-cs,reed}!qiclab!neighorn
Portland Public Schools      "Where we train young Star Fighters to defend the
(503) 249-2000 ext 337           frontier against Xur and the Ko-dan Armada"
QUOTE OF THE DAY ->                'Dr. Ruth is no stranger to frictionapa

wtm@neoucom.UUCP (Bill Mayhew) (03/18/87)

Loosing your battery backed ram shouldn't be a terrible event.
Generally, all you should need to do is rerun the setup program
that is included on the diagnostic floppy that should have come
with your mahcine.  Even if you loose that parameters in the
battery RAM, your ROM BIOS ought to still be able to boot from a
360K floppy (even if you have a 1.2 meg drive as A).

One thing you should do is to jot down on the inside cover of your
manual is the "type number" for your fixed disk.  You can run the
setup program to find out what it is now, if your dealer set up the
machine before you got it; just be careful to exit setup without
changing anything.  For instance, a Seagate 4051 is type 11.

If you ever loose battery power, re-entering the fixed disk type
code should be enough.  If you have to, you can re-run setup every
time you cold-boot until your replacement battery pack arrives (if
you have a lithium battery).  Those replacement battery ads in
magazines are pretty annoying in that they make it sound like the
battery going dead will ruin your machine.

  --Bill

Bill Mayhew, Engineering Office
Division of Basic Medical Sciences
Northeastern Ohio Universities' College of Med.
PO Box 95
4209 State Rte. 44
Rootstown, OH  44272  USA    phone:  216-325-2511
(wtm@neoucom.UUCP    ...!cbatt!neoucom!wtm)