The First Ukrainian SSD, or the Second Life of a Swiss Computer

How a simple hard drive replacement in a CNC woodworking machine required creating a custom solid-state drive, and the challenges we faced during its development.

Unfortunately, a huge number of enterprises in Ukraine operate on outdated industrial equipment manufactured a couple of decades or more ago. After the collapse of the Soviet Union and the sale of locally developed machines for scrap metal, the remaining viable enterprises began purchasing used CNC machines from the West: plasma cutters, woodworking and metalworking machines, engraving equipment, and so on. But the relatively low cost of such hardware has a downside — downtime due to failures, unavailability of spare parts, and a complete lack of support.

This post is about how a simple hard drive replacement in a woodworking machine required creating our own solid-state drive, and the challenges we faced during its development.

Several years ago, a customer brought a faulty 1.2 GB laptop Seagate hard drive manufactured in 1997 to the data recovery center of a well-known Kyiv company. The hard drive was used in a CNC machine, so when it finally gave up, production came to a halt. There were no major problems with data recovery — a full copy was made within an hour and the happy customer left for Zhytomyr. But that day he made several more trips to Kyiv. Multiple copies on different drives stubbornly refused to boot on the machine. Fortunately, a matching Seagate ST91351AG was found in the donor drive warehouse, the recovered data was written to it, and everything worked.

Approximately a year later, the situation repeated, but finding the drive took longer — at that point even eBay didn't have one. Once again, the accumulated donor warehouse saved the customer — on a far shelf they found and revived what was probably one of the last drives of this model in the world.

This time the customer was offered the idea of switching to flash storage. An IDE Flash module was found, adapters were manufactured for connecting it to the machine, and the drive identity was spoofed. But the customer decided not to bother and after the first unsuccessful boot attempt, abandoned the idea.

Several months ago, the drive came back again. This time it was obvious that constantly searching for drives more than 15 years old was not a solution, and the machine needed modernization — a transition to modern storage media. Flash storage was proposed as the solution. There were several reasons for this choice, but the main one was that solid-state drives are far more resistant to vibration than hard drives.

This decision marked the beginning of a major series of research and experiments, which culminated two months later in the development and manufacture of a working version of our own solid-state drive based on flash memory. It's not exactly an SSD — it's more of a specialized IDE-to-CompactFlash adapter for industrial equipment with a number of unique features.

But first, an attempt was made to solve the problem head-on. We assembled several different IDE Flash modules and CompactFlash cards, copied the recovered data to them, and drove out to Zhytomyr.

But none of the flash drives could boot on the machine. With any BIOS settings and connection modes, boot attempts led to a disk read error. An attempt was made to correct the boot sector — the error disappeared, but the system froze immediately after starting.

When it became clear that a brute-force approach wouldn't solve the problem, we disassembled the machine, removed the operator panel and industrial computer, and took the equipment back for research.

Since stopping production for any extended period wasn't possible, we simultaneously assembled our own test bench based on a 486DX2 processor with 16 MB of RAM. Thanks to this, and the fact that we managed to repair the "last" Seagate ST91351AG, we were able to avoid production downtime during the development of our drive.

The machine's control computer, NUM 1062W — a "purebred Swiss" by the way — was designed and assembled by NUM in 1998 as an industrial-grade 486DX2-66 with 24 MB of RAM. According to the service markings on the machine, the last maintenance was performed in 1999 while it was still in Germany. At that time preventive maintenance was carried out, and after that it ran without interruption until 2010, when the hard drive failed for the first time.

The operating system used in this industrial computer is the now largely forgotten OS/2 WARP, and machine control is handled by specialized application software. A significant portion of the research and experiments were conducted using the EPOS ATA Analyzer protocol analyzer.

The analyzer is a compact device that connects between the system under investigation and the storage device with a SATA or PATA interface, intercepting all commands and data exchanged between them. The collected information (exchange protocol) is transmitted via USB to a separate instrumentation computer, where it is processed using specialized software.

The analyzer had repeatedly saved us in similar situations, so our surprise was all the greater when we discovered that the IDE bus was transmitting some kind of "garbage" rather than standard ATA commands.

When analyzing this anomalous behavior of the analyzer with the Swiss computer, we had to remind ourselves of the architecture of 486-compatible motherboards. The cause was found — the IDE interface controller on the motherboard was outputting signals at 5V levels on the bus. Currently, per ATA standard requirements, these should be at 3.3V, so all modern controller chips simply couldn't correctly interpret the commands being transmitted through the interface.

