Tuesday, April 17, 2012
VAULT-OS : Update 18-04-2012
I installed Windows 2000 Lite on one of my two 64 MB RAM P4 SBCs. Then I deployed the latest version of my ASP.NET embedded server and web site to this device with the .NET 2.0 runtime. I ran two daemons (each also written in .NET) and the server.
Ran like an absolute dog. Unacceptable. I had so much to add to this, including the marquee and the voice recognition/synthesizer as an additional daemon. Wasn't going to work. My two dedicated boxes were not going to be able to handle this approach or architecture.
I tried using MONO .dlls and uninstalled .NET 2.0 and immediately noticed it ran even slower. Although MONO is much smaller, it is still a big bulky deployment tamale sitting out there.
I also thought that the design of the site was too tied to Visual Studio for editing ASP.NET pages. Wasn't really practical. Same problem with my version written entirely in C. It was so heavily specialized that nobody was going to be able to easily add or subtract from my open source design. People would have to rely on me to modify or customize the system.
In a perfect world, what I needed was a true web development system in a modern server that could be created with a text editor if necessary. In a true dream world, this system would squeeze into say 5 MB and maybe even fit on a floppy. Should run easily on Linux, Windows or FreeBSD. DOS was becoming less and less important to me since I discovered BusyBox Linux and other tools.
I went looking for it and discovered MicroApache with MicroPHP. It was kind of funny because about 10 years ago one of the ways I learned PHP was to build a little quasi Vault-OS mockup with the intention of developing it into something further.
I found that old mockup on a computer in my study over the weekend and ported some of my HTTP writing code over from C into PHP to produce the example you see above. PHP is very similar to C and it didn't take much work.
I have this demo running on my little Sentry unit with a total of 64 MB and response seems to be really, really good. Total size of the installation is 3.2 MB in total. I could run this on Windows 98 or Windows NT without much trouble, according to the docs for MicroApache. My Windows 2000 Lite runs well with only 32 mb of RAM, leaving the rest to run the server here. This version of PHP I customized to support GD (image writing dynamically as a web service for barcodes and maps/diagrams) as well as SQLite for the database. In fact, I just brought my existing SQLite database over for this example and it worked perfectly the first time. I have a very simple form of cross-platform AJAX I have experimented with that actually calls into PHP routines instead of web services and returns the results in JSON format for real time monitoring and HMI interfaces in a standard browser.
Here's another angle that is really promising. The daemons can be written in PHP as well. PHP supports shared memory blocks, multithreaded execution and connection to any system .DLLs necessary to monitor real-time equipment. In a truly perfected system, you are going to be able to administer plug-ins for different hardware (CANBus, MODBus, I2C) the same way you would plug web pages or content into your server from the admin back end. Just check the boxes and restart the server.
The entire shebang is never going to require more than 5 MB wherever it is deployed.
This is more in keeping with my original dream for Vault-OS. I think it is not going to get any better than this architecture.