public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Gary Thomas <gthomas@redhat.com>
To: Ashutosh Sharma <ashutosh_hpm@yahoo.com>
Cc: eCos Discussion <ecos-discuss@sourceware.cygnus.com>
Subject: Re: [ECOS] Application loading from hyper terminal
Date: Fri, 27 Jul 2001 10:19:00 -0000	[thread overview]
Message-ID: <XFMail.20010727111756.gthomas@redhat.com> (raw)
In-Reply-To: <20010727165611.16418.qmail@web3901.mail.yahoo.com>

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

       reply	other threads:[~2001-07-27 10:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20010727165611.16418.qmail@web3901.mail.yahoo.com>
2001-07-27 10:19 ` Gary Thomas [this message]
2001-07-27 11:17   ` Ashutosh Sharma
2001-07-27 12:47   ` Jonathan Larmour
2001-07-26  9:03 Ashutosh Sharma
2001-07-27  1:48 ` Jesper Skov
2001-07-27  9:14   ` Ashutosh Sharma
2001-07-27  9:22     ` Gary Thomas
2001-07-27  9:41       ` Ashutosh Sharma
2001-07-27  9:45         ` Gary Thomas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=XFMail.20010727111756.gthomas@redhat.com \
    --to=gthomas@redhat.com \
    --cc=ashutosh_hpm@yahoo.com \
    --cc=ecos-discuss@sourceware.cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).