Wednesday, June 8, 2011

Old Gear Lives On: A Hack (Part 2)

Hi all,

I've wanted to document the technical side of some hardware hacking for quite a while. Here it is, continuing from the less-nerdy first part.



The project: Turn a 286-based Compaq Portable III into something more modern.



The motivation: to be honest, my sole motivation here was to be able to haul it down to Cafe Prado, a thou-shalt-be-at-least-this-hipster-to-enter coffee shop on Commercial. Nobody's allowed in without at least a Macbook Pro and I wanted to plunk this beast down on a reinforced surface and see what happened.

The obvious problem is that a Compaq Portable III is a 286. This is state of the art circa 1982 -- far too old to run Linux. For a long time the Linux kernel needed the next generation, a 386, to run, though now I see that Damn Small Linux requires at least a 486 so it's possible that times have moved on.

This suggests a pretty thorough gutting and rebuild of the portable. At minimum I wanted to maintain the overall appearance of the machine -- the case and external appearance, but also the keyboard and inimitable orange screen. However, as with many portable devices, it's heavily integrated and the parts are custom-built. The keyboard uses a standard AT plug, but the display was going to be a problem -- it's not as simple as plugging a VGA connector into a different video card.

Getting it to boot

As it came to me (via Free Geek Vancouver, thank you very much) the machine displayed a POST error because its CMOS settings were long forgotten and COMPAQ didn't include a configuration program built into the BIOS as any modern PC-based system has. It also contained a 20MB hard drive, one of the first "modern" IDE drives, fortunately, which permitted me to remove and wipe it using our usual tools. (There is beauty in connecting a 25-year-old drive to the disk wipe station using the same connectors you use to hook up a run-of-the-mill 80GB drive -- that's 1600x the capacity running through the same old plugs.)

