public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: "ariga masahiro" <ariga@link-lab.co.jp>
To: "Sergei Gavrikov" <w3sg@SoftHome.net>
Cc: <ecos-discuss@ecos.sourceware.org>
Subject: Re: [ECOS] Is there any way to branch in Boot Script
Date: Fri, 20 Jul 2007 01:23:00 -0000	[thread overview]
Message-ID: <000901c7ca6c$83b95b30$1c0110ac@ariga> (raw)
In-Reply-To: <20070718182420.GA10883@ubuntu>

Hi,Sergei and others,

Thank you,Sergei,for your very "brainwashing" answer.

But although I earnestly grepped "cyg_plf_redboot_startup",
or even "CYGSEM_REDBOOT_PLF_STARTUP",
I could not hit any file in my ecos source directory.

Since your answer is very suitable to "what I want to do",
please elaborate a little more,please?

By the way my target uses SH7709 CPU.

I am looking forward to your kindly answer.

Masahiro Ariga

----- Original Message ----- 
From: "Sergei Gavrikov" <w3sg@SoftHome.net>
To: "ariga masahiro" <ariga@link-lab.co.jp>
Cc: <ecos-discuss@ecos.sourceware.org>
Sent: Thursday, July 19, 2007 3:24 AM
Subject: Re: [ECOS] Is there any way to branch in Boot Script


> On Wed, Jul 18, 2007 at 09:09:07PM +0300, Sergei Gavrikov wrote:
>> On Tue, Jul 17, 2007 at 04:37:33PM +0900, ariga masahiro wrote:
>> > Hi,Everyone,
>> >
>> > I beseech you to help me out of next predicament.
>> >
>> > What I want to do is this:
>> >  In RedBoot Boot Script,read Target Board DIPSW-settled value,
>> >  and compare already-written value in a certain address.
>> >  (for example,use mcmp command)
>> >  If same, continue next Boot Script command.
>> >  If differs,quit Boot Script and return to RedBoot's prompt.
>> >
>> > My questions are:
>> >  1.Is there any way to know mcmp result(that is ,succeeded or errored).
>> >    Preferably in RedBoot Boot Script.
>> >  2.Is there any way to use branching statement(like,if-else),
>> >    in RedBoot Boot Script
>>
>> It's pity, but RedBoot != shell, so it hasn't such behaviours. Some guys
>> dream about those behaviours :-) But, every RedBoot command (redboot.h)
>> is just it
>>
>> typedef void cmd_fun(int argc, char *argv[]);
>>
>> Therefore, it is no way to return any result (Ups, I did think about
>> `argv' :). Also, there is no global variable, something like the DOS
>> `errorlevel' (to check/collect the fails) there. More that, if the
>> RedBoot's parser does meet wrong line in a script, it passes the line a
>> bit noisely and then it continues to parse a rest of the script.
>>
>> >  3.Is there any way to realize above-mentioned "what I want to do".
>>
>> I had same needs (to read the DIP switches). And I did use such a way.
>> Well, if your RedBoot/eCos aren't fucked binaries, i.e. if you have the
>> target sources, you can put same stuff in your plf_misc.c file
>>
>> ---------------------------------------------------------->8
>> #include <pkgconf/system.h>
>>
>> #ifdef CYGPKG_REDBOOT
>> #include <redboot.h>            // script declaration
>>
>> #define DIPSW_MASK (1 << 7)     // FIXME: put yours
>>
>> #ifdef CYGSEM_REDBOOT_PLF_STARTUP
>> void
>> cyg_plf_redboot_startup (void)
>> {
>>     int             switches = 0;
>>
>>     // put a code to read the switches here
>>
>>     if (switches & DIPSW_MASK)
>>         // don't run the script
>>         script = 0;
>> }
>> #endif // CYGSEM_REDBOOT_PLF_STARTUP
>> #endif // CYGPKG_REDBOOT
>> ---------------------------------------------------------->8
>>
>> Note: before to build RedBoot with this tweak, set this option in your
>> `ecos.ecc':
>>
>> cdl_option CYGSEM_REDBOOT_PLF_STARTUP {user_value 1};
>>
>> For more details, look at cyg_start () in redboot/current/src/main.c,
>> you would find your own way for that.
>>
>
> A bit more, redboot.cdl contains yet another option... So, with a code
> above, you can run an alternate script instead default one, if you put
> there something like this
>
> cdl_option CYGDAT_REDBOOT_DEFAULT_BOOT_SCRIPT {1 {alt_script}};
>
> Note: a declaration/filling that `alt_script' is your deal, certainly.
>
> Sergei
> 


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

  reply	other threads:[~2007-07-20  1:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-17  7:37 ariga masahiro
2007-07-18 18:10 ` Sergei Gavrikov
2007-07-18 18:25   ` Sergei Gavrikov
2007-07-20  1:23     ` ariga masahiro [this message]
2007-07-20  1:46 ariga masahiro
2007-07-20  4:38 ` Sergei Gavrikov

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='000901c7ca6c$83b95b30$1c0110ac@ariga' \
    --to=ariga@link-lab.co.jp \
    --cc=ecos-discuss@ecos.sourceware.org \
    --cc=w3sg@SoftHome.net \
    /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).