This is the mail archive of the mailing list for the eCos project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

AW: AW: contributing a failsafe update meachanism for FIS from within ecos applications


here comes the next try, I hope I fixed all known issues.

Main change:

#define CYG_REDBOOT_RFIS_VALID_MAGIC ".FisValid"  //exactly 10 bytes
#define CYG_REDBOOT_RFIS_VALID       (0xa5)
#define CYG_REDBOOT_RFIS_EMPTY       (0xff)

struct fis_valid_info
   unsigned char valid_flag[2]; //this should be safe for all alignment issues
   unsigned long version_count;
struct fis_image_desc {
      unsigned char name[16];      // Null terminated name
      struct fis_valid_info valid_info;
    } u;
    CYG_ADDRESS   flash_base;    // Address within FLASH of image
    CYG_ADDRESS   mem_base;      // Address in memory where it executes
    unsigned long size;          // Length of image

So now the valid_info is explicitely related with the name field. There are also two asserts() in the code which check the size of fis_valid_info and try to check the alignment.
The only member which might have alignment issues is version_count. If fis_image_desc is accessed via the pointer work_buf, there is no problem, it is aligned exactly the same as flash_base and friends. If a fis_image_desc is created on the stack the compiler should make sure that all members of the structure are aligned correctly. This is ensured by the two asserts().

Otherwise not much news. Except the copyright issue (work in progress), which issues are left now ?

An adapted version of my current fisfs implementation is also attached.
It would be nice if the fisfs-implementation could get the information about the two flash blocks reserved for the two fis tables somehow from redboot during runtime. Is there a way to do this ?


Attachment: redboot-redundant-fis.patch
Description: redboot-redundant-fis.patch

Attachment: fisfs-3.tar.gz
Description: fisfs-3.tar.gz

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]