Wow, this is a very interesting thread!
Back to the original topic at hand, I do not think I would have gone with a full-fledged OS route for this sort of device/application. Perhaps a microcontroller-based solution would have been more resilient and easier to patch to deal with this sort of unexpected behavior on a hardware/electrical level. (A $5 voltage regulator and a $2 capacitor and you have 5 minutes of battery backup!)
I’m not saying this to criticize the original design decisions, but rather to adapt some working points in hopes of perhaps mitigating the problems you’re experiencing.
Microcontroller firmware is typically stored on read-only memory (well, EEPROM and the like, but while running, read-only), and data is written to a secondary disk or device either as files or binary data, and flushed in real-time. A read-only boot disk has been brought up several times. I experimented with read-only boot drives for Windows in the past, and there are many issues that arise as the OS does not expect to be running on read-only medium - though I am beyond certain that there are many others on this list with more experience with solving this problem than myself. I do recall that it was possible to get it to work. However, perhaps the easiest would be some sort of “pseudo-write” solution where the actual data is read-only with a write buffer on top so that Windows thinks it is being loaded from an RW device. I know some flash disks can simulate that sort of behavior when you trigger the write-lock on the media.
You’ve provided very little info about the configuration of the disk controllers in the OS. You have not mentioned whether or not kernel/driver-level write caching has been enabled, disabled, or even set to the max. I do believe this option was present even back in NT (and I have no clue if the OP means NT NT or another NT-based release).
A lot of the comments here are talking about the differences between SSDs and conventional magnetic media. I must point out that the original posts says an “8 GB flash disk” which I presume is actually more along the lines of an SD card than a SSD disk. Again, more info is needed - the original question is very light on specifications and details.
However, if it is indeed an SD card and not an SSD, then a lot of the assumptions made in the thread no longer apply. While the pseudo-addressing still applies, you no longer have firmware making highly-sophisticated read/write caches in its own memory (again, this would require unprovided info about the SD card controller, too!), and even if it were present, it’s nowhere near as sophisticated as that in a recent, say, Sandforce controller.
And if this is neither an SSD nor an SD but rather a USB stick - then that’s a whole ‘nother can of worms. You have to take into account the USB bus’ handling of power failure and this goes back to more unprovided specs. Is this a modern CPU w/ integrated USB in the chip itself, on the northbridge, or completely separate on the motherboard? And, of course, each USB flash disk is a beast of a different nature. You have everything from the crappiest Chinese knockoffs that can’t even guarantee proper read/write under normal circumstances that sell for basically the cost of the flash storage itself, to some really high performance units that have a significant amount of tech in the embedded controllers to provide high-quality data transmissions.
Then you have the drivers. If this USB, then Windows NT (to the best of my knowledge!) needs 3rd party drivers to provide that functionality. What’s going on behind the scenes there? The same applies if not USB - again, where does the controller physically reside, and how is it controlled.
In short, a very interesting question with too many things that could go wrong; not enough details to provide working solutions. I understand the original question was actually very different (can I use “bad power” interrupt to save data), but many lessons to be learned.