The solution seemed obvious. We undertook the development and manufacture of a level converter. Especially since, based on our experiment results, we had already managed to boot the operating system from the original Seagate ST91351AG on our test bench. Test copies on CompactFlash and IDE Flash also booted OS/2 WARP on the bench PC.

A couple of weeks later we received the PCBs and assembled the level converter. Using it, we obtained the first data exchange protocols. And then it turned out that the problem was not about non-standard voltage levels on the bus at all. Moreover, as a result of thorough examination of the motherboard, it turned out that the elevated voltage problem was caused by a faulty IDE controller buffer chip (74ACT16245DGGE4). It was replaced and the research continued.

At that point, the intermediate results looked as follows: on our test bench, OS/2 WARP booted from both the original Seagate and virtually any hard drives, IDE Flash, and CompactFlash. But on the computer under investigation, only the Seagate would still start.

The question was definitely not about binding to a specific drive — this hypothesis was among the first to be rejected. The verification was done using a drive identity emulator developed based on the ATA Analyzer. The emulator works simply: when it intercepts the IDENTIFY DEVICE command (which returns all configuration information about the drive — model, serial number, supported modes, etc.), instead of passing the command to the connected drive, it returns the desired identity to the host.

To find out what made this Seagate so special, dozens of protocols were captured and carefully analyzed using the analyzer. They were nearly identical, with minor adjustments for different platforms — meaning the command sets and data transmitted during drive initialization on the test computer and the test bench matched. But after a certain point, something incomprehensible happened that ultimately prevented booting from any drives on the NUM 1062W.

We tried more than two dozen drives — contemporaries of the ill-fated Seagate — but not a single one allowed the system to boot. Nevertheless, the large volume of collected data made it possible to pinpoint the moment of boot failure. This moment was very carefully analyzed at both the logical and signal levels.

The problem turned out to be an implementation error in the data transfer protocol between host and drive. In fact, at a specific moment in time, the IDE controller on the NUM 1062W motherboard created a state on the bus that is not described in any version of the ATA standard. According to the standard, such states should be rejected by any drive with an error message. All drives correctly responded to this state, except for the Seagate, which ignored it and proceeded to process further commands.

Thus, complementary bugs in the IDE controller and in the drive's firmware created a unique system of binding the drive to the hardware. I think that during development, the motherboard was debugged specifically with this Seagate, and when it turned out that other drives didn't quite work, it became a "feature."

Unfortunately, our inquiries to the computer's developer didn't yield tangible results. The only thing we managed to get from the Swiss was that this equipment had long been discontinued and was no longer supported, but if we needed service documentation, they were willing to provide it — for a separate fee, of course. They also mentioned that the documentation didn't include circuit diagrams or assembly drawings, and they couldn't provide such information because it didn't exist.

Once the problem was clearly identified, we began developing a drive emulator specifically for this particular machine. First, a prototype of the future device was developed. Its foundation was a debugging board for a hard drive maintenance tool that had been previously developed for another project, built on an Atmel microcontroller. On this prototype, we achieved the first successful boot on the NUM 1062W from IDE Flash modules and CompactFlash cards.

After that, a decision was made to conduct testing in "combat conditions" — directly on the production floor. We drove to Zhytomyr to the customer's production facility and connected our prototype of the future storage device to the machine. Miracle of miracles — everything worked, and positive results were obtained for both IDE Flash modules and CompactFlash cards.

Following the trial run, several specimens of solid-state drives were manufactured in a 2.5" form factor with an IDE interface. An industrial CompactFlash card is used as the storage medium. The first Ukrainian "SSD drive" was named the Hard Drive Emulator for Industrial Equipment.

Additionally, during prototype testing at the production facility, it was discovered that CNC programs for the machine were carried on floppy disks. This created major inconveniences for employees, since floppy disks don't last long under production conditions. According to the customer, one floppy disk was enough for 3-5 program writes, after which it needed to be replaced. Therefore, we proposed replacing the floppy drives with FDD emulators based on USB flash drives. As a result of this additional modernization, the IMA BIMA machining center was completely transitioned from magnetic storage technologies to modern solid-state media.

Results

  • A non-trivial problem was solved: replacing outdated magnetic storage devices (HDD and FDD) with modern solid-state flash memory-based media, which extended the life and improved the operational reliability of a CNC woodworking machine.
  • Our "HDD emulator" has a number of special features, including drive identity spoofing, on-the-fly protocol modification, and correction of undocumented data exchange errors. Thanks to this, it is possible to modernize virtually any industrial equipment and non-standard specialized machinery that uses outdated IDE interface hard drives.

P.S. We are currently working on creating an analog for the SCSI interface, which is widely used, for example, in medical equipment.