Machines without their own BIOS setup program built in typically use configuration floppies instead, meaning that you have to track down the specific setup program on a specific kind of media (5.25" floppy, in this case) in order to get the machine to boot. (Disks fail and replacements are hard to find. I remember fighting angrily with IBM's failed MicroChannel platform on this count.) Some searching online revealed, miraculously, that COMPAQ still has images of the configuration disks on their own FTP site, 25 years later! (Are you listening, Apple, who only grudgingly support anything older than last week?)

Getting this file off the Internet and onto a 5.25" floppy drive is trickier than it seems. The downloaded software itself includes a DOS tool to write the disk. I ended up using a chain of old machines -- my modern laptop for starters, then an old Pentium tower running FreeDOS from a CD to write the disk itself, then the Portable III to boot from the resulting 5.25" disk. (And where did I find 5.25" floppy disks in this day and age? Value Village, against all odds -- still sealed in plastic wrap, bagged with a stained purple change purse and a broken flashlight for $3.99.) I'll spare the full painful details of all this, but it also involved a 3.5" floppy disk, precision-applied electrician's tape, modified wiring, and a hazy recollection of X86 BIOS quirks.)

At the end of it all: the machine booted to FreeDOS from a clean hard drive. 20MB, 12MHz, and 640KB ought to be enough for anyone, right? Well, no, not in a world where a web browser can devour hundreds of megs all by itself. And that's RAM, never mind hard disk space.

Adding a second computer

Deciding to keep the built-in screen with all of its aesthetic joy imposed some real limits on the approach. If I wanted to keep the screen, I had to find a way to interact with it from some faster hardware. Could I cut in between the screen and the controller, by splicing into the ribbon cable? That would require a lot more technical mojo than I had to offer. Between the display controller and the motherboard? Probably a lot closer to standard, since I would imagine the display adapter (CGA-ish) would connect to the motherboard via the ISA bus standard, although of course there is no standardized card slot. But still very tricky.

The option I decided to pursue was to keep the whole shebang -- the entire 286 computer and all of its peripherals -- and use it as a serial terminal. There's a little pocket of space inside the chassis, probably for an optional modem to be installed into, and I happened to have an AAEON single-board computer
(SBC) that could fit into it once some of the structural plastic was removed from the internals of the chassis.

Here's the back of the unit with the case off:

You can see the full expanse of the 286 motherboard, complete with two populated 30-pin ram slots at the top of the picture. There is an expansion jack (with a black plastic cap currently in it) just above the midpoint of the right-hand side. The I/O jacks available from the back of the machine are at the top left: a parallel printer port, serial port, and CGA video jack.

You can also see the SBC jammed in diagonally. Here's a closer look:

The I/O ports of the SBC are set back far enough from the rear of the case that they are not externally visible. In fact, when installed, there is no visible difference at all after this modification. The SBC steals power from the built-in power supply, and takes its cooling from the built-in cooling fan.

It was a very tight fit -- the diagonal angle is necessary. I also had to dremel a couple of corners off the SBC to make it fit. For example:


You can see a small grey ribbon cable snaking under the motherboard in the above picture -- not the huge one on the right-hand side, but the smaller one in the background to its left. This is how the SBC communicates with the 286. It's soldered to the serial port on the underside of the motherboard:

The SBC itself has a few USB ports, and I installed into one of these a USB wireless dongle to give the thing the ability to speak to the outside world via a wireless network. (The SBC also has built-in audio capabilities, and I intend to add a couple of internal speakers too.)

So there we have it: no visible changes at all when the machine is closed up, but internally, there is now a complete second computer that can speak to the original 286 (and thus its screen and keyboard) through a serial port, and can connect to the outside world through a wireless network.

Software on the SBC

The SBC has a 512-MB CompactFlash drive installed, running a trimmed-down version of Debian Linux. It's no speed demon but it does the trick. I have the lynx text-based web browser pictured below:

I can control my stereo through the mpc / mpd suite of tools (I might write this up later), and I can ssh/sftp around the Internet. This is all done invisibly over the serial link through the 286, described below.

Software on the 286

There's a surprising amount of free (as in beer) software for this ancient platform. FreeDOS, mentioned above, is the operating system. The '90s-era X86 platform is still widely used for embedded systems, as the hardware is dirt cheap, reliable, and doesn't usually need cooling fans. FreeDOS is a minimal, capable operating system and a lot of developers cut their teeth on the stuff. DOS may be long gone from the home computer scene, but it's still running in more places than you think.

Embarcadero Systems, which took over the reigns from venerable Borland, released Turbo C as freeware -- this was the best-loved C compiler for the PC platform for years. I remember saving up paper route money to buy a $400 educational copy of Borland C++, on 12 floppy disks, probably back in 1994 or so. Seeing this again, running on a vintage machine, really took me back.

As a terminal program to communicate with the SBC, I used the excellent, respected, ancient and capable MS-DOS Kermit. It's the end of an era for this project: it'll be officially wrapped up on July 1st. Their news page has the whole history of the project, going back to 1754 -- well, 1981. This software has been through the mainframe wars, the BBS era, and survives on somewhere in the Internet renaissance. (They're releasing the source code to all their Kermit programs, permitting them to live on; see the news page for details.)

When FreeDOS starts, it displays a "Starting FreeDOS" message. I didn't want the two-computer trick to be visible during boot, so I wrote a small C program to modify the DOS binary by searching for "Starting FreeDOS" and changing it to "Booting Stage 1" instead. Insert satisfied nerd noise here.

FreeDOS boots directly into MSDOS-Kermit (anyone remember tuning autoexec.bat?), which is scripted to connect to the serial port immediately and start displaying what's happening there. Since both machines power on at the same time, when the switch on the back is flicked, they boot in parallel and the 286 hands over the terminal to the SBC as soon as it's ready. The whole thing is seamless.

Field trip to Cafe Prado


Well, I haven't gone to Cafe Prado with it yet. This project is finished (minus the speakers I want to install eventually) and provides a terrific combination of old-school aesthetics and modern connectivity. It's not useful for an enormous amount, since it's limited to a text-mode terminal, but I think that adds to its charm -- and you can accomplish an awful lot through a terminal. Web browsing, typesetting, programming -- I could even watch videos in text-mode if I had something faster than a serial connection. That's the UNIX heritage.

So maybe I'll head down to Prado to commemorate the end of the Kermit project on July 1st. If I do, I'll take some photos.

Thanks for reading! I've got a few more hardware hacks that I'd like to document here when I get the chance.

36 comments:

  1. (Note: I had originally written about G-Kermit when I actually meant MSDOS Kermit. I also erroneously credited GNU, when in fact the Kermit project was written at Columbia. Thanks again to the Kermit folks for their fine work.)

    ReplyDelete
  2. It probably wouldn't be too difficult to sit down with an oscilloscope and write chars to the screen, then make an arduino interface...

    ReplyDelete
  3. Quite possibly, Danly. I think the next step up might be replacing the display entirely -- I'm not sure if a 16MHz Arduino has enough zip for 640x400, and the thought of adapting an X11 driver gives me the heebie-jeebies.

    ReplyDelete
  4. Nice hack!!!
    I have the very same computer, but with the famous "long isa card piggyback extension". With an old ISA 10baseT 3Com adapter and the microsoft TCP/IP for MS-DOS add-in, you can be on Internet without hardware mod.
    If you cannot find this DOS exention (launched circa 1992) just add the KA9Q "The Nos" TCP/IP package, il will work ! (I swear, I did it... you sould adress the ethernet stuff with packet driver). You can also find an old "FTP Software" IP socket.
    Many thks for these memories...
    Marc

    ReplyDelete
  5. Hey Marc -- yeah, good thought; I think there are a few of those extension boxes floating around eBay. Heck, I could chuck a SCSI drive in there too just to see how a 286 looks with unlimited storage :)

    ReplyDelete
  6. Oh my ! It was my first portable and yep, VERY expensive at the time ... it died a glorious death shrouded in blue magic smoke released by the power supply ... I´ve spent countless nights drawing schematics wiyh OrCAD ... only a few months ago it was sent to its final resting place but I´ve have saved that nice screen hoping to make it work again someday ...

    Are you willing to measure the voltages feeding that little orange marvel ? It would help me a lot ...

    ReplyDelete
  7. You can now start up emacs and write cool stuff :D

    ReplyDelete
  8. jorloujr, I have a crappy multimeter but not an oscilloscope... it depends on what level of detail you're looking for.

    ReplyDelete
  9. Stellar hack man! If you're looking to use a scope come down to vancouver.hackspace.ca someones always there on Tuesday nights and your project will definetly draw some questions / accolades.
    cheers!

    ReplyDelete
  10. I'd retrofit a new LCD on the place of the plasma screen...buy a monitor with same size of the screen slab and adapt it inside the frame, you'll have the heaviest laptop around :)

    ReplyDelete
  11. I don´t need much detail really ... only the voltages and their polarities, any multimeter will fit the bill ...

    There is a connector on the middle of the board, the cable comes straight from the power supply and you will see a small diagram underneath the connector.

    Be careful, the most interesting voltage should be around 200V ...

    Thanks a bunch buddy ;-)

    ReplyDelete
  12. Alexandre, one can hardly call it a laptop, we´d be closer to the truth calling it a benchtop ;-)

    Even calling it a portable is poetic license ... it´s back breaking stuff ;-)

    ReplyDelete
  13. Not quite "steampunk" but great work!

    ReplyDelete
  14. No, an arduino of any kind will not run a 640x400 display, at least not anything that anyone would consider useful.

    I would find a small LCD screen of equal size and place that in the same spot. Then you can just run that through vga port off the new board.

    ReplyDelete
  15. That is AWESOME! Seriously... Kudos to you and nice work.

    That brings back some good memories. I also got my start on one of the Compaq portables (the predecessor to this model). I almost never write comments to articles, but this was just too good. And yes, I remember fiddling endlessly with autoexec.bat and config.sys to optimize the heck out the memory available...

    Working on that machine turned my life in a different direction -- honestly. I nearly went into the armed services but my work on that machine as a junior and senior in high school caused me to instead go off to college -- am now a technical architect and really love my work.

    Funny how one device can have such a profound impact...

    Anyway, LOVE IT! Thanks for sharing! Really enjoyed the write-up and including some of the details!

    Thanks!

    ReplyDelete
  16. I love the amber screen, please don't get rid of it. Have you considered installing pianobar on the SBC after you hook-up speakers to it and making it into a retro CLI-Pandora playing jukebox?

    ReplyDelete
  17. Stoked that people are enjoying this and that so many people remember the Portable III :)

    I wasn't aware of pianobar -- not a bad idea.

    jorloujr, I'll add this to my to-do list but I can't promise it'll happen fast. Stay tuned. (Art, thanks -- I might just do that. Haven't visited VHS, but have long intended to.)

    ReplyDelete
  18. I've been following this since the HackADay post and I must say, I've never been so inspired!

    Its turned my gears so much, that I hopped on eBay and bought myself a Portable III right away!

    Although I absolutely LOVE the retro hardware, I've decided to take it to the next level and replace the internals with modern hardware.

    I'll be making a build log as I go.

    The plan?

    Replace the internals in the display section (including the screen... sorry guys!) with the internals from a decent 10.1" Netbook.
    Gut the chassis and install a pair of large HDDs, and a decent external DVD burner. (perhaps a slot loading DVD burner to keep the 5.25" floppy facia)
    Install a decent desktop power supply, replacing the outdated 286 supply to feed the hungry drives.
    OR... use a couple of external USB enclosure interfaces and their power supplies along with a decent USB hub.
    Install the internals from a Buffalo wireless router running DDWRT.

    Finally, I've decided that this project would simply NOT work if I changed the keyboard. So I would like to keep the entire keyboard. I just need an AT to USB converter.

    Theres a few little details that I'm leaving out, but everything will be documented along the way as well as some high res pics.

    Also... Did I mention that I'm in Van as well?
    Maybe we can stick it to the hipsters at Cafe Prado together!

    Stay tuned!

    ReplyDelete
  19. Also, to those who were as inspired as me, and bid on the portable III on eBay... You snooze, you lose!

    ReplyDelete
  20. AUTUIN, take your time, I´m not in a hurry ... again, thank you very much ;-)

    ReplyDelete
  21. Brilliant, Katon -- lots of potential there. I'd suggest putting a red-blooded CPU in there; you'll probably have a hard time playing DVDs with a router chip, and there's lots of room for a good small form factor board. You might even be able to keep the built-in power supply. Let me know if you want to chat about it!

    ReplyDelete
  22. For sure!

    The plan is to cram the motherboard, Screen, HDD, and such into the display module.
    I'm shooting for an Atom N445 or so.. but I have an open mind. I haven't received my Portable III yet, so I'm not quite sure what kind of space I have inside the display module. I'm hoping it will all fit inside.
    So basically, the entire computer will be housed in just the display module alone. The back end of the Portable III will house the cheesecake hardware. (hard drives, router, etc.)
    I was also thinking about picking up a retro Compaq serial mouse, gutting it, and replacing the internals with that of a wireless bluetooth laser mouse. (To keep that 80's feel)
    I'm sure there will be enough room in the chassis to store the mouse for portability.

    My portable III is coming with the original nylon travel bag! (Sooooo cool!)

    Once I get all of my hardware gathered up, I'll be starting a build blog.

    I'd love to collaborate!

    ReplyDelete
  23. AUTUIN, just in case you ever bother checking the display voltages:

    There is a tiny diagram on the back of the display very close to the connector:

    http://tinyurl.com/6e7ucjh

    I´d like to make sure the voltages are

    -HV [5] to +HV [3]: ~ 200V
    -HV [5] to -LVCC [4]: 5V
    +HV [3] to GND [1]: 5V
    GND [1] to -HV[5]: (-200V) - (+5V) = ~ +195V

    Thank you very much !

    ReplyDelete
  24. Wow

    Every few years I pull my much loved Compaq out of that corner of the garage and have a quick play. Last couple of times I have thought of upgrading the internals - a few weeks ago I decided I would make a project of it.

    Two processes came to mind. the first was to use laptop components - very boring. the second was to create a desktop workstation in a lugable. Anyway decided on that portable workstation - but at low cost in case of total failure!

    Problems are internal spaces, power supply, cooling, external interface (case will need modding), and monitor. Looking at using an ITX and using an i7 or more probably llano (cheaper if all goes pear shaped). just looking at the various requirements and dimensions now - and found this blog!

    ReplyDelete
  25. Hey Techtopian, good luck! There's lots of room inside if you ditch the enormous power supply and use a small form factor motherboard. If you manage it, let me know and I'll drop a link from here.

    ReplyDelete
  26. Its funny, I just started a project tonight to turn one of these LCD panels in to a generic display, either serial console or full bit control. I can keep people posted if anyone is interested.

    Katon, I really hope you read this, since you are gutting one out and not using the LCD, I would gladly pay you for the panel and shipping. I posted on your blog as well.

    ReplyDelete
  27. This comment has been removed by the author.

    ReplyDelete
  28. I had 3 Compaq portable 386's (and 1 Compaq 486C) that I got in to for fun a year ago.. I gathered them so I could get all the upgrade memory boards to make one have 10MB for myself, the others I am selling.

    I sold one already, and the other I will be soon.. All three have new CMOS batteries, a stock-looking 3.5" floppy, 300MB hard drives, and 486 instruction set CPUs with the benefit of some cache you would not normally have..

    Mostly I love the nostalgia of the older software, it's rather fun to play with OS/2 and older versions of Linux. I found all the drivers and binaries needed to swap between the internal display and an external display using an ISA card.

    It is able to run Decent 1 decently, though not as well as I'd like. They have Ethernet and full internet access via either an ISA card or a Xircom parallel to Ethernet adapter. I found Netscape to work the best over IE, Opera and a few others, but still has a great deal of trouble with most all modern pages. My goal is to get an SSH client that will work with the driver and stacks I am using.

    The hipster cafe idea thing also was a first thought, but I am a bit embarrassed to follow through, for fear of being called a hipster myself. :p Instead I'll bring it to meetings at work maybe.

    ReplyDelete
    Replies
    1. Do the Xircom adapters work with linux? If you still have some Compaq parts for sale I might be interested. I have a parts 386 with 2Mb memory need to figure out how to test components. Also have a working Portable 386 dual boot Dos 6.2 and slackware linux kernel 1.2.1. Had kernel 1.0.9 linux-lite minimal install on 2Mb machine before it stopped booting. I am inexperienced at building pcs but am thinking about swapping out with a newer smaller power supply.

      Delete
  29. Hey Fox -- Good scooping. I've never run into a Compaq Portable 386 but that's definitely a big enough jump over the crippled-by-design 286 chip to be interesting...

    ...and I'm afraid to say that fear of being called a hipster is one of the main hipster indicators :)

    ReplyDelete
  30. "Some searching online revealed, miraculously, that COMPAQ still has images of the configuration disks on their own FTP site, 25 years later! (Are you listening, Apple, who only grudgingly support anything older than last week?)"

    Ahem.

    http://www.info.apple.com/support/oldersoftwarelist.html

    ReplyDelete
  31. My hat's off to you, Mike. I picked on Apple because of some iPhone-related stupidity, but that aside, it's nice to see official repos of truly ancient stuff. Thanks for the link.

    ReplyDelete
  32. For those that are going to re-use the keyboard, keep in mind that it's *not* an AT style keyboard, but rather the older XT style. You'll need a converter box to adapt the signalling.

    I have one of these dinosaurs that I tried to stuff a modern system into, and that one, tiny detail pretty much sank my changes of doing it in a stealthy manner. I ended up getting a newer clone-of-a-luggable chassis and modding the ever-living bejeesus out of it. (link)

    ReplyDelete
  33. Hey, nice work on the clone luggable!

    Your Compaq Portable III looked absolutely identical to mine at the start -- including the rotting keyboard wire sheathing. The fellow at http://compaqportable3.blogspot.com/ has similar plans in mind; not sure if the adapter he's picked out is going to work with an XT keyboard, but it's possible.

    ReplyDelete
  34. Oh man...I loved this thing. It was my very first pc. My cousin had brought it home from Ernest & Young, where he worked as an accountant.They had just given it to him, just to get rid of it.

    I used to write SO many stories on this. I wish I could find one and upgrade it. I'd totally toss more modern gear into it...tho I dunno. Maybe I should find two of these. Make one modernized, and keep the other one vintage...or restore it like this one.

    Thanks for the memories!

    ReplyDelete
  35. i bought a ISA backplane to make something old working again - 1x SBC 286 based - 8Mb - video - but no keyboard?
    1x P2/700 based - 256Mb - video - usb - lan - key/mouse - biosfried - working on that.

    The 286 needs a bit more attention
    i got a 4port floppy 8bit isa card
    opertional - 15+ 5.25" drives
    and a few 3.5" drives - you never know from
    what age/condition the software comes.

    but - enlightenment on the 286 would be nice

    found: dos 2.11, 3.1, 5

    ReplyDelete

Note: Only a member of this blog may post a comment.