The Compaq Portable and Deskpro
I'm only doing one page to cover both these machines, because Compaq's original Portable and Deskpro are very similar. Of the two, the Portable is the earlier machine, being Compaq's original product.
Hardware
The hardware of both systems behaves - just as you'd expect - very much like an IBM XT. There are a few physical differences, though:
- The keyboard connector on a real IBM is on the same side of the motherboard as the ISA slots, which means it comes out at the back of the PC. On the Compaqs, it's on the opposite side, so it's on the left-hand side of the Portable and the front of the Deskpro.
- The Deskpro, and later models of the Portable, omit the second bank of motherboard switches (which say how much RAM there is). Instead they probe the memory size automatically.
- The floppy controller card includes a parallel printer port, in an effort to reduce the number of cards needed. This was more of a concern for the Portable, which only has five expansion slots, than the Deskpro which has eight.
- The video card and accompanying monitor have a few tricks up their sleeves compared to the standard CGA or MDA you'd get on an IBM. As part of this, the video card has an extra connector on it which is used to drive the Portable's built-in monitor.
- The Deskpro's monitor uses a standard connector for video, but has a non-standard power plug (3-pin DIN). This connects to an extra power-out socket beside the expansion slots.
- The two cards that belong to the Portable (CGA and floppy controller) are much taller than standard XT cards - more like the colossal cards that came with the original AT. As part of this, the metal bracket that holds them in is also enlarged, and isn't attached in the usual way.
Video output
I describe two versions of the video card here. The one that was fitted to the Portable is the earlier one (Assembly no. 000007) and the one that was in the Deskpro is later (Assembly no. 000031). According to the service manual the design went through several more iterations: Assembly nos. 000160, 000345 and 000525.
Video output is the major difference between a Compaq (either sort) and the original IBM. The cleverness is partly in the video card, and partly in the ROM BIOS.
At the time the Compaq Portable was released, IBM users had the choice of MDA or CGA video. MDA has a single high-quality 80×25 text mode with 9×14 character bitmaps, while CGA has grainier 80×25 and 40×25 text modes (with 8×8 character bitmaps) and 640×200 or 320×200 graphics. The matching IBM monitors are single-frequency, so an MDA display can't display a CGA signal or vice versa.
The trick that the Compaq computers play is that the Portable's built-in display, and the Deskpro's mono monitor, can display either type of signal. Therefore the CGA's graphics modes and its 40×25 text appear as usual (albeit in greenscale rather than colour) but its 80×25 text mode is replaced by the higher-resolution MDA version.
This is all very well, if you're using a Compaq monitor that can change scan rates like this. If you're not, there are various provisions:
- If the video card in the Portable is in the high-resolution mode, it does not send any signal to the external monitor socket. That way, an external monitor won't be damaged trying to display signals it can't cope with.
- By default the card in the Deskpro doesn't do this, because the Deskpro monitor connects to the external socket and needs the high- resolution signals. However, the original behaviour can be reinstated by changing a couple of jumpers, so the same card can be used in the Portable.
- The Deskpro can also be set to use a CGA monitor rather than a Compaq one. This is done by turning motherboard DIP switch SW6 on: if so, the CGA 80×25 mode is used rather than the high-resolution one.
- It's possible to switch between the high-resolution 80×25 mode and the standard CGA one by using key combinations. CTRL + ALT + < selects the CGA-compatible mode, while CTRL + ALT + > selects the high-resolution version. This is the only way to get the Portable to display 80×25 output on an external CGA monitor.
The method used by the card to detect what resolution to use is very simple: if the CRTC character height register is 13 (ie, characters are 14 rows) then it goes into the high resolution mode. If not, it behaves like a normal CGA.
The card in the Deskpro has an extra feature: It can be made to display text attributes like an MDA does (ie, you only get bright and underlined) rather than in 15 shades of green. This feature only applies in the high-resolution mode, and it's selected by setting bit 7 of the CGA control register (port 03D8h).
Turbo / Power LED
The Deskpro has a turbo mode, which is controlled by I/O port 0CFh. The BIOS writes 0 for slow (4.77MHz), 1 for fast (8MHz). The power LED indicates which speed is in use: red for slow, green for fast.
The status of this setting can be read from the bottom bit of port 62h (1=fast, 0=slow).
The DIP switches
Compaq still have PDF files on their FTP site describing the DIP switch settings for both the Portable and the Deskpro. My Deskpro also has a sticker listing the switches, which doesn't quite match the PDF file. To summarise:
Switch | Portable | Deskpro (PDF) | Deskpro (sticker) -------+-----------------------+-----------------------+--------------------- 1 | Reserved (always off) | Reserved (always off) | Off: Normal | | | On: Enhanced | | | 2 | ------------------------ Numeric coprocessor ---------------------- | Off: 8087 installed | Off: 8087 installed | Off: 8087 installed | On: No 8087 | On: No 8087 | On: No 8087 | | | 3,4 | --------------------------- Memory size --------------------------- | Reserved (always off) | Both on: 640k | Both on: 640k | | 4 on, 3 off: 512k | 4 on, 3 off: 512k | | 4 off, 3 on: 128k | 4 off, 3 on: 128k | | Both off: 256k | Both off: 256k | | | 5,6 | ------------------------ Initial video mode ----------------------- | Both on: EGA | Both on: EGA | 5 on: CGA 24x80 | 6 on, 5 off: CGA 40 | 6 on, 5 off: CGA 40 | 5 off: MDA 24x80 | 6 off, 5 on: CGA 80 | 6 off, 5 on: CGA 80 | 6 on: IBM monitor | Both off: MDA | Both off: MDA | 6 off: Compaq monitor | | | 7,8 | ------------------------ Floppy drive count ----------------------- | Both on: 1 | Both on: 1 | 7 on: 1 | 8 on, 7 off: 2 | 8 on, 7 off: 2 | 7 off: 2 | 8 off, 7 on: 3 | 8 off, 7 on: 3 | 8 is "always on" | Both off: 4 | Both off: 4 | -------+-----------------------+-----------------------+---------------------
The Portable has a second set of DIP switches (like the original IBM PC) to set the memory size. BIOS revisions C and later ignore these and detect the size automatically.
To expand on the differences between the two sets of switches for the Deskpro:
- Switch 1, which the PDF says should always be off, is called "Compatibility". It should be off for "Normal" and on for "Enhanced Functions". As far as I can see, its main effect is to change the way the keyboard buffer is handled -- presumably switching between being 100% IBM-compatible, or slightly incompatible).
- Switches 5 and 6 (governing the initial display mode) differ.
This could be because of a different BIOS ROM revision; mine is
revision E but the PDF says 40×25 mode is only available in
revision F and later:
SW5 | SW6 | Result according to sticker | Result according to PDF ------+-----+-----------------------------+------------------------------------ On | On | 80×25, CGA monitor | 80×25, add-on EGA or VGA Off | On | 80×25, MDA monitor | 40×25, Compaq monitor (ROM rev F) On | Off | 80×25 CGA, Compaq monitor | 80×25, Compaq monitor Off | Off | 80×25 MDA, Compaq monitor | 80×25, add-on MDA ------+-----+-----------------------------+------------------------------------
"80x25 CGA" and "80x25 MDA" mode refer to the feature (above) of whether the text attributes in high resolution mode work like the CGA or the MDA. - The sticker shows Switch 8 (allowing configurations with 3 or 4 floppy drives) as "Always on" (ie, 1 or 2 floppy drives).
Firmware
The BIOS in these computers is very similar to what you'd find in an IBM PC or XT, as you'd expect. There are a few differences:
- The Compaq ROM signature is a 6-byte string at F000:FFEAh: "COMPAQ". The ROM revision level appears to be a 4-byte string at F000:FFE6h. There is no BIOS date at F000:FFF5h.
- As mentioned above, there's support for the enhanced CGA card. Part of this involves switching between the high- and low- resolution versions of the 80×24 video mode when the CTRL+ALT+< and CTRL+ALT+> key combinations are detected.
- The video registers table (pointed to by INT 1Dh) is only 64 bytes long, and therefore contains only the 6845 registers. The other bits of the table (video buffer sizes, columns on screen, etc.) are stored elsewhere in the ROM.
- Unlike most subsequent XT clones, the Compaq ROM BIOS does attempt to support the ROM BASIC interrupt (INT 18h). It doesn't include a full BASIC interpreter; rather, if BASIC is invoked, it asks the user to insert the Compaq DOS disk, and then attempts to launch BASICA.EXE (which, unlike the IBM version, works as a standalone interpreter).
- There may be a problem or incompatibility with the way the keyboard buffer is implemented. DOS Plus specifically checks for the "COMPAQ" signature above, and if it is present initialises the keyboard pointers at 0040:001A, 0040:001C, 0040:0080 and 0040:0082 to their default values. There are similar workarounds in DRDOS, Concurrent DOS, K3PLUS and FreeKEYB.
- On the Deskpro, the keystrokes CTRL+ALT+plus and CTRL+ALT+minus (using the grey keypad keys) control the obtrusiveness of the keyclick beep. This is stored at 0040:006A. CTRL+ALT+backslash toggles turbo mode.
Floppy Tape Drive
My Deskpro originally had a floppy tape drive fitted. I haven't studied this device in detail. It's an Irwin Magnetics model 110, and its circuit board has a Z8 microcontroller with a 2732 ROM holding firmware.
Real Time Clock
The serial card in the Deskpro has a battery-backed real time clock. A custom CLOCK.SYS is provided to communicate with it. From the code, I would guess that the clock chip is an MM58167, mapped between ports 02C0h and 02DFh.
CLOCK.SYS detects the clock by checking that the top 7 bits of the value read from port 02D4h are zero [This is the 'status bit' register on an MM58167]. All values held in the clock are BCD, and get converted to and fro in reads and writes.
The MM58167 has 8 bytes of memory, which in the Compaq are used thus:
Register Meaning 08 Status flag? If this is not either 0C0h or 0D0h it is set to 0C0h. It also seems to be used by the leap year check. 09 The month last time the clock was checked. If this is greater than the current month then the year has rolled over (the MM58167 does not check for year rollover) 0A Year (presumably minus 1980). 0B Set to 0DEh when the status flag is reset.
Software
CPQPATCH patches the BIOS of the Portable (revision C) so that it can boot from a hard drive controller that doesn't hook INT 19. Somewhat specialised, but there you go.
John Elliott 12 August 2008.