From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31767 invoked by alias); 7 Jul 2004 13:57:09 -0000 Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Received: (qmail 31760 invoked from network); 7 Jul 2004 13:57:08 -0000 Received: from unknown (HELO hermes.chez-thomas.org) (63.225.98.241) by sourceware.org with SMTP; 7 Jul 2004 13:57:08 -0000 Received: by hermes.chez-thomas.org (Postfix, from userid 2000) id C5B2C100B67; Wed, 7 Jul 2004 07:57:07 -0600 (MDT) Received: from [127.0.0.1] (localhost.localdomain [127.0.0.1]) by hermes.chez-thomas.org (Postfix) with ESMTP id EE60810000E; Wed, 7 Jul 2004 07:57:06 -0600 (MDT) From: Gary Thomas To: Winkler Andreas Cc: 'eCos Discussion' In-Reply-To: References: Content-Type: multipart/mixed; boundary="=-c8ags4K6btBkbO3ZyR7F" Organization: MLB Associates Message-Id: <1089208626.3988.1227.camel@hermes> Mime-Version: 1.0 Date: Wed, 07 Jul 2004 13:57:00 -0000 X-Spam-Level: X-Spam-Status: No, hits=0.0 required=5.0 tests=AWL autolearn=no version=2.60 X-Spam-Checker-Version: SpamAssassin 2.60 (1.212-2003-09-23-exp) on hermes.chez-thomas.org Subject: RE: [ECOS] Redboots CRC checking X-SW-Source: 2004-07/txt/msg00082.txt.bz2 --=-c8ags4K6btBkbO3ZyR7F Content-Type: text/plain Content-Transfer-Encoding: 7bit Content-length: 2198 On Wed, 2004-07-07 at 07:41, Winkler Andreas wrote: > Hi, > > i first had to buy a flash programmer and to make some holidays. > Now after some weeks i am again struggling with this old problem. > Remember: > I got a Patch from Gary Thomas for the "Linux exec", to > respect the CRC failure. > > In an earlier mail i wrote: > > > after applying the patch i rebuilt Redboot and tried it. > > > But it doesn't work. > > > So i looked into the patch. The concerned file should be > > > pachages/hal/arm/arch/current/src/redboot_linux_exec.c. > > > There i find an addon > > > if (entry == (unsigned long)NO_MEMORY) { > > > diag_printf("Can't execute Linux - invalid entry > > address\n"); > > > return; > > > } > > > For me this doesn't look like a CRC check. > > > Or did I make a mistake in building Redboot? > > Gary Thomas answered: > > No - the "fis load" command will set 'entry_address' to 'NO_MEMORY' if > > there is a CRC error. This code should catch that and cause > > the 'exec' > > command to fail. Of course, it can only do this if you do not specify > > an entry point address. > > > > Exactly what does it do? Perhaps you could print the value of 'entry' > > when it gets to this point. > > I added this print command (entry printed as %x) and got the following: > > RedBoot> fi loa kernel > ** Warning - checksum failure. stored: 0x7ca3fe54, computed: > 0xdde742c4 > RedBoot> e > entry = 6000000 > Using base address 0x01008000 and length 0x000ba7c8 > Uncompressing Linux........... > > invalid compressed format (err=1) > > -- System halted > > This means, that the CRC check is working out. But the exec command doesn't > respect this and is starting the defect kernel. > I had expected, that the exec command wouldn't start the kernel after > recognizing > the CRC failure. Therefore the value of entry should have been 0xffffffff. > Where does this value 0x6000000 come from? It looks like the patch I gave you before was a little incorrect. Try applying this change and let me know how it works. n.b. I'm doing this a little blind as I currently have no ARM hardware online. -- Gary Thomas MLB Associates --=-c8ags4K6btBkbO3ZyR7F Content-Disposition: attachment; filename=diffs Content-Type: text/x-patch; name=diffs; charset=iso-8859-1 Content-Transfer-Encoding: 7bit Content-length: 1686 Index: hal/arm/arch/current/src/redboot_linux_exec.c =================================================================== RCS file: /misc/cvsfiles/ecos/packages/hal/arm/arch/current/src/redboot_linux_exec.c,v retrieving revision 1.11 diff -u -5 -p -r1.11 redboot_linux_exec.c --- hal/arm/arch/current/src/redboot_linux_exec.c 27 May 2004 13:22:07 -0000 1.11 +++ hal/arm/arch/current/src/redboot_linux_exec.c 7 Jul 2004 13:55:13 -0000 @@ -289,10 +289,15 @@ do_exec(int argc, char *argv[]) char line[8]; char *cmd_line; struct tag *params = (struct tag *)CYGHWR_REDBOOT_ARM_LINUX_TAGS_ADDRESS; extern char __tramp_start__[], __tramp_end__[]; + // Check to see if a valid image has been loaded + if (entry_address == (unsigned long)NO_MEMORY) { + diag_printf("Can't execute Linux - invalid entry address\n"); + return; + } // Default physical entry point for Linux is kernel base. entry = (unsigned long)CYGHWR_REDBOOT_ARM_LINUX_EXEC_ADDRESS; base_addr = load_address; length = load_address_end - load_address; @@ -312,14 +317,10 @@ do_exec(int argc, char *argv[]) (void **)&ramdisk_addr, (bool *)&ramdisk_addr_set, "ramdisk_addr"); init_opts(&opts[5], 's', true, OPTION_ARG_TYPE_NUM, (void **)&ramdisk_size, (bool *)&ramdisk_size_set, "ramdisk_size"); if (!scan_opts(argc, argv, 1, opts, 6, (void *)&entry, OPTION_ARG_TYPE_NUM, "[physical] starting address")) { - return; - } - if (entry == (unsigned long)NO_MEMORY) { - diag_printf("Can't execute Linux - invalid entry address\n"); return; } // Set up parameters to pass to kernel --=-c8ags4K6btBkbO3ZyR7F Content-Type: text/plain; charset=us-ascii Content-length: 148 -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss --=-c8ags4K6btBkbO3ZyR7F--