This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
FIS sorted
- From: Gary Thomas <gary at mlbassoc dot com>
- To: eCos patches <ecos-patches at sources dot redhat dot com>
- Date: 06 Oct 2003 09:45:44 -0600
- Subject: FIS sorted
- Organization: MLB Associates
This change makes RedBoot print the FIS directory sorted in
FLASH address order - simpler to understand and find out what's
truly free, etc.
Here's what one of my boards looked like:
RedBoot> fi li
Name FLASH addr Mem addr Length Entry point
(reserved) 0xFE000000 0xFE000000 0x00010000 0x00000000
RedBoot 0xFE010000 0xFE010000 0x00040000 0x00000000
RedBoot config 0xFE3FF000 0xFE3FF000 0x00001000 0x00000000
FIS directory 0xFE3F0000 0xFE3F0000 0x0000F000 0x00000000
junk 0xFE050000 0x00100000 0x00100000 0xFFFFFFFF
Now, here's what it looks like:
RedBoot> fi li
Name FLASH addr Mem addr Length Entry point
(reserved) 0xFE000000 0xFE000000 0x00010000 0x00000000
RedBoot 0xFE010000 0xFE010000 0x00040000 0x00000000
junk 0xFE050000 0x00100000 0x00100000 0xFFFFFFFF
FIS directory 0xFE3F0000 0xFE3F0000 0x0000F000 0x00000000
RedBoot config 0xFE3FF000 0xFE3FF000 0x00001000 0x00000000
--
Gary Thomas <gary@mlbassoc.com>
MLB Associates
Index: redboot/current/ChangeLog
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/redboot/current/ChangeLog,v
retrieving revision 1.145
diff -u -5 -p -r1.145 ChangeLog
--- redboot/current/ChangeLog 3 Oct 2003 23:49:20 -0000 1.145
+++ redboot/current/ChangeLog 6 Oct 2003 15:41:26 -0000
@@ -1,5 +1,10 @@
+2003-10-06 Gary Thomas <gary@mlbassoc.com>
+
+ * src/flash.c (fis_list): Display FIS directory entries in FLASH
+ address (sorted) order.
+
2003-10-03 Gary Thomas <gary@mlbassoc.com>
* src/flash.c (fis_delete): 'fconfig' data only shows up in FIS if
the data is stored in FLASH - account for this. Also, make sure
FLASH gets initialized if built without 'fconfig' enabled.
Index: redboot/current/src/flash.c
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/redboot/current/src/flash.c,v
retrieving revision 1.53
diff -u -5 -p -r1.53 flash.c
--- redboot/current/src/flash.c 3 Oct 2003 23:49:20 -0000 1.53
+++ redboot/current/src/flash.c 6 Oct 2003 15:39:56 -0000
@@ -437,15 +437,17 @@ fis_init(int argc, char *argv[])
static void
fis_list(int argc, char *argv[])
{
struct fis_image_desc *img;
- int i;
+ int i, image_indx;
bool show_cksums = false;
bool show_datalen = false;
struct option_info opts[2];
void *err_addr;
+ unsigned long last_addr, lowest_addr;
+ bool image_found;
#ifdef CYGHWR_REDBOOT_ARM_FLASH_SIB
// FIXME: this is somewhat half-baked
extern void arm_fis_list(void);
arm_fis_list();
@@ -464,20 +466,35 @@ fis_list(int argc, char *argv[])
if (!scan_opts(argc, argv, 2, opts, i, 0, 0, ""))
{
return;
}
flash_read(fis_addr, fis_work_block, fisdir_size, (void **)&err_addr);
- img = (struct fis_image_desc *) fis_work_block;
// Let diag_printf do the formatting in both cases, rather than counting
// cols by hand....
diag_printf("%-16s %-10s %-10s %-10s %-s\n",
"Name","FLASH addr",
show_cksums ? "Checksum" : "Mem addr",
show_datalen ? "Datalen" : "Length",
"Entry point" );
- for (i = 0; i < fisdir_size/sizeof(*img); i++, img++) {
- if (img->name[0] != (unsigned char)0xFF) {
+ last_addr = 0;
+ image_indx = 0;
+ do {
+ image_found = false;
+ lowest_addr = 0xFFFFFFFF;
+ img = (struct fis_image_desc *) fis_work_block;
+ for (i = 0; i < fisdir_size/sizeof(*img); i++, img++) {
+ if (img->name[0] != (unsigned char)0xFF) {
+ if ((img->flash_base > last_addr) && (img->flash_base < lowest_addr)) {
+ lowest_addr = img->flash_base;
+ image_found = true;
+ image_indx = i;
+ }
+ }
+ }
+ if (image_found) {
+ img = (struct fis_image_desc *) fis_work_block;
+ img += image_indx;
diag_printf("%-16s 0x%08lX 0x%08lX 0x%08lX 0x%08lX\n", img->name,
img->flash_base,
#ifdef CYGSEM_REDBOOT_FIS_CRC_CHECK
show_cksums ? img->file_cksum : img->mem_base,
show_datalen ? img->data_length : img->size,
@@ -485,11 +502,12 @@ fis_list(int argc, char *argv[])
img->mem_base,
img->size,
#endif
img->entry_point);
}
- }
+ last_addr = lowest_addr;
+ } while (image_found == true);
}
static void
fis_free(int argc, char *argv[])
{