I had it in mind to use Power BASIC as the compiler to implement the new DOS file server for the factory. This was a new, slicker and rebranded version of Turbo BASIC which I had been using for a while. It wasn't cheap. Power BASIC was a nicely polished compiler and had good documentation. I think we paid $300 or so for it.
I wanted to create a nice UI for the file server so I purchased a windowing library for Power BASIC. It made it easy to create text mode windows using graphics characters. The way it worked was very similar to the way that a Windows programmer would do it in C. You called functions which created windows, buttons, etc. These would return a numeric handle.
Your program would intercept messages from the UI library in an event loop and act on them. Each message would include the handle for the window or widget it was about, and also a value for an action such as a click or a key press. This is not an easy way to write windowing code, but the file server would have a simple enough UI. The end result looked nice and was functional.
I learned a lot on this project. This must have been the highest quality BASIC code I had written to this point. It was a multitasking file server using state machine techniques. Unlike its Xenix based predecessor, this file server never crashed once we had it up and running. Never.
Showing posts with label xenix. Show all posts
Showing posts with label xenix. Show all posts
Monday, March 14, 2011
Power BASIC and the Uncrashable Kingdom
Labels:
basic,
c,
c compiler,
DOS,
GUI,
multitasking,
power basic,
turbo basic,
xenix
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!
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!
Subscribe to:
Posts (Atom)