PCjs Machines

Home of the original IBM PC emulator for browsers.


COMPAQ DeskPro 386 ROMs

Originally, the oldest COMPAQ DeskPro 386 ROM I had was a Rev J.4 ROM from a “Version 2” motherboard designed in 1987, released in 1988, and purchased on eBay in October 2014.

Compaq DeskPro 386 System Board Version 2

And thanks to folks on the Vintage Computer forums, I was later able to add the Rev N.1 ROM from 1989 to this collection. And when I obtained a DeskPro 386/25 from eBay in March 2015, I was able to add the Rev K.2 ROM.

More recently (January 2018), I discovered that I still had a copy of the 1986 Rev F ROM, which I had made on April 22, 1987, using one of the early DeskPro 386 machines that Microsoft had purchased for the OS/2 development team. The only downside of my Rev F ROM image is that it was dumped using the DOS DEBUG utility, since I didn’t have ROM reader hardware in those days.

Fortunately, since I wasn’t sure how large the ROM actually was, I had dumped the entire 64Kb from F000:0000 through F000:FFFF. As it turns out, that entire address range is actually write-protected RAM (since RAM provided faster 32-bit access), where the first 32Kb contained a modified copy of the second. For example, the first 32Kb contains some data structures that are updated by COMPAQ utilities such as CEMM to record “Built-in Memory” allocations.

Sure enough, attempting to use the first 32Kb as a DeskPro 386 ROM generated a “ROM Error”, no doubt due to a checksum mismatch. However, the second 32Kb appeared to work fine. I can’t guarantee that its contents are identical to the original Rev F ROM, since it was not a direct copy of the physical ROM, but it’s all we’ve got. All the PCjs EGA-based COMPAQ machine configurations have been updated to use that ROM.

This collection of COMPAQ DeskPro 386 ROMs still has several holes, but I’m very happy to have finally found one of the earliest (if not the earliest) ROMs commercially available for this line of COMPAQ computers.

System ROM Locations

COMPAQ DESKPRO 386 System Board Version 2 (Assembly No. 000558-001)

U13 (EVEN)
U15 (ODD)

System ROM Revisions

Rev  Even ROM #  Odd ROM #   Size  Date
---  ----------  ----------  ----  ----
E    108285-001  108284-001
F    108328-001  108327-001  32Kb  1986-09-04
G    108328-002  108327-002
H.8  113270-008  113269-008
J.4  109592-001  109591-001  32Kb  1988-01-28 (from a 386/16 motherboard)
K.2  109592-003  109591-003  32Kb  1988-05-10 (from a 386/25 motherboard)
M.1  109592-004  109591-004
N.1  109592-005  109591-005  32Kb  1989-04-14	

1988-01-28.json was created with the following FileDump command:

cd 1988-01-28
filedump --file=109592-001.hex --merge=109591-001.hex --output=1988-01-28.json

For a more human-readable dump, use the --comments option:

filedump --file=109592-001.hex --merge=109591-001.hex --output=1988-01-28.dump --comments

Similarly, 1989-04-14.json was generated by first creating 1989-04-14.rom from the two 16Kb BIN files provided by Al Kossow:

cd 1989-04-14
filedump --file=archive/109592-005.U11.bin --merge=archive/109591-005.U13.bin --output=archive/1989-04-14.rom --format=rom
filedump --file=archive/1989-04-14.rom --output=1989-04-14.json

Dumping the ROMs

The .hex files for the 1988-01-28 DeskPro ROM were produced by running eeprom_read on a chipKIT Uno32 Arduino-compatible prototyping board, and capturing the serial port output on my MacBook Pro – as outlined in “Stick a Straw in Its Brain and Suck: How to Read a ROM” by NYC Resistor contributor phooky.

The DeskPro 386 ROMs were P27128A-2 chips, so I wired my Uno32 based on this 27128A datasheet – the closest match I could find online.

<img src="photos/Compaq_DeskPro_386-16_System_ROM_V2_Breadboard-640.jpg" alt="Compaq DeskPro 386 System ROM Version 2"/>

On my first dump attempt, every ROM address returned 0xFF. After looking at the 27128A datasheet more closely, I noticed the DEVICE OPERATION table indicated that, for a READ operation, /CE and /OE pins should be connected to INPUT LOW VOLTAGE, while the /PGM should be connected to INPUT HIGH VOLTAGE. So I wired pin 27 (/PGM) to +5V instead of GND, and the dump worked perfectly. The NYC Resistor article implied that every active low pin should be connected to GND, but apparently there are exceptions to that general rule.

