views:

141

answers:

1

I've got a WinCE device powered over ethernet (PoE) and I want to prevent File-System corruption following a potential power loss, e.g. user pulling the plug.

As a side note, I'm already using TexFAT which is supposed to prevent FS corruptions. While the later certainly does help reducing FS corruptions (over using plain old FAT), it doesn't entirely prevent some to still occur from time to time... So, I'm considering using a small rechargeable backup battery that would give WinCE enough time to cleanly shut down. Now, I can't find any info on the shutdown process: how to trigger it, how long it takes, and so on... MSDN is pretty quiet on this topic. Any idea?

+1  A: 

The powerdown sequence is totally platform dependent.
The following answer is relevant to Windows CE 6. It may be different for previous versions of CE.
If you include the power manager component in your system, then the sequence is plus minus this:

  • Send go to D4 to all the drivers that are powermanageable and that reported they support this state. Otherwise, the driver gets the lowest powerstate it supports.
  • XXX_PowerDown is called, but it is not commonly used in Windows CE 6.
  • In between the registry is flushed in case you have a Hive Based registry and you enabled the registry flush thread. You should disable this in a fragile system such as yours
  • OEMPowerOff
  • device down

Just found a post by Bruce Eitman on what happens when Suspending. He puts it better than I do.
The Suspend sequence is what you'd do before loosing power.

Shaihi
Thank you for your detailed answer.In view of adding hardware support to detect power-loss and provide backup power for a full shutdown, I couldn't find any doc specifying the max. amount of time a full shutdown may take (so as to specify the size of the backup.) do you have any insight/ideas on it?
smertrios
The OEM should have the answer to that. It depends on the number of peripherals and the type of peripherals. We have a system that can go to suspend in less than 0.7 seconds or up to 1.5 seconds - depending on the activated drivers.
Shaihi