Saturday, March 12, 2011

Hacking a file server

No, I'm not talking about hacking an Internet file server. At CFC, Inc. we kept the CNC drilling and routing programs on a file server running Xenix which was a Microsoft branded version of Unix. The CNC machines were plugged directly into this file server using RS-232 ports. Until we purchased this server we had been keeping all our programs on punched paper tape and stored on shelves but now we could keep all this stored electronically.

Okay, this new way of doing things would have been great except that the file server cost lots of money and it wasn't reliable. Every so many weeks or months the computer would crash for one reason or another. When this happened it would run fsck on bootup. This would sometimes find some file system records to repair because the machine didn't have a chance to write everything to disk when it crashed. The end result? We would sometimes lose files from the file server. Bad, bad and worse because all our backups were on tape and we had really bad luck restoring from tape.

We didn't want to spend any more money on this file server. I wanted to develop a replacement in house. It would run on DOS which didn't have the bad habit of delaying writes to the file system. Not bulletproof, but bullet resistant and cheap. But, I had a problem. The only documentation I had which explained the communication protocol for the file server was very thin and hard to understand. I was stuck.

Remember the RS-232 monitor that I grabbed at the GTE auction? I knew right away how useful it would be for this project! Back at the factory I installed this monitor between one of the CNC machines and the Xenix file server. With the ability to see data moving back and forth I was able to figure out how the file server worked. It was tricky because data was actually delivered in packets. There was a non-trivial conversation that happened between these machines but it looked like the code for this was going to be fun to write!

I was ready to get started!

No comments: