IBM 5150

Description: The very first IBM PC that started it all…
Manufacturer: International Business Machines
Made in year(s): 1981 to 1987
Country of origin: U.S.
Status: Working

Now, let me introduce this article by stating that – by no means is this a complete description of the first IBM Personal Computer, nor that it tries to explain what it was all about – because there’s literally tons, and more tons, of good material on the Web, about this great-grandfather of the modern computing device we all are accustomed to today. Besides, chances are that you might be currently reading this article on a machine equipped with an x86(_64) CPU, dynamic RAM and some kind of a disk drive in it…. nudge nudge. As such, the purpose of this article is to go through a couple of tweaks, quirks and pitfalls that can be of an interesting read to a collector, experimenter or a tinkerer, like me and many others around. But since you’re on this webpage, I don’t think there’s any need of explaining this any further 🙂

There’s just something about those two full height drives, isn’t it?

And even if what followed afterwards in this market segment, i.e. the XT, AT and the PC-compatible clones of other companies; the era of DOS, followed by OS/2 and Windows, was not a great example of how it should have been in the first place…. everyone can play pretend to be a general after the war. As such, during the eighties and nineties, IBM, Intel and Microsoft dictated where the way should go, and the IBM PC and “PC-compatible” was a term to be reckoned with.

The back panel, with a 230 volt PSU conversion (see below).
Without taking the screws off, the generic state of preservation of any of these machines can quickly be estimated by taking a look at the paint job, the PSU vent cover, and the ISA brackets.

Mainboard: My particular 5150 was obtained from the U.S. market production, and the mainboard is of the later Revision B, with the latest BIOS dated 10/27/82. These later mainboards were fully populated with 256 kB of RAM, or 4 banks of 64 kB RAM chips (1 bank soldered in, the other 3 socketed); and this is because of software bugs in this latest BIOS revision; they need to be all populated in order to work properly.
And, of course, to get the rest of the user-addressable RAM to 640K (the upper 384K memory area, below the real-mode addressable maximum of one megabyte, which is reserved for video, BIOS, DOS, disk interfaces, etc.), you need to use an ISA expansion card, with a maximum of 384K of RAM on it. In addition, this type of a card is not limited to act as a RAM expansion only. These were made also to provide a serial interface, real time clock, game ports, et cetera – in one package.
To distinguish between the first IBM 5150 revision A, just from the photos, take a look at the PSU color around the power connectors; the first revisions have the PSU painted all black. Also, on the case, observe the presence of a white marker with the B in a circle, and the absence of a connector “cut-out” above the Keyboard/Cassette ports, these are very characteristic of the later “B” revision. Also, the first revisions have a marking on the motherboard that states “16KB-64KB CPU”. These also have an older BIOS revision, and won’t support EGA or VGA graphic cards, as they cannot load any ROM BIOS expansion chips.

Under the hood, with two Tandon TM-100-2 double-sided, double density drives, and a 110 volt, 63W PSU

In both Rev. A and B, the computer shipped with an IBM floppy disk controller card (pictured in the first ISA slot near the CPU). Without external modifications, this controller supports media with a double-density recording only. For 5,25″ drives, that’s a 360K capacity per disk (9 sectors, 40 tracks, 2 heads, 512 bytes per track). Also, 3.5″ drives can be connected, both internally or externally (more on this below), yielding 720K disk capacity.
However, the very first Revision A’s shipped with a single-sided Tandon TM-100-1. With a double-density recording, that’s 180K per disk, i.e. only one disk head/side is utilized. These single-sided drives can be instantly distinguished from their two-sided successor counterparts: take a look at the PCB connectors on the bottom right of the drive. In case of a single-sided drive, there’s only one 4-pin connector from the head, instead of the two you can see in the photo above (two 4pin connectors marked with a “5” and “6”, per each drive).

Battery corrosion damage on the ISA slots from an expansion card

Battery corrosion damage: This is a very common problem appearing with vintage hardware like this, that employed the usage of a couple of nickel cells, in series in a battery, to provide backup power for an RTC clock on an optional expansion card (in later PCs on the mainboard itself, to keep the BIOS settings, before lithium button cells took over). Of course, the BIOS in a classic IBM PC, is configured by means of DIP switches and jumpers, so it does not require any batteries to keep its settings… And the 5150 PC does not keep time after being switched off (not without an expansion card at least).
Here, with the time keeping card installed, and the machine not being in use for a decade or two, the nickel battery is deeply drained by the electronics maintaining the date and time. Each nickel cell with a nominal voltage of 1.2 volts, to make up 3.6 volts when in series, gets deeply discharged far beyond that voltage. And of course, each cell gets discharged differently, so: one with more voltage on it, starts “charging” the other… and since they are in series, in reverse polarity. This causes the electrolyte, potassium hydroxide, to seep out and react with the conductive traces on the printed circuit boards, where it forms copper carbonates and all sorts of corrosion products.

Corrosion neutralized

Since the electrolyte is alkaline, the only way to manage this, is to get rid of the leaky battery and neutralize the corrosion with a diluted acid, i.e. acetic acid (household vinegar) or phosphoric acid (Coca-Cola), then cleaning it with distilled water and alcohol, in order not to leave any acidic deposits from the cleaning process. And this can only be helped to an extent: during the cleaning, the corroded PCB traces can flake off, requiring rewiring or re-soldering. Furthermore, if the corrosion breaks the circuit in a multi-layered PCB, the game is over then, and the circuit most likely won’t be helped.
It’s also a good idea to ditch any nickel batteries in vintage systems completely, that means also not installing any new ones. Each and every single one will start to deposit KOH when “recharged” in a reverse polarity (i.e. that’s what the cells do in series when they get deeply discharged).
Oh, and the aforementioned ISA expansion card was a Quadboard QuadRAM from 1982… And its timekeeping had to be set through a BASIC script, with the date suffering from Y2K problems. The battery was ditched without replacement 🙂

Running the SuperSoft ROM diagnostics for the IBM 5150, placed in socket U33 through a 2364-to-2764 PROM adapter.
Ignore the U28 system BIOS error. I forgot to put the BIOS chip back in 🙂

ROM diagnostics: Having this done, the mainboard was still acting up a little, sometimes getting all sorts of weird POST error codes during boot, that were not documented even. This was mitigated by re-seating the CPU in its socket, and carefully applying 300°C to the whole of the mainboard, by means of a hot-air gun, followed by running the Landmark/SuperSoft ROM diagnostics, to verify proper functionality of the hardware.
This was done by programming a 2764 EPROM with the diagnostics software, and placing it instead of the system BIOS inside the U33 socket. Of course, since the IBM 5150 only accepts 2364-series of PROMs, I had to do away with a makeshift 2364-to-2764 adaptor, since I didn’t have any 2364 PROMs or 2364-capable programmers on hand.
Yes, the very same adapter I use for launching BootLPT/86 as a last-resort solution, before the ROM BASIC loads. 🙂
Oh, and you don’t need to use a video adapter for the diagnostics ROM to work: with documentation, you can listen to the cassette relay clicking and PC speaker beeping, to see what went wrong. And, if you have a VGA card, you won’t be able to use that either. 🙂

Japanese-made NEC 8088, the socket above is for a math co-processor (FPU 8087)

5150CAXX: Speaking of the cassette relay clicking… yes, the cassette interface is something that went gone forever, starting with the IBM PC/XT. Well, at least, the physical interface from the mainboard. It took IBM quite a few years until the cassette BASIC disappeared for good, even from their ROM code…
Even though no one ever cried over the missing tape interface in the successor models of the PC, and no proper software was shipped on tapes, even for the actual 5150 that had support for it (well, except for a couple of “IBM Diagnostics” tapes, to verify proper functionality of a floppyless 5150), I’ve decided to resurrect the tape interface so that it will also work from DOS, where it was never ever implemented.

230 volt conversion of the system PSU (Rev. B)

