I once brought up this topic for the Nano in http://www.seeedstudio.com/forum/viewto ... =22&t=3605
(there is not much activity there though). I suggest for your app signature/header that you use for instance:
1. A magic marker which is more unique than "DSO_APP", like some half-random four byte combination.
2. The version of this header format (so that it can be changed later and the application switcher code can parse different formats.)
3. The address of the next free page after this application. At some point you might want to break free from this "slot" restriction and pack applications more tightly. Then the scanning can be more efficient and avoid false positives if it can jump ahead to next possible location.
4. Zero-terminated string for application name. Come up with a reasonable limit (16?) for how many characters must be displayed in a application switcher, with longer titles shown at best effort (imagine horizontally scrolling text etc).
Instead of (4) you could have:
4. Pointer to short name string
5. Pointer to full name string
[To save space, (2) could be the fourth byte in (1), or in (3) since the page start will always have LSB zero. (1) and (3) should be word-aligned to optimize the scan, I believe. But it is most important to fix where (2) should be and make it independent from the rest (like 3) which you might want to change one day, rather than optimizing 3 bytes.]
Executing a new application
For executing the new application, doing it fresh from a software-triggered reset is the way to go. Then you will have no hassle with peripheral states etc. Put a magic marker and the start address in a fixed position in RAM before the reset and check for this in the early bootloader code. I implemented this in my extended bootloader: https://gitorious.org/dsonano/dso-bootl ... r.c#line42
To demonstrate this I also made a very simple application switcher that scans through the flash: https://gitorious.org/dsonano/dso-bootl ... .c#line107
App selection app
The application switcher can be a free-standing application like any other. So a lazy application writer just has to include the signature header and a menu entry which sets the magic and resets the unit into the application switcher. For this you will have to agree on what address should be set with the magic - a fixed address where the application switcher should always reside, or more indirectly, a flag that tells the bootloader to start whatever is the default application switcher.
Or you make it so the bootloader always runs the application switcher, which in turn should allow the user to define the default "real" application. With the current bootloader that would mean putting the app switcher in "slot 1", but you certainly don't want to waste a whole slot on it, so you should make a hook for it in the bootloader.