📜 ⬆️ ⬇️

The first Ukrainian SSD drive or the second life of a Swiss computer

Unfortunately, a huge number of enterprises in Ukraine work on outdated industrial equipment, made a couple of dozen or more years ago. After the collapse of the Union and the sale of metal to machines of local development, the enterprises that remained afloat began to acquire in the West used machine tools with numerical programmed control: plasma cutters, wood, metalworking machines, engraving equipment, etc. But the relatively low cost of such iron has a downside - downtime due to failures, inaccessible parts, the complete lack of support.
This post is about how simple replacing a hard drive in a woodworking machine required creating your own solid-state drive, and what difficulties we had in developing it. Who cares how the first Ukrainian "Winchester-SSD" was created, please under the cat.


Initially, a small background. A few years ago, the customer turned to the information recovery center of a well-known Kiev company with a faulty notebook Seagate 1.2 GB 1997 disc.
Winchester was used in the machine, so when he did his service, production stopped. With the restoration of data, no special problems arose, a full copy was made within an hour and the happy client went to Zhytomyr. But that day he visited Kiev several times. Several copies on different disks stubbornly did not start on the machine. Fortunately, the same Seagate ST91351AG was found at the donor disc warehouse, the recovered data was written to it and it all worked.
Approximately a year later the situation repeated itself, but the disc was already searched longer - at that time it wasn’t even on ebay. And again the customer was saved by the warehouse of donors accumulated over the years - on the far shelf they found and revived, probably one of the world's last disks of this model.


Donor Discs in the Recovery Center
')
This time, the client was offered to think about switching to flash, even an IDE Flash module was found, adapters were made to connect it to the machine, a drive passport was replaced. But the customer decided not to bother, and after the first unsuccessful attempt to boot from it, he refused this idea.


One of the first adapters

A few months ago, the disc came back again. This time it was obvious that constantly looking for discs more than 15 years old is not an option, and the machine needs to be modernized, transferred to modern media. As a solution, it was proposed to switch to flash. There were several reasons for this choice, but the main reason was that solid-state drives are much more resistant to vibrations than hard drives.
This decision marked the beginning of a large series of research and experiments that culminated in the development and production of a working version of its own solid-state drive based on flash memory after two months. This is not exactly an SSD drive, rather 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, as they say, head on. We collected several different IDE Flash modules and CompactFlash cards, copied the recovered data onto them, and went to leave for Zhytomyr.


Our ward - woodworking machine IMA BIMA

But none of the flash drives could not boot into the machine. With any BIOS settings and connection modes, download attempts resulted in a disk read error. An attempt was made to correct the boot sector, as a result, the error disappeared, but the system hung up immediately after the start.
When it became clear that the cavalry attack did not solve the problem, we disassembled the machine, dismantled the operator panel and industrial computer and took the equipment to our study.


Stand for research

Since it was not possible to stop production for any lengthy period, in parallel we assembled our own computer test bench on a 486DX2 processor, with 16 MB of RAM. Due to this, as well as the fact that we were able to repair the “last” Seagate ST91351AG, we managed to avoid production downtime during the development of our disk.
The control computer of the machine NUM 1062W, by the way "purebred Swiss", was developed and assembled by NUM in 1998 in the industrial version 486DX2-66 with 24 MB of RAM. According to the service marks on the machine, it was last serviced in 1999, while still in Germany. Then preventive measures were carried out, and after that, he worked uninterruptedly until 2010, when the hard drive first failed.


"Sistemnik" NUM 1062W

The OS / 2 WARP, which is now almost forgotten, is used as the operating system in this industrial computer, and the machine is controlled using special application software.
Much of the research and experimentation was carried out using the protocol analyzer EPOS ATA Analyzer.


EPOS ATA Analyzer Protocol Analyzer

The analyzer is a compact device that is included in the gap between the system under study and the drive with the SATA or PATA interface and intercepts all commands and data they exchange. The collected information (exchange protocol) is transferred via USB to a separate instrument computer, where it is processed using special software.
The analyzer has repeatedly rescued us in such situations, the more we were surprised when it turned out that some kind of “garbage” was transmitted over the IDE bus, and not standard ATA commands.
When analyzing such incorrect behavior of the analyzer with a Swiss computer, I had to remind myself of the architecture of 486 compatible motherboards. The reason was found - the IDE interface controller on the motherboard sent signals with a level of 5V to the bus. Currently, according to the requirements of the ATA standard, they should have a level of 3.3V, so all modern controllers chips simply could not correctly interpret the commands that were transmitted through the interface.
The solution in this situation seemed obvious. We took up the development and manufacture of level converter. Moreover, according to the results of the experiments, we have already managed to launch the operating system from the original Seagate ST91351AG on our test bench. Test copies on CompactFlash and IDE Flash also loaded OS / 2 WARP on a stand-alone PC.
A couple of weeks we received printed circuit boards and assembled a level converter. With it, the first data exchange protocols with drives were obtained. And then it turned out that the problem is not at all in non-standard levels on the bus. Moreover, as a result of a thorough examination of the motherboard, it turned out that the problem of overvoltage was caused by the faulty chip of the IDE buffer of the controller (74ACT16245DGGE4). She was replaced and research continued.