230 volt conversion: Yes, both Rev. A and Rev. B of the American 110 volt variants of the 5150 power supply can be easily converted to work with a 230 volt mains supply. There’s even an article which mentions this for the revision A, the “black” power supply.
But even for the revision B, the process is quite simple: both 110 and 230 variants from the factory, internally work with 320 volts rectified DC, like a modern ATX power supply does. So, to get 320 volts DC out of mains 110 volts AC, you use a half-wave voltage doubler (2 electrolytic capacitors and 2 diodes). To get it out of a 230 volt mains supply, you use a full-wave rectifier (4 diodes), with the two 200 volt electrolytic caps connected in series to each other, as a filtration capacity right after the rectifier.
This is how the 115V/230V switch in conventional ATX PC power supplies behaves like. But here, we have no such switch at all, so we need to add in 2 extra diodes and rewire the circuit from a half-wave doubler to a full-wave bridge rectifier, with a capacitor filter.
However, in the PSU of a 5150, there’s also a feedback circuit: a cascade of five resistors in series, connected straight with 110 volt mains. This resistance needs to be doubled, to be able to be connected with 230 volts, either by replacing each resistor in the stack with twice its value, or by replacing the resistance with a single or two resistors of sufficient wattage, as I did above. However, care must be taken, as there’s a Molex power connector next to these resistors – there might not be enough headroom to fit it in. Check that first.
Apart from that, you also need to replace the X2 EMI filtering foil capacitors with 250V~ variants, if the supply has an EMI filter PCB (which it usually has), and also the power supply fan, if it is the 110 volt variant. In here, you have three options: either you replace it with a 12 volt fan, and connect it to the 12 volt output inside the PSU, or you replace it with a 230 volt fan, or…. you keep it there and add some capacitive reactance in series with the fan, to limit the maximum current through the fan. An X2 capacitor of some 100nF, perhaps? 🙂 And then you’re done!
Or you can just keep the PSU as it is, and just run the PC from a 230/110V stepdown transformer, as I did previously. It is a switched-mode power supply that works with DC on the primary, so it does not care between 50 or 60Hz. But, I had a 230 volt IBM 5151 monitor arriving at that time, which plugs directly into the second power connector of the PSU (and uses the power switch of the computer as its own). And of course, that 230 volt monitor wouldn’t work on 110 volts from the PSU.

Tandon TM-100 head calibration screws

Floppy drive re-calibration: Bzzzrrrr-bzzzrrrrt—CLACK!!…. Beep….Disk boot failure“.
Yes, welcome to ROM BASIC. I can feel your pain 🙂

A situation like this usually requires inspecting the Tandon floppy drive. The head(s) are not very easily accessible, but still you need to keep them clean. To do a thorough cleaning with some cotton swabs and a solvent, you need to take out the two screws of the main control PCB on the top of the drive, disconnect the two 4pin connector(s) on the bottom of the PCB, then push it slightly behind and lift carefully up. This should give you enough clearance to carefully lift the heads with your finger, and clean them with swabs dipped in some acetone or perchlorethylene (avoid the plastics !!! Or use isopropyl alcohol if you are not careful). There’s actually a nice little document about performing this kind of maintenance, keeping the heads clean, the head guide rods a little bit lubricated, etc.
However, if all of this does not help, and the drive seems to have intermittent reading or writing problems, especially on media used in other floppy drives, the heads might have been misaligned, and you need to realign them.

Re-calibrating the floppy drive using Dave Dunfield’s IMD

Before commencing with the calibration, you need to again verify that the heads are clean, the track 0 switch works, the head stepper motor can move without obstructions and also the RPMs of the spindle are correct. This can be easily verified with a 50 or a 60 Hz strobe (like a mains fluorescent lamp), as the spindle has a strobe pattern in the bottom of the drive, where the belt drive is.
Because this floppy drive was made in USA, for the Allen (Inbus) screws you are going to loosen, you will also need corresponding inch-pattern Allen keys. The metric ones won’t fit inside the sockets!
Now, the classic way on performing head alignment requires the usage of a special alignment diskette, an oscilloscope, and a service manual to know which test points on the main PCB need to be measured. And then you twist the alignment screws so that you get the maximum voltage amplitude…

Luckily, you don’t need to do it like this. There’s a special DOS utility you can set the alignment with, as I did: the ImageDisk IMD (pictured above), which has an Alignment check. And instead of a special alignment floppy disk, you can use a good known OEM disk of some commercial software, that has (presumably) never been written to. In my case, I’ve used an installation diskette of Norton Commander. You need to make sure that it is a double sided, double density disk – do not attempt to use a high-density media to calibrate a DD drive.
The steps how to follow with the head alignment are inside the how-to document linked above. The only problem is that you need to run IMD from a RAM drive, or a hard drive – you cannot run it from a (different) floppy drive, it just gives you “General Failure reading drive” DOS errors upon loading. This is because IMD works with the floppy controller directly, and it resets it upon startup, confusing the DOS.
What you really need to make sure, is that the drive is reading the correct track, on both heads (that’s the first column of numbers) and all the (9*2) sectors are read properly (key D), no matter where you seek the heads, i.e. with +- 1 track increments, or +-10, or even from beginning (0.track) to end (39. track).
A misaligned drive will read only a partial number of sectors correctly (the last column of numbers shall always be 0, i.e. zero sectors read incorrectly), and the PC speaker “beeping” should always be high-pitched and time-consistent between reads. In the worst case, the drive will read a completely different track number, or you get question marks instead.
Also, if the alignment cannot be set at all with the screws, and there’s no valid data read from the drive (question marks wherever you seek), the electronics might be shot, or the cable/connector from the head can be cut or improperly contacting.
And also, certain floppy disks might be shedding oxides and dirtying the head, like a reel to reel tape when it exhibits the “sticky tape syndrome”. As such, if your floppy drive is making screeching or squealing noises, especially when there are circular marks being chiseled into the magnetic medium, the culprit is debris on a dirty magnetic head, that you need to take care of.
Note that with the bottom head assembly retaining screws loosened, the upper head can droop down a little, especially if you take the floppy out before tightening the screws again. Take care not to rip out head 1 while inserting the disk back into the drive, rendering the drive permanently single-sided. 🙂

