Tuesday, April 17, 2012

VAULT-OS : Update 18-04-2012

Vault-OS running in 3MB mini Apache server
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.


Anonymous said...

Never give up, Cleve! We believe in you!

Anonymous said...

It is either the greatest thing to ever happen to survivalists or vaporware forever. I will kill to beta test this. Seriously 5MB that is pretty zoom for Apache server and PHP running.

Anonymous said...

Want to see this running, Tex, it sounds ultimate. I know a little about Apache. I never heard of it running inside of a few megabytes. With PHP could be outstanding.

Anonymous said...

Tex, with an increasingly invasive government spying on your online activities and recording more of your actions for use against you, if you were to find a way to release an adpated version of your OS that protects users anonymity then you would clean up.


Texas Arcane said...

Vault-OS is intended mostly for an intranet within the home/vault itself. There will be a chapter in the book about connecting to the outside through a proxy but it is not the primary usage scenario at all.

I mostly envision it as one or two primary servers running the software with who knows how many workstations with thin clients running dedicated browsers.

Solsys said...

Here are my specifications for survivalist electronic/computer systems :

- It would have to be rock solid, meaning that nothing can make the software freeze or errors to occur. Even if its very crude, it must function no matter what.

- Its function must be limited and specific (no swiss-army-knife/leatherman configuration : you have a hammer, a screwdriver, a corkscrew...)

- If there was some trouble nonetheless (you have to assume it may happen), then the entire system can be reinstalled from a disk, USB stick or whatever, by someone who has absolutely no knowledge of computers whatsoever, and who will follow the instructions written in simple english on a single page.

- On the hardware side, there are no exotic or hard-to-get parts, and no extras. If it were a car, it would be the most common car found in the vincinity, stripped of all unnecessary parts (air conditioning, navigation aid, belt buckle sensor, decoration... and a 12V DC outlet)

- The system is rudimentary enough to be used by ten year old children (= the level of most people regarding technology).

- It is inexpensive and can be cannibalized for parts (hardware). It cannot be changed by users (software). Ideally, parts could be manufactured from salvage (rudimentary electronics from the 70's)

- It is documented : in very simple terms for all users, in detail for maintenance crew (the electronic plate is labelled, a diagram has been made to scale and is in immediate vincinity).

- The loss of the product is non-critical : there are alternative backup solutions, the whole system in which it is integrated is very robust.

Texas Arcane said...


You have just perfectly described my ambitions for Vault-OS on delivery.

I think the setup I was discussing in this post is closer than I have ever come to getting it right, if not ideal.

Texas Arcane said...

I have now written CANBus (car hardware) daemons three times, in three languages, using the ELM-327 interface as well as a PC-104 card. They are the most amazingly resilient networks you can imagine, almost like they were designed for nuclear war.

Texas Arcane said...

I was working on it tonight and started to understand just how much power comes with PHP in a 5MB installation.

I spent maybe two weeks trying to find a simple date-time library in ANSI C for the version of VOS I had been previously working on. It took a long time to get it to compile in simply so I could get it to compute dates correctly for the scheduling/maintenance calendar on that website.

MicroPHP comes with such things out of the box, including JSON, REGEX, GD, PDF writer, it is incredible how much is in this little version, all the things I had been trying to build in the former version and then some.

Anonymous said...

This = cool

Apache + PHP = vault-os win

Make it customizable with PHP scripts alone.