Recreating ROM Source Code

In the current directory, an original ROM can be regenerated from the JSON-encoded file:

cd 1988-01-28 filedump –file=1988-01-28.json –output=1988-01-28.rom –format=rom

The ROM can then be fed into NDISASM, the disassembler included with NASM:

ndisasm -o0x8000 -se105h -se05ah -se6ffh -sf025h -sf8aah 1988-01-28.rom > 1988-01-28.asm

The -o0x8000 argument is required to “org” the file at the proper starting address, but the -s arguments are optional; they simply establish a few sync points within the ROM image that save a little cleanup effort, by preventing disassembly in the middle of instructions.

Next, the PCjs TextOut command, with the –nasm option, prepares the code for reassembly:

node /tools/old/textout/bin/textout --file=1988-01-28.asm --nasm > temp.asm
mv temp.asm 1988-01-28.asm

The result, 1988-01-28.asm, after a small amount of manual cleanup, can now be successfully reassembled:

nasm -f bin 1988-01-28.asm -l 1988-01-28.lst -o 1988-01-28.rom

However, it does NOT produce a binary identical to the original ROM, in part because of instruction ambiguities (ie, instructions that can be assembled multiple ways). It’s possible the reassembled ROM may still work, but more research is required.

Authors of the COMPAQ DeskPro 386 ROM

One interesting section of the COMPAQ DeskPro ROM is this string at offset 0xE002:

db	'AUTHORS CAB93GLB93RWS93DJC93NPB(C)Copyright COMPAQ Computer Corporation 1982,83,84,85,86'

which presumably contains the initials of 5 authors: CAB, GLB, RWS, DJC, and NPB.

This was later confirmed by HPE firmware engineer Thomas Palmer, who still works at the location of COMPAQ’s headquarters in Houston, Texas. On June 19, 2018, Thomas arranged a reunion for the authors and as many other COMPAQ engineers as he could locate, all who worked on early COMPAQ products and still lived in the area.

Thanks to Thomas, I was able to attend the reunion, and the engineers who worked on the DeskPro 386 were gracious enough to sign my copy of the COMPAQ DeskPro 386 Technical Reference:

COMPAQ DeskPro 386-25 Technical Reference Guide - Volume 1 - 1988-08 - Signatures

Of the 5 people whose initials are embedded in the original DeskPro 386 ROM, only GLB was unable to attend.

The meaning of the “93” sequences in the ROM was originally unclear – I thought they were likely some form of obfuscation – until I saw this snippet of COMPAQ ROM source code and we were able to talk to Mike Perez about it:

  page  58,132
title CMESG Copyright (c) 1982,83,84,85,86,87 COMPAQ Computer Corp.
;  Name:  CMESG - Copyright Message
;  Group: ROM
;  Revision:  A
;  Date:  November 6, 1987
;  Authors: Mike Perez
;  --------   --------   ------------------------------------------------------
;  12/31/87   Original    Adapted from DESKPRO 386 Revision J.1/G ROM.
; This module supplies the Copyright and notice in the ROM.  This
; module must start at F000:E000 on COMPAQ, COMPAQ PLUS, DESKPRO
; and Magnum.  On Magnum, however, this is not the first module in
; the ROM, since it is composed of a single 32kx8 ROM doubly-mapped
; at F000:0 and F800:0.  On the COMPAQs and DESKPRO, the system ROM
; is an 8kx8 ROM that starts at F000:E000.
; The sum of the words at F000:E008, E00A, E00C, E00E, and E010
; must equal 2457h for "Exploring the PC"  and possibly other
; programs to work.
; Public Declarations
  public  _CMESG      ; ...So it shows up in the link map
  PUBLIC  _INIT     ; CTRL-ALT-DEL entry point
  public  COMPAQ    ; For general use
  extrn bas_main:far    ; BAS_MAIN Entry to BASIC intercept
; External References

Mike explained that an IBM program called “Exploring the IBM Personal Computer” contained some code that checksummed the first few bytes of the ROM and would refuse to run if the result didn’t match that of a genuine IBM PC. So one of the COMPAQ engineers simply inserted a series of characters (“93”) between their initials which, when checksummed, yielded the same result.

This was one of the many hallmarks of COMPAQ’s devotion to compatibility.