This is the mail archive of the ecos-discuss@sources.redhat.com 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]

Re: Application loading from hyper terminal


Note: email sent directly to Red Hat engineers can and will be ignored.
Please copy all email to the eCos discussion list ecos-discuss.

On 27-Jul-2001 Ashutosh Sharma wrote:
> Following is the result from version command:
> 
> RedBoot(tm) bootstrap and debug environment - built
> 05:37:52, Jun  8 2001
> 
> Platform: PC (I386)
> Copyright (C) 2000, 2001, Red Hat, Inc.
> 
> RAM: 0x00000000-0x000a0000, 0x0007c080-0x000a0000
> available
> RedBoot>
> 
> This is the small part of the objdump of the file
> 
> twothreads.exe:     file format elf32-i386
> 
> Disassembly of section .text:
> 
> 00108000 <_start>:
>   108000: e4 64       in     $0x64,%al
>   108002: a8 02        test   $0x2,%al
>   108004: 75 fa        jne    108000 <_start>
>   108006: e4 64       in     $0x64,%al
>   108008: a8 01       test   $0x1,%al
>   10800a: 74 04       je     108010 <_start+0x10>
>   10800c: e4 60       in     $0x60,%al
> 
> 
> These results are form the default configuration of
> the eCos build. Should I change the memory location in
> the RAM build of my application.

You're problem is an artifact of the PC system which we don't have a
perfect solution for (at the moment).  RedBoot will currently insist on
verifying that the memory you are trying to load into is "available".  On
this platform, RedBoot only knows about RAM up to 0xa0000 (see above).

If you want to rebuild RedBoot, you can apply this patch and disable the
CYGSEM_REDBOOT_VALIDATE_USER_RAM_LOADS option which should fix the problem 
you're seeing.

Don't forget, next time, copy to the list.

================ <cut-here>  =============================================

Index: redboot/current/src/load.c
===================================================================
RCS file: /home/cvs/ecc/ecc/redboot/current/src/load.c,v
retrieving revision 1.32
diff -u -5 -p -r1.32 load.c
--- redboot/current/src/load.c  2001/07/25 18:27:49     1.32
+++ redboot/current/src/load.c  2001/07/27 17:12:05
@@ -160,15 +160,17 @@ load_srec_image(int (*getc)(void), unsig
             }
             addr += addr_offset;
             if ((unsigned long)(addr-addr_offset) < lowest_address) {
                 lowest_address = (unsigned long)(addr - addr_offset);
             }
+#ifdef CYGSEM_REDBOOT_VALIDATE_USER_RAM_LOADS
             if ((addr < user_ram_start) || (addr > user_ram_end)) {
                 if (!verify_action("Attempt to load S-record data to address: %p\n"
                                    "RedBoot does not believe this is in RAM", (void*)addr))
                     return 0;
             }
+#endif
             count -= ((type-'1'+2)+1);
             offset += count;
             while (count-- > 0) {
                 val = _hex2(getc, 1, &sum);
                 *addr++ = val;
@@ -368,16 +370,18 @@ do_load(int argc, char *argv[])
         printf("File name missing\n");
         printf("usage: load %s\n", usage);
         return;
     }
 #endif
+#ifdef CYGSEM_REDBOOT_VALIDATE_USER_RAM_LOADS
     if (base_addr_set &&
         ((base < (unsigned long)user_ram_start) ||
          (base > (unsigned long)user_ram_end))) {
         if (!verify_action("Specified address (%p) is not believed to be in RAM", (void*)base))
             return;
     }
+#endif
     if (raw && !base_addr_set) {
         printf("Raw load requires a memory address\n");
         return;
     }
 #ifdef CYGPKG_REDBOOT_NETWORKING
Index: redboot/current/cdl/redboot.cdl
===================================================================
RCS file: /home/cvs/ecc/ecc/redboot/current/cdl/redboot.cdl,v
retrieving revision 1.55
diff -u -5 -p -r1.55 redboot.cdl
--- redboot/current/cdl/redboot.cdl     2001/07/27 15:13:45     1.55
+++ redboot/current/cdl/redboot.cdl     2001/07/27 17:12:03
@@ -217,10 +217,22 @@ cdl_package CYGPKG_REDBOOT {
             processors it may be necessary to reduce the size to
             avoid serial overruns. zlib appears to bail out if less than
             five bytes are available initially so this is the minimum."
     }
 
+    cdl_option CYGSEM_REDBOOT_VALIDATE_USER_RAM_LOADS {
+        display       "Validate RAM addresses during load"
+        flavor        bool
+        default_value 1
+        description   "
+          This option controls whether or not RedBoot will make sure that
+          memory being used by the \"load\" command is in fact in user RAM.
+          Leaving the option enabled makes for a safer environment, but this
+          check may not be valid on all platforms, thus the ability to
+          disable it.  ** Disable this only with great care **"
+    }
+
     cdl_component CYGPKG_REDBOOT_FLASH {
         display       "Allow RedBoot to support FLASH programming"
         flavor        bool
         default_value 1
         active_if     CYGPKG_IO_FLASH


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