Building A Serial Bus To Save An Old Hard Drive

Universal Serial Bus has been the de facto standard for sending information to and from computer peripherals for almost two decades, but despite the word “universal” in the name this wasn’t always the case. Plenty of competing standards, including USB, existed in the computing world in the decades before it came to dominance, and if you’re trying to recover data from a computer without USB you might have to get creative with how it’s done.

[Ben] recently came across a 80486 with this problem, so he had to get creative to recover the contents of the drive. He calls it the “lunchbox” computer due to its form factor, and while it doesn’t have USB it does have a tried-and-trusted serial port to communicate with other computers. [Ben] wrote up a piece of software for both the receiving computer and the sending computer in order to copy the drive sectors one by one across a serial link to a standalone computer running Windows XP, and was able to recover the contents of the drive that way instead.

All of the code [Ben] wrote is available on his GitHub page for anyone looking to boot up a 30-year-old computer again. While it might sound uncommon, computers of this vintage are still around running things like CNC machines or old mainframes.

67 thoughts on “Building A Serial Bus To Save An Old Hard Drive

          1. Correct. At my work we have two CNC lathes that are amd k6 era hardware and dos 6.22. one was rocking a 20gb HDD from 2002. The HDD took a dump last week.

            On that drive sat a single 2gb partition for dos and only like 22mb of used space lol.

            Solution was a 8gb slc/industrial cf card and a pata to cf card adapter. Which is fully passive but does have jumpers to select 3.3v or 5v to power the card.

            All that was left was to fire up virtual box and do a dos install to a 2gb vdmk. Then use Rufus to burn the vdmk to the cf card and the mfgs floppy to reinstall the CNC software.

            Then after confirming it works I imaged the cf card with Macrium reflect incase I need it again.

            Worked like a charm

    1. Most of those older HDDs used way too much power on both 5 and 12 V sides while most current USB to ICD drives are 5 V only. I recall my first 5.25″ HDD (all of 5MB !!) used an ST-506 card and almost burned out my ol clone AT+ power supply (and it cost $549). IDE is based on the ST-506 cable interface (a lot like the ISA bus, based on the 8080 processor pinout).

      1. Yeah, but you only need to hook up the signal cable. You can let the luggable’s power supply continue to feed the drive power.

        Don’t get me wrong, what he did is cooler but definitely took the long way around. :)

        1. Indeed; the usb to IDE/SATA bridge I have came with a power supply specifically for the drive, with a tap to power the bridge device itself and a handy-dandy molex to sata power adapter. (In fact, it’s probably going to get used tomorrow to wipe a 500 GB sata drive along with the USB drive dock I have…)

          Cool trick, but me, I got stuff to _do_.

      2. You’re confusing the 44-pin laptop IDE interface with the 40-pin desktop IDE interface. The former uses 2mm pin pitch and supplies 5V power, while the latter uses 0.1″ pin pitch and doesn’t supply power. It is true that a laptop IDE drive might use more power than a USB cable can provide, but this is easy enough to work-around with a soldering iron and an external power supply.

      3. ST-506 was a complicated interface, akin to a floppy interface. Raw data and pins to step the drive. The interface connected the drive to a controller.

        IDE put the controller on the drive. Which meant the interface was a subset of the CPU pins. Software apart, you can easily add an IDE interface to an old computer, basically some buffers.

        1. It is extremely unlikely a 486 of any kind would have had ST-506 disk, even less so in that “lunchbox” format (those drives were HUGE!). Those were used only in XTs and maybe a very early PC AT machines. A 486 machine would have had a normal PATA (IDE) drive.

          1. ST-506… I’m pretty sure that’s what I knew as an MFM hard drive.

            I worked on several 486 PCs that used those.
            Of course that was only because I was building them from scavenged components from junk PCs of several eras back when they weren’t old enough to be collectibles and new PCs were still large investments.

          2. Heh, I had at least one in at least one 486 machine too for same reasons. I dunno if it’s that easy to comprehend nowadays just how expensive storage (and monitors) were prior to about 2002. Sure the numbers seemed to get bigger through the 90s but software was bloating at the same rate. So for a constant $150 ish, you only got enough space for windows and a couple of applications. Anyhoo, so you used whatever you could get your hands on mid 90s.

            On a 486 though, being way faster than the XT or 286 box that the MFM might have started life in. you got wayyyy more performance if you re-did the interleave on the drive. So instead of chugging at like 250kb/sec read it jumped up to 800kb/sec which is around what you’d get from older IDE drives also. Shame about the seek times, but it sure did wake them up a bit.

      4. There’s also a ESDI, an in between of ST412/ST506 and IDE.
        The drive has a bit of electronics, but still needs a dedicated HDD controller to function.
        Unlike IDE, which had its controller on the drive (an ISA IDE “controller” really is a simple host adapter, a businterface. IDE is like simplye subset of AT-Bus/ISA.)

        Some late 80s SCSI drives were ESDI based, I believe. They had a translation board installed.

        Anyway, both ST412/ST506 controllers and IDE HDDs (aka AT-Bus HDDs previously) talk the same controller language (WD1003).

        That’s why an old AT-BIOS from the mid-80s can talk to both MFM/RLL fixed-disk drives (like ST506) and IDE. In fact, it does not even differenciate between those to. All it sees is a WD1003 or compatible HDD system.

        – The exception to this is an 8-bit “ISA” HDD controller, maybe. It’s made for XT class system and thus has its own HDD BIOS in the form of an Option-ROM. That BIOS will take over control during POST. Because, XT architecture was different (no Real-Time Clock by default, no CMOS Setup, etc.)

        1. 8 bit MFM and RLL controllers had their own BIOS. One had to use DEBUG to access the low level format routine in them. You were supposed to enter the list of defects on the label on the drive. I always tried it first without and most of the time it worked fine. https://kb.iu.edu/d/aaoa

      5. “older HDDs used way too much power”

        Meh

        That reminds me of the Orange Pi. It has a SATA connector which is supposed to only be plugged into low power laptop or solid state hard drives. I’m pretty sure they said not to use a desktop mechanical hard drive in the directions and I know I saw a lot of people writing the same on the internet.

        Whatever!
        I use mine as a NAS with a plain old mechanical 3.5″ drive. It’s been going strong for years!

        Just don’t power the drive through the wimpy device. Only connect the data connectors. Instead connect the power to a supply that can handle it. In my case I also power the Banana from that same supply. Since the USB adapter would pull it’s power from the USB connection I would also suggest tying the grounds together. If the grounds were at different potentials you could be running all sorts of voltages through there!

      1. Given that he didn’t open the machine at all, he most likely didn’t even check. A 486 SX/DX running Windows XP for sure didn’t support any older drive standard (like MFM) and if plain DOS on that machine sees the drive without any extra controller messages or drivers being loaded, it is most likely a normal PATA/IDE drive.

        1. Who said I didn’t ever open the machine? That is one of the first things I did. :-) And I think you misunderstood what happened.

          Just as some of the comments here imply, I used an old version of PC DOS on the Lunchbox as the sender and a (somewhat) modern machine, running WinXP as the receiver. The receiver could have been anything as long as it had a standard Serial Port, any operating system and file system, and with room on that file system to store a 100Meg file.

          The sender, the Lunchbox, was running an old version of PC DOS. The type of drive interface was irrelevant due to the fact that I used the system’s BIOS to read the sectors. It could have been just about any physical interface, but it didn’t matter since the installed BIOS made this transparent.

          And yes, there are numerous utilities already made to do this. This was not the point. I am a coder and that was the reason for the project. For the fun of it. To see if I can do it.

          Thank you all for the comments. I enjoy working with old hardware as well as new hardware.

          1. I was going to ask if you are familiar with Interlink and Intersvr. It sounds like you might be. Ah, the memories. Great job DIYing it though!

          2. Excellent. Any OS to any OS! I have original laplink3 lpt or serial transfer cables and software 3.5 5.25 and USB stick but u resolved the PCDOS legacy issue that LL3 may not have booted on. I have some older test equipment based on elder PC (fiber OTDR scope) that may benefit from your work of porting and thanks for this.

    2. Drive geometry and ATA specifications can get into the way, too.
      Some very early IDE / AT-Bus HDDs didn’t adhere to ATA-2 specifications yet.

      Registers may hold information in “wrong” format or split things up into two pieces.
      Or use Big Endian instead of Little Endian.
      Some values are different interpreted thus.

      That’s why the Win 3.1 HDD driver failed to function on modern IDE drives, for example.
      http://www.os2museum.com/wp/how-to-please-wdctrl/

      Different interpretation of what the IDE drive reports can mess up using correct drive geometry. Speaking of, old PC systems used CHS mainly. And old versions of FAT file systems (FAT12, the old FAT16; not FAT16b).

      All this will potentially confuse a modern PC system plus USB-IDE Converter. OSes likeb Windows 1x will rather expect FAT16b or LBA, not something that was used once in ~1987.

      1. And then, there’s something else. Before LBA, people used fake CHS geometry to use new HDD with outdated or limited BIOSes (no type 47). That worked fine, as long as total capacity of the HDD wasn’t exceeded and as long as a user typed in the values manually.

        For example, a user had an 80MB IDE drive, but the AT BIOS didn’t have a pre-defined setting in its list for that.
        So the user simply had chosen a 40MB or 6B entry. That worked, albeit at the loss of storage capacity. 🙂 Unfortunately, a modern USB to IDE adapter cannot know that. That’s a forgotten practice in the mists of times.

      1. I’ve got one that does… but you do get to an age point where IDE wasn’t very like the latter, post 92-ish ATA standards, and drives had quirks like not sharing a cable with other brands of drive very nicely, and jumper settings being a bit voodoo*. That’s mainly gonna be sub 100MB drives, but there’s some rare multiplatter beasts up to 300MB that are that old too.

        * Things like single and master settings not being the same, XT/AT mode jumpers and some more mysterious ones that were manufacturer specific.

    1. FTP is obsolete, too. Like Telefax. or telegrams. Or bloodletting. Seriously, why do you oldschool people still stick to FTP so much? It’s what Telnet is to SSH. It’s a relic. Modern software doesn’t support (Browsers) it anymore, so let’s why not just spare ourselves some trouble and either use something completely new or completely antique (aka period-correct)? 🙂

      You need to run an IPv4 stack for FTP, as well. Another obsolete anachronism technology. Because all those DOS TCP/IP stacks are so much behind the times that they don’t support rudimentary IPv6 yet. Not even those fancy homebrew stacks. Jesus!

      And I haven’t even started talking about flaky NE1000/NE2000 compatibility among vintage NICs. Getting a vintage NIC going isn’t easy, except if you have got access to a legendary Etherlink III or any other quality card. Installing an ethernet card is not kid play. Ressources like IRQ9, port 330h or free space in UMA are to consider. And then there are memory managers that xan get into the way. A serial port is much easier to use, because it’s already functional, normally. 🙂

      Personally, I’d just setup a DOS VM in modern PC with a shared folder (or some modern network software to connect to the outside world) and use a serial cable to physically interface with the vintage PC.

      USB-Serial Converter have their limitations (3.3v or 5v vs +/-12v) but are good enough for pure serial communication most of the time. Just keep it slow (9600 Baud) at first, to compensate for outdated FiFos.

      Software like Norton Commander 5, PC-Tools Commute, LapLink, File Maven 3, Little Big LAN, etc. can use a null-modem connection, too.

      Alternatively, Windows 98SE can be used for interaction/translation with vintage systems. Like a bridge between old and new. It has a direct connection functionality built-in, too. Maybe that’s in parts compatible to DOS software. Or Win95, at least. Which can run on a 386+ PC.

      Or, use XTIDE Universal BIOS to boot via serial connection.
      Or install a Gotek compatible floppy emulator.
      A HDD simulation was once planned in FlashFloppy firmware.

      Anyway, this wasn’t meant as a personal criticism. What I wrote are just my current thoughts about the matter. I was generally speaking, so to say. Also sorry for my poor English. Hope you don’t mind. 🙂

      1. This is a one time hack for data recovery. As they say “any port in a storm”. My experience is that those cheapo clone NE2000 boards work JUST FINE if you set the jumpers right. The software already knows how bad they are, and it deals with them. The data transfer rate is miserable but again this is a one time hack. Well actually it’s a lot better than 9600 bps which is what you propose. Nobody cares about the deprecation status of a protocol when it is used for a one time hack. For a one time hack, just turn on the machine and see what is already there, and again we can ignore whether the software is the latest and greatest version because this is a one time hack. If there is a novell driver in there and you have an old novell server kicking around then you are all set.

        And of course there is the possibility of using PLIP if you can get another machine. PLIP works GREAT if you give it a chance and you can find an old linux kernel, it’s very easy to set up, much better than 9600 bps and a very suitable solution for a one time hack.

    2. Like above… if you’ve got a network card, sure… but maybe the person does not have a compatible network card.

      Serial terminal software can be dropped on a floppy disk that’s been formatted as a DOS boot-disk… allowing immediate use of the serial port with minimum fuss. Configuring DOS packet network drivers and a TCP/IP stack is more complicated.

      1. SLIP (Serial Line Internet Protocol) can also work. Basically, it’s TCP/IP over a RS-232, RS-422, or RS-485 port as if it’s an Ethernet or other type network protocol port. (Fun fact:. Network cards ARE serial ports, but with built-in protocol packet assembly and disassembly done in hardware or firmware, invisible to the operating system, whereas with something like SLIP, the system calls to the driver do SLIP protocol package assembly and disassembly on the CPU.

  1. It is funnier to do something in a creative way.

    But he could also take the hard disk and connect it to another computer.

    Also, a laplink cable would work with the parallel port to connect it to another computer also.

  2. So if you want a semi modern way to do it, I guess you could have a stripped linux kernel on a boot disk and use GNU ddrescue which can copy to a network fileshare, whether you get on that network with packet driver for NIC, SLIP or PLIP etc.

    If you’re real lazy, just use a single floppy booter linux like FreeSCO and stick ddrescue on another disk.

  3. Back in the bad bad old days of CP/M, I watched a colleague do this with nothing more than a command called ‘pip’ (works much like UNIX/Linux’cat’ command) and a serial cable. Saved a whole 5MB HD that was in danger of being lost.

  4. just boot dos on a disk? use interlink and interserv with a null serial cable or parallel cable?.. i did this recently, even shared a serial port from virtualbox dos thru a win 10 machine and pulled files from a 5155 xt…. add xtide and you can boot over serial…

    1. Save up, sell a kidney, sell your grandma, sell your grandma’s kidney, treat yo’self.
      http://www.ariesys.com/portable/arp643.html

      But yeah if anyone comes up with a cheapskate option, drop the deets.

      Back in “the day” there was a full page ad in one of the newsprint computer weeklies that had pics of a ton of cases and a lunchbox was one of the options, for about the same price as their full height towers, which was also reasonable. I wish I could even just remember the name of the company to do some checking, see if they’re still around.

  5. SCSI 2 was popular as well in 486 days. I still have an IBM PC 5150 with an aftermarket combo RLL / diskette controller and an 8 bit VGA card. The diskette controller runs a 1.2mb 5 1/4 floppy drive and a 1.44 diskette drive. Haven’t seen a MFM drive in quite a long time. Internal IBM forums had great tech support on many non standard things you could do under DOS with the right device drivers with MFM and RLL controllers.

    1. yea there’s no scsi card in that computer and I can’t recall any X86 motherboards that had it on board (especially in a time where IDE onboard was still a newish thing) Its 99% likely its just a standard 3.5 inch IDE hard disk and there’s a billion other ways to get data off of it.

      Even if the only option is though a serial port (shoot me), as others have mentioned there’s laplink and interserv, the later even came with MS-DOS 6.22 (and windows 9x)

      Going out of your way to re-invent something that already exists, for a non-issue isn’t really that exciting

      1. The first board I encountered with onboard I/O was an 80286 with a VLSI chipset. That was back when naming a new company, someone must have asked “What do we do?” or “What do we make?”. VLSI made Very Large Scale Integration microchips.

        The board was made by Western Digital, had a 12Mhz LCC CPU with the very optimistic heat sink clamp holding it. It even had onboard video, some type of Super EGA that could go up to 800×600 16 colors, but only if a high frequency TTL color monitor could be found.

        The big problem with it was that all of the built in peripherals could be individually disabled, except the video. It wasn’t possible to install a VGA card since dual ISA color (or dual mono) cards weren’t supported. One of each would work.

  6. Another cool way to extract data if one didn’t have a serial to USB connector would have been to turn it to a sequence of QR codes. Naively at almost 4K per QR code, and one QR code per second (surely one can do better), that’s 35K baud or so. There is this project: https://github.com/divan/txqr

    1. I remember having that same lunchbox computer case in my room as a kid, after an Apple 2. My dad used to use it for work, but upgraded to a newer lunchbox with a color LCD screen. I lugged it to my great aunt’s house one time so I could play Doom.

    1. ZModem was unrivaled for what it did. The only problem was that the author wanted (and deserved) some compensation for that code and I was a poor teenager with barely enough money for bus fares and such.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.