• I had considered doing some similar things in the past.

    I'd considered booting off of an EEPROM (not quite sure I remember why), and wrote some code for that, but never tested it.

    One of the things that makes it much more difficult is that (I don't know if your code is the same way) if I typed save(); while my code was running, the only thing I could be sure of is that it would not come up in a remotely usable state. And that'd be the case even if I didn't delete onInit() after it runs to save memory...

    I think that's what sank my old idea, I couldn't initialize it into a clean state to save() from. Oh! and thats why I was loading off of an eeprom, I could only use the flash for my javascript bootloader since there was no way for me to reinitialize it to a clean state to save() from. So effectively, that was ROM for me, and I needed some other sort of persistent memory. Hence going for EEPROM.

    I wonder how clean you could get it by having your onInit() code check for a signal that there's an update, and if so, delete all the functions and variables already defined, then load the files in (you'll need to break it up, as there's a limit on how large a chunk you can read from a file at once, and you can't pipe to exec() ), and those file swould recreate the stuff you deleted, and then you could have it save()?

    My conclusion was that you have to design your whole program to be amenable to this sort of thing.

About

Avatar for DrAzzy @DrAzzy started