This is the mail archive of the ecos-patches@sourceware.org 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]

[PATCH 1] utility functions for using the extended VV interface to FIS


Hi,

in spring last year finally my extension to the Redboot VV interface got committed (which I had since fall 2004), and since we are using this extended VV interface for updating the firmware and as a read-only filesystem, here comes the next patch.
The attached patch adds a fisfs package which offers three utility functions to work with the FIS from within eCos applications, from the header:

/* Get the fis_table_entry for the image with the given name, the index
 of the image is returned, -1 if no such image exists.
 If a NULL pointer is used for entry, only the index is returned. */
int fis_get_entry(const char* name, struct fis_table_entry* entry);

/* Remove the image with the given name from the FIS */
int fis_remove_image(const char* name);

/* Create a new image with the specified name.
If backup is false, it fails if an image with the given name already exists.
If backup is true and an image with the given name already exists,
a "~" is appended to its name and a new image with the name is created.
The other arguments are the same ones as known from the fis create RedBoot command.*/
int fis_create_image(const char* name, char* buf,
                CYG_ADDRESS flash_base, CYG_ADDRESS mem_base, unsigned long size,
                CYG_ADDRESS entry_point, unsigned long data_length, int backup);


Using fis_create_image() we are doing failsafe firmware updates for a long time now already. This function is obviously not suited for systems with small RAM, but if somebody needs this functionality it can easily be added as an additional function. The linker will throw away the unused one then.
There are also some docs included.
It is working for us since a long time without problems, so it should be safe.

Please apply
Alex

Attachment: fisfs-util.patch
Description: fisfs-util.patch


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