lundi 28 décembre 2015

How to use sqlite for storing in NVRAM

I am working on an embedded system where we have around 3MB of NVRAM available. Currently, nvram is memory mapped and data is stored/access using enumerations. These enumerations are basically indexes into the memory. The problem with this approach is that I can not increase the size of any element without breaking backwards compatibility. That is, assume I have three variables stored (each 32 bit).

VAR0 at index 0 (32bit)
VAR1 at index 1 (32bit)
VAR3 at index 2 (32bit)

If I want to increase the size of say VAR1 to 128bits, I can not do that as that will break the backwards compatibility with older clients. And this is because we are using enumerations.

So I was thinking to use sqlite database to store the data as (key,value) pairs. And depending upon the client version I can easily return either exact byte count or the number of bytes that client expects.

But I want only data to be stored on the NVRAM, not the metadata. Is there a way that I can store metadata about database on hard drive(our embedded device always has one) ? Is this even possible ?

Aucun commentaire:

Enregistrer un commentaire