Reader beware! If you really a have misaligned drive, read this: remember that you need to calibrate your drive thoroughly – you mustn’t just rely on that last column of wrong sector count, even if you see a good track number for your position. Because – after you get that right – you then need to perform read tests, using the D key. All (9) sectors must be read without any hiccups, from any given track and head. Focus especially near track 0; the middle of the floppy (track 20) and the last track (39), on both heads.
Also, be sure to test the Track 0 switch/detent, by seeking to a random track and pressing the R key, which will “recalibrate” the drive: seek to zero, where the switch engages, and then seeks back where you were. An improper Track 0 detent setting usually manifests with a “machine gun” sound of the stepper motor, and/or an inability to read tracks 0 and 1 (or the last tracks) properly.

One of the worst things that can occur during the diagnosis, is a drive that has also the upper head misaligned. If this is suspected, you need to just perform the longitudinal alignment (cam screw adjustment) for head zero; the lower head, which is “fixed”, cannot move laterally and rides together along the whole assembly. Forget about twiddling with head 1 until you get head 0 spot on.
Then comes the trickiest part: by unscrewing the top supports of head one, it will move in three ways: longitudinal – up and down, lateral – from left to right – and with skew: the head needs to be perfectly parallel in both X and Y axes. And this requires precision adjustment: first to get the correct track number on head one, then all the sectors to be read properly, and then come the write tests, to determine if the head is perfectly parallel. Format the floppy in the drive being diagnosed, and then put the disk in a good working drive (test with e.g. DISKCOPY A: A:, which will show up improperly written tracks on the given head).
A drive that has a mis-centered or skewed head 1 alignment, will, most likely, read other floppies fine AND write its own floppies fine – but those disks will not be readable in other drives on side 1. This will lead up to data corruption, and boy, it did…

Connecting an external floppy drive

External floppy drive: The vanilla IBM floppy controller allows you to connect up to 4 floppy drives; 2 internal and 2 external; both 5,25″ or 3,5″, but only supports double-density media (without modification), as explained above. However, whatever you do, IBM 5150 only allows you to boot the system from the very first internal floppy drive (read: the one after the cable twist). Since the front panel of the machine is accustomed for a full height drive, a small 3,5″ would look ugly in such a big hole. So it’s better to make yourself a cable that can be connected to the back of the floppy controller’s ISA card, and allow it to be connected as an external floppy drive, e.g. to share data with a “modern” computer with a USB floppy.
The thing here is to use the shortest possible cable (like above), or use a proper cable with shielding. I’ve tried a full-length unshielded cable, to connect up to 2 floppy drives, only to get “sector not found” and all sorts of data errors. Note that if you make a short cable to connect one drive only, the cable must be twisted, otherwise it won’t work. And also if you plan to connect external 5,25″ drives, make sure they’re terminated properly!

“Proper” 720K support: Since high-density 1.44MB is out of the question.. One hint I’d like to add, if you plan to use an external 3,5″ drive, is to set the jumpers on the mainboard only for how many internal floppies do you have, i.e. either 1 or 2. If you set the jumpers so that there are three floppies (2 internal, 1 external) in your system, the external drive will be automatically mapped by DOS as “C:”.
However, the BIOS in a 5150 predates 720K floppy drives, so DOS will get improper drive parameters from BIOS. And it’s going to format your 3,5″ floppies in a very non-standard way, 40 tracks instead of 80, yielding only 360K usable capacity. The trick is to use DOS DRIVER.SYS and forget about setting the external floppy by using jumpers.
Now if you use both the jumpers and DRIVER.SYS instead of just using DRIVER.SYS for an external floppy, DOS will map A: for the first internal drive, B: for the second internal drive, C: for your external floppy with the weird 360K access, and D: for your external floppy with “proper” 720K access… so choose only one 🙂
And a second hint: to share data between the 5150 and a “modern” machine using a floppy disk, remember that not all of “modern” USB floppy drives support double-density, 720K-formatted media. Your best bet are those old “IBM”-branded floppy drives…

Twin graphics card setup (TESLA PMD-60.1 displaying MDA and TESLA Merkur displaying 40-column CGA)

Graphics cards: Two graphics cards are installed inside the machine: an unnamed clone of the MDA/Hercules with a parallel port, based on the NEC TM6066 chip, and a CGA clone “Twinhead CT-7030” also with composite output. In theory, you can have a maximum of 3 co-existing graphics cards in an IBM 5150, that is, without resource conflicts: the MDA, CGA and the PGC… Well, if you were crazy enough.
Until EGA and VGA came along, the Hercules+CGA was a favorite combo: the Hercules for high-resolution monochrome graphics and crispy text, plus the CGA to get some colors out, or to get it connected with a TV (with a cinch composite NTSC input).
Unfortunately, the “Twinhead CT-7030” Color Graphics Adapter does not output proper NTSC colors on its composite cinch jack, and unlike a proper IBM CGA, it is not clocked off the mainboards’ 14.318MHz crystal oscillator to get the NTSC colorburst, so the C.ADJ variable capacitor on the mainboard doesn’t have any effect here:

Twinhead’s CT-7030 CGA attempt at a colorful composite NTSC video out

IBM 5151: The classic green-screen monitor to go along with the IBM Monochrome Display and Printer Adapter, or MDA, if you prefer. Can be also used to display monochrome graphics if you have a Hercules card, as both MDA and HGC use an 18.43 kHz horizontal sync.
In addition, I had to tweak the display geometry to get a proper, non-squished picture. Inside the monitor, there are trimmers available to set the constraints of the image, however you need to be careful while disassembling it, as a particularly heavy part (the mains transformer with its chassis) flexes on the plastic cover and the plastic looked like it could snap easily.
And, unlike a TV, these monitors have a bright and slowly fading green phosphor, which makes for a very cool effect, especially when texts are fading out. As such, you need to be careful and use screensavers (or manually turn the brightness down) in order to prevent a phosphor burn-in!

IBM 5151 after tweaking picture geometry.
I’ve used a modified variant of the TV TESLA PMD-60.1 to sync on MDA before I had this fine piece…

Parallel port boot: And last but not least, shall your floppy or hard drive boot fail, it might be a good last resort idea to try booting from a parallel port, before handing over execution to the Cassette BASIC… 🙂
For those interested, I have also made an 8K ROM binary of the XTIDE Universal BIOS, combined with BootLPT/86, that runs on the IBM PC silently (without messages written on-screen) and attempts to boot from A:, C:, the LPT port and ROM-BASIC, in this order.
This binary is pre-set to use an XTIDE rev1 controller in 8-bit mode at port 0x300, and has the correct checksum applied.

BootLPT/86Inside the BIOS expansion socket through a 2364-to-2764 adapter

3 Replies to “IBM 5150”

  1. Fascinating read and the first time I’ve seen boot via lpt.
    I notice for this Rom you placed it directly on the board and you referenced making a silent XT ide Rom. Can this also go direct on the board instead of having its own board to host it via an isa slot either on an explicit XT ide card or via a network adapter?

    I’d like to explore this further if so.

    XT ide can redirect to boot from a multi i/o card using the 8bit ide channel on some 16bit cards. Does the xtide Rom you indicate have this functionality. Secondly could the Rom also be used to give additionally functionality like full hd disk support for a 1.44mb floppy again using a controller that supports this.

    See references to this on the lotech page added here:

    This details the use of the 16bit card for both those items but have yet to see it in a single Rom.

    Be great to learn more if you would be open to it and I’d be happy to try it on my 5150 further.

    1. Yes, the ROM can be placed elsewhere too. For example, an XTIDE controller has its Universal BIOS in a socket whose memory address is mapped during POST – in here, I put my modified version.
      High-density-capable floppy controllers do exist in 8-bit cards too, e.g. the Seagate ST02 SCSI controller has one.

Leave a Reply

Your email address will not be published. Required fields are marked *