Home
IBM 5162  -  Performing SETUP Using BASIC Code


IMPORTANT:   The following assumes that your IBM 5162's motherboard is fitted with IBM 5162 BIOS ROM's, i.e. not swapped out for non-IBM ones.
If non-IBM BIOS ROM's are fitted, the following may not work (it depends on the particular BIOS).


Requirements

* A 'modern' Internet-connected computer.


Assumptions

* The 5162 is presently displaying either a 161, 162 or 163 error.
* If a hard drive is present, it is an MFM type and connected to IBM's hard/floppy controller card ("IBM Fixed Disk and Diskette Drive Adapter").


Notes

* 'Base memory' is an early IBM term for what later became known as 'conventional memory'.
* 'Expansion memory' (do not confuse with 'expanded' memory) is an early IBM term for what later became known as 'extended memory'.


STEP 1: Replace the Battery

The probability is extremely high that the 5162 has lost its configuration/setup because the internal backup battery is dead.

If the error is 161, you can be very sure that that is the case.  Note that simply replacing the battery with new won't remove the 161 error - the error won't disappear until you go complete all 8 steps of this procedure.
I've seen some 5162 motherboards that do not detect dead batteries.  They instead go on to display a 162 error.  And so do not assume that lack of a 161 error means that the battery is okay.

Measure the battery voltage if you can.  If you do not have the capability to measure the battery voltage, assume that the battery is dead.

For battery details, click here


STEP 2: Put the 5162 into BASIC

2.1 [5162]  Power on the 5162.  You'll see some errors - we expect that.
2.2 [5162]  You will be prompted to press the F1 key.  Do so.  That will take the 5162 into BASIC.


STEP 3: Determine BIOS revision in 5162

No need really.
IBM produced only one revision for the 5162:  revision 04/21/86
But note that, for use in a later step.


STEP 4: Determine Base RAM amount in 5162

At this point, BASIC is running on your 5162.

4.1     [5162]  Type in the following BASIC code.

   def seg = &h40
   print peek(20)*256 + peek(19)

4.2     [5162]  Note the figure that is displayed.  We'll use that figure in a later step.


STEP 5: Determine Expansion RAM amount in 5162

At this point, BASIC is running on your 5162.

5.1     [5162]  Type in the following BASIC code.

   out 112,48
   low = inp(113)
   out 112,49
   high = inp(113)
   print high*256 + low

5.2     [5162]  Note the figure that is displayed.  We'll use that figure in a later step.


STEP 6: Determine the IBM Hard Drive Type Number

MFM type hard drive not present:  The IBM hard drive type number is 0.
MFM type hard drive is present:  Click here for information on how to determine the IBM hard drive type number.


STEP 7: Generate BASIC code

On your 'modern' Windows based computer, you will now run a special program that will generate BASIC code for the next step.

7.1 Download GSETUP_BASIC.ZIP then unzip its contents (GSETUP_BASIC.EXE).
7.2 On your 'modern' Windows based computer, run the unzipped GSETUP_BASIC.EXE
7.3 [GSETUP_BASIC]  In the 'BIOS' box, select the BIOS revision date that was determined at step 3.
7.4 [GSETUP_BASIC]  In the 'Base memory' box, select the amount of base memory that was determined at step 4.
7.5 [GSETUP_BASIC]  In the 'Expansion memory' box, select the amount of expansion memory that was determined at step 5.
7.6 [GSETUP_BASIC]  In the 'Drive A:' box, select the type of floppy drive that drive A: is.
7.7 [GSETUP_BASIC]  In the 'Drive B:' box, select the type of floppy drive that drive B: is (use 'None' setting if no B:).
7.8 [GSETUP_BASIC]  In the 'Drive C: type' box, select the number that was determined at step 6.
7.9 [GSETUP_BASIC]  In the 'Drive D: type' box, select 'None' (assumption: there is no D: drive).
7.10 [GSETUP_BASIC]  In the 'Display type' box, select the display type.
7.11 [GSETUP_BASIC]  In the 'Coprocessor' box, select the correct option.  The coprocessor is an optional 80287 chip fitted into socket U76 (near the keyboard socket).
7.12 [GSETUP_BASIC]  Click on the 'Generate' button.  BASIC code will appear (in green) in the box below the 'Generate' button.
7.13 [GSETUP_BASIC]  Block (highlight) the BASIC code then use a CTRL-C key combination in order to copy the code.
7.14 Paste the code into Notepad (or similar) then from within Notepad, print the BASIC code.


STEP 8: Enter BASIC code on 5162

At this point, BASIC is still running on your 5162.

8.1 [5162]  Being very careful, type in the BASIC code that was produced in step 7, noting that lines starting with "REM" can be omitted (they are remarks/comments).
8.2 [5162]  Power off the 5162.
8.3 [5162]  Wait 10 seconds.
8.4 [5162]  Power the 5162 back on.