EmbeddedRelated.com
Forums

Insert version information into a boot stream

Started by Vladimir Vassilevsky August 19, 2011
Hi Roberto,

On 8/19/2011 10:52 AM, Roberto Waltman wrote:
> > Another way, (which I don't like, but it works.) > You can enbedd the version info in the flash image surrounded by > "markers" that will allow you to search and locate it anywhere. > > #pragma pack() > > struct version > { > char before[35]; > int v_major; > int v_minor; > char date[11]; > int checksum; // to reduce the likelihood of false possitives
I figured the string "Vassilevsky" probably stands a greater chance of reducing those sorts of hits! (there are advantages to having "unique" surnames! :> )
> char after[35]; > }; > > struct version this_version = > { > "find version after this ##########", > 0, > 0, /* to be updated after build */ > "--/--/----", > 0, > "######### find version before this" > }; > > Of curse, if the boot image includes any checksums to detect corrupted > files they will need to be updated after modifying the structure > above.
Or, ensure the struct's contents are "checksum neutral" (not possible with all checksum algorithms)
Hi Rob,

On 8/19/2011 11:02 AM, Rob Gaddi wrote:

>> Instead of requiring a "predefined location" (admittedly, easier to >> *find*), could you wrap the information with a unique signature >> such that anything else is unlikely to be (erroneously) recognized >> as having that signature IN THAT REGION OF MEMORY? >> >> E.g., add to the flash image: >> >> "Copyright 08192011 Vladimir Vassilevsky, Build 12.3.4, v9A03" >> >> (assuming this *context* is unlikely to randomly appear elsewhere >> in your code image :> ) > > Surprisingly, on the Blackfin, that actually disassembles to code that > erases the entire flash and then sets the chip on fire.
Ah, my bad. :< Then, instead, store: "30A9v ,4.3.21 dliuB ,yksvelissaV rimidalV 11029180 thgirypoC" which, theoretically, should *program* the entire chip and spray water (halon?) on anyone nearby!!

Roberto Waltman wrote:

> Another way, (which I don't like, but it works.) > You can enbedd the version info in the flash image surrounded by > "markers" that will allow you to search and locate it anywhere.
That idea almost works... but the maker string could be occasionally broken into two chunks in the boot sequence. So, the flash stream should be interpreted rather then simply searched. If the flash stream has to be interpreted, then I can put a version structure to a predefined location in the target memory map, and everything is simple. Oh, but I don't like writing an interpretor, that's the only problem :-) Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com

Rob Gaddi wrote:

> On 8/19/2011 10:49 AM, Don Y wrote: >
>> E.g., add to the flash image: >> >> "Copyright 08192011 Vladimir Vassilevsky, Build 12.3.4, v9A03" >> >> (assuming this *context* is unlikely to randomly appear elsewhere >> in your code image :> ) > > > Surprisingly, on the Blackfin, that actually disassembles to code that > erases the entire flash and then sets the chip on fire.
Does the "(c)Rob Gaddi" string put an ARM processor into an idle mode ? Actually, I can remember piece of code that started with a text string "Hello my dear friend". That was a computer game for Sinclair Spectrum. IIRC, that translated to a harmless series of relative jumps on Z80 cpu. VLV