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.
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.
I think I’ve still got an original monitor (and machine) in the crawlspace. Might have to dust it all off.
Back in those days, I used a program called Checkit to help determine where a memory problem might be.
But that said, it usually wasn’t bad RAM so much as it was bad connections. Re-seating everything, with a bit of Deoxit DN5 for good measure, might just bring it fully back to life.
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’.
Let’s have an update when you’ve got it rocking :-)
i was unaware of low level stuff at the keyboard input, kudos to any success!
Neither was I aware of the low level code via the keyboard code. Andrew can you provide some links how you found that out? Any more details?
One option is to either get a ISA VGA board or translate the MDA to VGA by using an FPGA with some RAM memory. ISA VGA’s are getting more and more scarce and I am holding on to the two I already got.
Problem with installing an ISA VGA board in a XT is usually the 16 bit part being blocked by some chips on the mainboard.
@SqantMuts there are 8bit ISA VGA cards. I had one once. You think the 16bit are rare? Hehe
I have one 8-bit vga isa card and 2 xt pcs… sitting in garage, collecting spiders and rust…
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.
The name of it is x86Lib. It’s quite old now, and you’ll want to check out the latest version from source control. It’s at sourceforge: http://sourceforge.net/projects/x86Lib
Just figured it might be kind of useful for this niche project. I’ve failed to find any 8086 CPU emulator that doesn’t follow the behavior of the 386/486 in real-mode
@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).
Out of curiosity, what TV is it? I have a CGA card in one of my XTs but I can’t find a monitor for it (in Italy, at least).
I already have an 8-bit ISA VGA (most 16-bit VGA cards will work anyway, just try them) but I need the CGA to boot Xenix 8086.
@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).
Some (not all!) CGA cards have a NTSC composite output on an RCA jack.
Also, EGA monitors are pin-compatible and perfectly capable of displaying the output of a CGA video card. It might be easier to find an old EGA display than an older CGA one . . .
They’re not that rare, just very expensive. A quick flick through eBay showed around 20 cards at least 2 of which are 8-bit. But you’d have to love your pc 30-130GBP seems to be the going rate.
Awesome! My dad had an old XT in his office when I was growing up. It was the first computer I sat down in front of.
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.
@Andrew Ah, SF became case sensitive sometime since I made the original website. Look here instead: http://sourceforge.net/projects/x86lib
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.
A screen? Who needs a screen?!?
PR#0
Wait a second…
I just want the case or an old AT case to mod!
Woot! My first computer. Glad to see someone trying to get one going and not just hiding a mini itx mobo inside.
Diamond SpeedSTAR ISA with Tseng chipset is a 16-bit card that will work in an 8-bit slot. They are relatively affordable.
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.