From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18900 invoked by alias); 11 Jul 2009 11:33:50 -0000 Received: (qmail 18892 invoked by uid 22791); 11 Jul 2009 11:33:50 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from hermes.mlbassoc.com (HELO mail.chez-thomas.org) (76.76.67.137) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 11 Jul 2009 11:33:43 +0000 Received: by mail.chez-thomas.org (Postfix, from userid 999) id 2ED943B52C67; Sat, 11 Jul 2009 05:33:41 -0600 (MDT) Received: from hermes.chez-thomas.org (hermes_local [192.168.1.101]) by mail.chez-thomas.org (Postfix) with ESMTP id D428E3B5261E; Sat, 11 Jul 2009 05:33:40 -0600 (MDT) Message-ID: <4A587894.3050200@mlbassoc.com> Date: Sat, 11 Jul 2009 11:33:00 -0000 From: Gary Thomas User-Agent: Thunderbird 2.0.0.19 (X11/20090105) MIME-Version: 1.0 To: Stanislav Meduna CC: eCos Discussion References: <4A5858BE.9000005@meduna.org> In-Reply-To: <4A5858BE.9000005@meduna.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: Re: [ECOS] How to write a complicated bootloader? X-SW-Source: 2009-07/txt/msg00070.txt.bz2 Stanislav Meduna wrote: > Hi, > > I have a hardware with a complicated ethernet device that > is not usable in a polled mode (or at least I don't have enough > documentation to be able to use it in such a way). There > is an OEM driver needing all kind of stuff (including eCos > kernel) to run, that works fine in a regular application. > > The hardware has a serial port, which is enough for debugging, > but pain in the you know where for downloading our 2+ MB large > binary over max. 115200 bps. In the field this serial port > won't be available at all, so the only way to upgrade the device > is via ethernet. > > What I'd like to have is some kind of bootloader, that > is able to > - load the application via ethernet > - manipulate the flash (application upgrade and at least > initialize the jffs, even better to access it filewise) > - start the loaded application > - support debugging the application at least over serial > line including the asynchronous ctrl-c support > (ethernet in a way of gdbserver would be nice, but > I imagine this can't be achieved in the eCos architecture > where the application and OS can't be really separated) > > > Is there any special magic in loading an application somewhere > into memory and transfer control to it, while leaving the > GDB stubs in the bootloader? For the development cycle > I imagine something like: > > - connect with the gdb over serial > - connect with a telnet-like interface over ethernet > - initiate a tftp load > - run the application > - the application loads, runs and breaks into the gdb > as soon as the basic initialization is done (everything > else in the bootloader is now dead, only the vectors > needed for serial comm remain) > > Is there information (and examples) available on how to approach > this? > > > Many thanks for hints Rather than reinvent the wheel (or maybe fire...), I think you'd be better off just getting your ethernet device driver running with RedBoot. eCos network drivers use the same API whether they are running in a full eCos application (using interrupts) or as part of RedBoot (polled), so it should be pretty easy to get it to work if you already have code that runs with a full eCos system. -- ------------------------------------------------------------ Gary Thomas | Consulting for the MLB Associates | Embedded world ------------------------------------------------------------ -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss