Resurrecting an XT

The best laid plans of mice and men oft go awry. At least that’s what we’d tell ourselves if we couldn’t find a 30-year-old computer monitor. [Andrew] picked up an old IBM XT on eBay recently and tried to get the video working. He hasn’t seen any success yet, but the way he goes about solving this problem is very clever.

[Andrew] was stuck with a cool old computer with no way to output anything onto a screen. The XT had an MDA port but neither his TV nor his VGA monitor would accept MDA frequencies. As a workaround, [Andrew] connected an Arduino to the XT keyboard port. On the factory floor, IBM workers used the XT keyboard to load code onto the machines while POSTing. He was able to change the frequency of the MDA CRT controller to CGA frequencies, and with the help of some small components got some video working.

The Hsync and Vsync are still off, and [Andrew] hasn’t been able to get the machine to finish POSTing, but he figures he can use the XT keyboard port for bidirectional communication. He’s written a very small kernel to test out a few things, but unfortunately the XT’s power supply died recently. Once [Andrew] replaces that, we’re sure he’ll get his box up and running.

Post navigation

28 thoughts on “Resurrecting an XT”

I’ve fixed the power supply now, replaced the video card with a CGA and written a “Hello World” program in ROM BASIC. Unfortunately there’s a bad RAM chip somewhere so I’m currently limited to 192Kb until I write some code to track it down. Also, the BIOS is doing something odd with the keyboard port – it’s lowering the clock line briefly at some point which is confusing the Arduino.

Damn that’s hardcore. I mess about with old bits of hardware loads but I still have no idea where these guys pick up such low-level stuff. ‘Track down bad memory sectors you say? I’ll need a logic probe, Jaffa cakes, some techno beats and twenty minutes’.

I’m not sure if it’ll be of interest to you, but if you wanted to test your 8088 code on a modern machine, I’ve made a fairly accurate 8086 processor library. It’s made in C++, slow as hell, but it’s easy to add virtual interfaces to and it’s as accurate as I can tell without having a physical 8086 in front of me.

@Earlz, cool project – thanks! The link seems to be broken though. I believe the 8088/8086 emulator used in MAME and MESS has proper pre-386 behavior, though it isn’t cycle exact. One of the reasons I’m messing about with this old hardware is to try to make a cycle-exact emulator.

@SquantMuts, the only documentation of the manufacturing test mode in the BIOS is in the BIOS ROM assembly listing itself in the technical reference manual:

;————————————————————————
; LOAD A BLOCK OF TEST CODE THROUGH THE KEYBOARD PORT :
; FOR MANUFACTURING TEST. :
; THIS ROUTINE WILL LOAD A TEST (MAX LENGTH=FAFFH) THROUGH :
; THE KEYBOARD PORT. CODE WILL BE LOADED AT LOCATION :
; 0000:0500. AFTER LOADING, CONTROL WILL BE TRANSFERRED :
; TO LOCATION 0000:0500. STACK WILL BE LOCATED JUST BELOW :
; THE TEST CODE. THIS ROUTINE ASSUMES THAT THE FIRST 2 :
; BYTES TRANSFERRED CONTAIN THE COUNT OF BYTES TO BE LOADED :
; (BYTE 1=COUNT LOW, BYTE 2=COUNT HI.) :
;————————————————————————

Looking elsewhere in the listing, you can see that this routine is accessed when a device on the keyboard port returns 65H instead of the normal AAH in response to a reset. Apart from that it works just like a keyboard from the point of view of the software (though the bytes coming in are length bytes and code bytes instead of scancodes).

I now have an ISA CGA card which works fine with the TV (no additional code or external circuitry required). I also have a scan doubler card which I hope will allow me to view the TTL output on a VGA monitor (with no additional code but a little bit of external circuitry to convert the voltage levels).

@Echoes, It’s an Orion TV1334A that I found at a yard sale down the road for $7 recently. Any CRT with a composite NTSC input should work though (I have seen some LCDs have trouble with the non-standard video signal).

True 8-bit VGA cards are hard to come by, however, 8-bit *compatible* VGA cards are neither rare nor expensive. Remember the Trident 8900-series cards? They’re 16-bit, but can be set to 8-bit mode just by changing a jumper. Same with most of the Oak and Paradise cards, and quite a few others too.

And the current crop of eBay listing aren’t representative of the going rate for the things, either… I don’t know of anybody actually buying them for those kind of prices. Put up a want ad on one of the vintage computer message boards, and you’ll find some for cheap.

Andrew, as another commenter said on your blog post directly, I have some older equipment that I could spare for your project. I believe I have an 8-bit VGA board you could have. I had no idea they were so expensive! Perhaps I could sell off a few of mine to retire, lol. As for the HD sound, it shouldn’t sound like metal grinding. That could be either a catastrophic head crash, or just bad bearings. Leave the HD powered up for a few minutes (or hours) to let them warm up and loosen the oil and the noise may go away. Also if I remember correctly, you should be able to remove all boot ROM equipped ISA cards (or just all of them but the video) and it should drop down into BASIC. That will let you know, at least at a low level, if everything is working correctly with the motherboard/ROMS. And of course, with the XT power supply, be careful with the voltages required. I don’t remember, but I thought it used something odd in there. Certainly an AT power supply could not be directly used. Contact me at my email address if you’re interested in the card.

@leadacid, I’d definitely be interested in an 8-bit VGA card. I don’t see an email address for you here but mine is andrew@reenigne.org.

Others have told me that these hard drives are expected to make these sounds, so it might be the case that the hard drive is working perfectly and is just empty.

As I mentioned above I have got into ROM BASIC (the tricky part there is pressing F1!) So I know the motherboard is working (except for one of the RAM chips – it only finds 192Kb).

The ATX power supply board is working fine now – I unsoldered the ATX power connectors and soldered in the original XT ones. The only strange voltage supplied by the XT PSU but not an ATX one is -5V, but that’s only used by old 16Kbit RAM chips, and this machine uses 64Kbit chips which don’t need it.

Actually there were interrupts you could use to write to the keyboard. The A20 gatehandler was in the keyboard and they had enough memorry in them to store the registers so that when you reset the cpu and went in to protected mode the first thing it would do is poll the keyboard and see if twhich mode it was supose to be in. then it would get the registers reload them and go.

@Glen, you’re thinking of the AT which had a microcontroller on the motherboard to talk to the keyboard (and control the A20 gate). PC/XT had no microcontroller, no A20 line and no protected mode – just a PPI and a shift register for talking to the keyboard.

Mine isn’t cycle exact either though. I believe it could be modified without major restructuring though to become cycle exact though. If it helps, the documentation I used building the emulator is from here: http://www.ousob.com/ng/iapx86/ it is extremely handy as a reference and lists opcode sizes, arguments, and cycles.

@Earlz, there are a couple of emulators which use those cycle timings, but they aren’t quite accurate. I think Michael Abrash had some more accurate timings in “The Zen of Assembler” because he did some experiments on real hardware rather than relying on Intel documentation.

Even then, these emulators still aren’t cycle exact because they don’t take into account the time it takes to transfer data (including instruction bytes) over the bus or the CPU’s prefetch queue, or effects like DRAM refresh cycles and device wait states.

MS-DOS had a TTY command to use a serial port in place of a monitor. But you probably had to write an autoexec.bat file first, requiring that pesky monitor…. but I’m also tapping a 20+ year memory of playing with XT’s.