Idle buffer chip on the motherboard

At that time, intermediate results were as follows. On our OS / 2 test booth, WARP was loaded from both the original Seagate and virtually any hard drive, IDE Flash and CompactFlash. But only Seagate was still running on the target computer.
The question was definitely not related to a specific disk - this version was discarded one of the first. The check was made using a disk passport emulator developed on the basis of the ATA Analyzer. The essence of the emulator is quite simple - when intercepting the IDENTIFY DEVICE command (it gives all disk configuration information - model, serial number, supported modes, etc.), it does not translate the command to the connected disk, but returns the passport we need.
To find out why this Seagate is so special, dozens of protocols were removed and carefully analyzed using an analyzer. They were almost identical, with a slight adjustment for different platforms - i.e. the instruction sets and the transmitted data when the disk was initialized on the examined computer and the test bench were the same. But after a certain point, something incomprehensible was happening, which resulted in the impossibility of booting from any disks on the NUM 1062W.


Fragment of one of the protocols

We tried more than two dozen disks - the same age as the ill-fated sigate, but none of them allowed the system to boot. Nevertheless, a large amount of data collected allowed localizing the moment of failure in the download. This moment was very carefully analyzed at the logical and signal levels.
The problem was in the error of the implementation of the data transfer protocol between the host and the disk. In fact, at a certain point in time, the IDE controller of the motherboard NUM 1062W formed a condition on the bus that is not described in any version of the ATA standard. Under the standard, such states should be discarded by any disk, with an error message. All disks responded correctly to this state, except for the sigate, which ignored it and proceeded to process further commands.
Thus, the complementary errors in the IDE controller and in the disk firmware led to the creation of a unique system of binding the disk to the equipment. It seems to me that at the development stage of the motherboard, debugging was done with this kind of sigate, and when it turned out that the other disks do not work very well, it became a feature.
Unfortunately, our requests to the computer developer did not bring tangible benefits. The only thing we could achieve from the Swiss is that such equipment has long been discontinued and is not supported, but if we need service documentation, they are ready to provide it, of course, for a fee. However, they reported that the documentation does not contain circuit design and wiring diagrams, and they cannot provide such information due to its absence.
When the problem was clearly identified, we began developing a disk emulator directly for a specific machine. First of all, the layout of the future device was developed. Its basis was the debug board of the hard disk drive maintenance instrument developed earlier for another project, built on an Atmel microcontroller. For the first time in this layout, we successfully downloaded NUM 1062W from IDE Flash drives and CompactFlash cards.


Debug layout

After that, it was decided to test in "combat conditions" - directly at work. We went to Zhytomyr to the production site of the customer, there we hooked up the layout of the future drive we developed to the machine. About a miracle - everything worked, and positive results were obtained for both IDE Flash modules and CompactFlash cards.


Testing of the layout in the "combat conditions"

After the trial run, several instances of solid-state disks in the 2.5 ”form factor with an IDE interface were made. They use industrial CompactFlash card as a carrier. The first Ukrainian SSD disk is called the Hard Disk Emulator for Industrial Equipment.


Original disk, debug layout, final version of our disk


The device of our disk

In addition, during the testing of the layout in production, it turned out that the control programs for the machine are worn on diskettes. This creates great inconvenience for employees, because in a production environment, floppy disks “do not live” for a long time. According to the customer, one floppy disk is enough to write 3-5 control programs, then it needs to be changed. Therefore, we proposed to replace the drives with FDD emulators based on USB flash drives. As a result of this additional upgrade, the IMA BIMA machining center was completely transferred from magnetic storage technologies to modern solid-state media.

Results:


• A non-trivial problem of replacing outdated magnetic drives (HDD and FDD) with modern solid-state flash-based media was solved, which allowed us to extend the life and increase the reliability of operation of a CNC woodworking machine.
• The “HDD emulator” developed by us has a number of special functions, including the possibility of replacing a passport, modifying the protocol on the fly, correcting undocumented data exchange errors. Thanks to this, it is possible to upgrade practically any industrial equipment and non-standard specialized equipment that use outdated hard drives with an IDE interface.

PS We are currently working on creating a counterpart for the SCSI interface, which is widely used, for example, in medical technology. If the topic is interesting, in the following posts I will try to describe what we are doing in this direction.

Source: https://habr.com/ru/post/178099/


All Articles