I'm currently in the process of finding out if a Raspberry Pi is suitable for an embedded project. I have read a lot of the questions and answers on this site regarding boot sequence of the device, and learned that
start_cd.elf is responsible for loading the Linux kernel and kernel parameters.
What I need for my project, is
start_cd.elf to load a minimal bootloader that is capable of checking if a special file exists on the SD card, and writing a file to the SD card, in the same location as the other boot files.
If the special file exists kernel02 with kernel parameters should be booted, else kernel01 with kernel parameters should be booted. There is no need for output of any kind or USB support ect. the bootloader should be as simple as possible. The purpose of this is to allow the Raspberry Pi to recover from a failed system upgrade.
Do anyone know of a minimal bootloader for the Raspberry Pi I can modify to suit my needs?