public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Redboot boot script?
@ 2001-04-23  7:22 Dennis Ehlin (ECS)
  2001-04-23 10:58 ` Jonathan Larmour
  0 siblings, 1 reply; 6+ messages in thread
From: Dennis Ehlin (ECS) @ 2001-04-23  7:22 UTC (permalink / raw)
  To: ecos-discuss

Is it possible to use a "static boot script" i.e a script defined when RedBoot is compiled ?
And this without having any flash memory support compiled into RedBoot.
 
What I want to do is to get RedBoot to load an image from flash into RAM an exec it after a delay.
 
//Dennis

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ECOS] Redboot boot script?
  2001-04-23  7:22 [ECOS] Redboot boot script? Dennis Ehlin (ECS)
@ 2001-04-23 10:58 ` Jonathan Larmour
  0 siblings, 0 replies; 6+ messages in thread
From: Jonathan Larmour @ 2001-04-23 10:58 UTC (permalink / raw)
  To: Dennis Ehlin (ECS); +Cc: ecos-discuss

"Dennis Ehlin (ECS)" wrote:
> 
> Is it possible to use a "static boot script" i.e a script defined when RedBoot is compiled ?
> And this without having any flash memory support compiled into RedBoot.
> 
> What I want to do is to get RedBoot to load an image from flash into RAM an exec it after a delay.

Not at present but I think it would be trivial to add.

FWIW, here's my thoughts. Create a new CDL option for scripting, 
CYGFUN_REDBOOT_BOOT_SCRIPT. This can be enabled either when
CYGSEM_REDBOOT_FLASH_CONFIG is enabled, or if a new option of flavor
booldata called CYGDAT_REDBOOT_DEFAULT_BOOT_SCRIPT is defined.

Change this ifdef in redboot.h:

#ifdef CYGSEM_REDBOOT_FLASH_CONFIG
EXTERN unsigned char *script;
EXTERN int script_timeout;
#endif

to #ifdef CYGFUN_REDBOOT_BOOT_SCRIPT

At around line 215 or so of redboot's main.c change:

#ifdef CYGSEM_REDBOOT_FLASH_CONFIG
    // Give the guy a chance to abort any boot script
    if (script) {

to

#ifdef CYGFUN_REDBOOT_BOOT_SCRIPT
    // Give the guy a chance to abort any boot script
#ifdef CYGDAT_REDBOOT_DEFAULT_BOOT_SCRIPT
    if (!script)
      script = CYGDAT_REDBOOT_DEFAULT_BOOT_SCRIPT;
#endif
    if (script) {

You'll need to do some further tweaking of the CDL options to move some of
the existing options to do with scripting underneath the new
CYGFUN_REDBOOT_BOOT_SCRIPT component.

If you did that and sent the patches, that would be brill :-).

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ECOS] Redboot boot script?
  2001-05-17 23:48 Dennis Ehlin (ECS)
@ 2001-05-18  6:49 ` Jonathan Larmour
  0 siblings, 0 replies; 6+ messages in thread
From: Jonathan Larmour @ 2001-05-18  6:49 UTC (permalink / raw)
  To: Dennis Ehlin (ECS); +Cc: ecos-discuss

"Dennis Ehlin (ECS)" wrote:
> 
> Where did this go ?

Believe it or not the anonymous CVS repository wasn't updated till 15
minutes before your message :-).

In case anyone is wondering, yes it is meant to get updated more frequently
than that, but I was too busy :-|.

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [ECOS] Redboot boot script?
@ 2001-05-17 23:48 Dennis Ehlin (ECS)
  2001-05-18  6:49 ` Jonathan Larmour
  0 siblings, 1 reply; 6+ messages in thread
From: Dennis Ehlin (ECS) @ 2001-05-17 23:48 UTC (permalink / raw)
  To: 'Jonathan Larmour'; +Cc: ecos-discuss

Where did this go ?

"
"Dennis Ehlin (ECS)" wrote:
> 
> Hi,
> 
> Is this what you ment ?
> I tested it on my ppc target and it seems to work.

Excellent, thanks! I'll put this in our sources, and it'll appear in the
next anonCVS update.

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine
"


-----Original Message-----
From: Dennis Ehlin (ECS) [ mailto:Dennis.Ehlin@ecs.ericsson.se ]
Sent: Wednesday, May 02, 2001 7:57 AM
To: 'Jonathan Larmour'
Cc: ecos-discuss@sources.redhat.com
Subject: RE: [ECOS] Redboot boot script?


Hi,

Is this what you ment ?
I tested it on my ppc target and it seems to work.

//Dennis

diff -ur redboot.orig/current/cdl/redboot.cdl redboot/current/cdl/redboot.cdl
--- redboot.orig/current/cdl/redboot.cdl	Sat Apr  7 05:17:50 2001
+++ redboot/current/cdl/redboot.cdl	Wed Apr 25 08:22:29 2001
@@ -323,11 +323,37 @@
               this is somewhat safer, it does add overhead during updates."
         }
 
+        cdl_option CYGSEM_REDBOOT_FIS_CRC_CHECK {
+            display       "Use CRC checksums on FIS images."
+            flavor        bool
+            default_value 1
+            description "
+              When this option is enabled, RedBoot will use CRC checksums
+              when reading and writing flash images."
+        }
+    }
+
+    cdl_option CYGDAT_REDBOOT_DEFAULT_BOOT_SCRIPT {
+	display		"Use default RedBoot boot script"
+	flavor		booldata
+	default_value	0
+	description "
+	  If enabled, this option will tell RedBoot to use this options value
+	  as a default boot script."
+    }
+
+    cdl_component CYGSEM_REDBOOT_BOOT_SCRIPT {
+	display		"Activates RedBoot boot script"
+	flavor		bool
+	default_value	{ CYGDAT_REDBOOT_DEFAULT_BOOT_SCRIPT || CYGSEM_REDBOOT_FLASH_CONFIG }
+	description "
+	  This option enables the RedBoot boot script functionality." 
+
         cdl_option CYGNUM_REDBOOT_FLASH_SCRIPT_TIMEOUT_RESOLUTION {
             display       "Resolution (in ms) for script timeout value."
             flavor        data
             default_value 1000
-            active_if     CYGSEM_REDBOOT_FLASH_CONFIG
+            active_if     { CYGDAT_REDBOOT_DEFAULT_BOOT_SCRIPT || CYGSEM_REDBOOT_FLASH_CONFIG }
             description "
               This option controls the resolution of the script timeout.
               The value is specified in milliseconds (ms), thus to have the
@@ -338,19 +364,10 @@
             display       "Default script timeout value"
             flavor        data
             default_value 10
-            active_if     CYGSEM_REDBOOT_FLASH_CONFIG
+            active_if     { CYGDAT_REDBOOT_DEFAULT_BOOT_SCRIPT || CYGSEM_REDBOOT_FLASH_CONFIG }
             description "
               This option is used to set the default timeout for startup
               scripts, when they are enabled."
-        }
-
-        cdl_option CYGSEM_REDBOOT_FIS_CRC_CHECK {
-            display       "Use CRC checksums on FIS images."
-            flavor        bool
-            default_value 1
-            description "
-              When this option is enabled, RedBoot will use CRC checksums
-              when reading and writing flash images."
         }
     }
 
diff -ur redboot.orig/current/include/redboot.h redboot/current/include/redboot.h
--- redboot.orig/current/include/redboot.h	Sat Apr  7 05:17:50 2001
+++ redboot/current/include/redboot.h	Tue Apr 24 14:45:19 2001
@@ -87,7 +87,7 @@
 EXTERN int gdb_port;
 #endif
 
-#ifdef CYGSEM_REDBOOT_FLASH_CONFIG
+#ifdef CYGSEM_REDBOOT_BOOT_SCRIPT
 EXTERN unsigned char *script;
 EXTERN int script_timeout;
 #endif
diff -ur redboot.orig/current/src/io.c redboot/current/src/io.c
--- redboot.orig/current/src/io.c	Sat Apr  7 05:17:51 2001
+++ redboot/current/src/io.c	Tue Apr 24 14:02:09 2001
@@ -183,7 +183,7 @@
     static char last_ch = '\0';
 
     while (true) {
-#ifdef CYGSEM_REDBOOT_FLASH_CONFIG
+#ifdef CYGSEM_REDBOOT_BOOT_SCRIPT
         if (script && *script) {
             c = *script++;
             do_idle(false);
@@ -318,18 +318,18 @@
 {
     va_list ap;
     char ans[8];
-#ifdef CYGSEM_REDBOOT_FLASH_CONFIG
+#ifdef CYGSEM_REDBOOT_BOOT_SCRIPT
     unsigned char *hold_script = script;
 #endif
 
     va_start(ap, fmt);
     vprintf(fmt, ap);
     printf(" - are you sure (y/n)? ");
-#ifdef CYGSEM_REDBOOT_FLASH_CONFIG
+#ifdef CYGSEM_REDBOOT_BOOT_SCRIPT
     script = (unsigned char *)0;
 #endif
     gets(ans, sizeof(ans), 0);
-#ifdef CYGSEM_REDBOOT_FLASH_CONFIG
+#ifdef CYGSEM_REDBOOT_BOOT_SCRIPT
     script = hold_script;
 #endif
     return ((ans[0] == 'y') || (ans[0] == 'Y'));
diff -ur redboot.orig/current/src/main.c redboot/current/src/main.c
--- redboot.orig/current/src/main.c	Sat Apr  7 05:17:52 2001
+++ redboot/current/src/main.c	Tue Apr 24 14:47:31 2001
@@ -205,8 +205,13 @@
     user_ram_end = workspace_end;
     do_version(0,0);
 
-#ifdef CYGSEM_REDBOOT_FLASH_CONFIG
+#ifdef CYGSEM_REDBOOT_BOOT_SCRIPT
     // Give the guy a chance to abort any boot script
+#ifdef CYGDAT_REDBOOT_DEFAULT_BOOT_SCRIPT
+    script_timeout = CYGNUM_REDBOOT_FLASH_SCRIPT_DEFAULT_TIMEOUT;
+    if (!script)
+      script = CYGDAT_REDBOOT_DEFAULT_BOOT_SCRIPT;
+#endif
     if (script) {
         unsigned char *hold_script = script;
         int script_timeout_ms = script_timeout * CYGNUM_REDBOOT_FLASH_SCRIPT_TIMEOUT_RESOLUTION;

-----Original Message-----
From: Jonathan Larmour [ mailto:jlarmour@redhat.com ]
Sent: Monday, April 23, 2001 7:58 PM
To: Dennis Ehlin (ECS)
Cc: ecos-discuss@sources.redhat.com
Subject: Re: [ECOS] Redboot boot script?


"Dennis Ehlin (ECS)" wrote:
> 
> Is it possible to use a "static boot script" i.e a script defined when RedBoot is compiled ?
> And this without having any flash memory support compiled into RedBoot.
> 
> What I want to do is to get RedBoot to load an image from flash into RAM an exec it after a delay.

Not at present but I think it would be trivial to add.

FWIW, here's my thoughts. Create a new CDL option for scripting, 
CYGFUN_REDBOOT_BOOT_SCRIPT. This can be enabled either when
CYGSEM_REDBOOT_FLASH_CONFIG is enabled, or if a new option of flavor
booldata called CYGDAT_REDBOOT_DEFAULT_BOOT_SCRIPT is defined.

Change this ifdef in redboot.h:

#ifdef CYGSEM_REDBOOT_FLASH_CONFIG
EXTERN unsigned char *script;
EXTERN int script_timeout;
#endif

to #ifdef CYGFUN_REDBOOT_BOOT_SCRIPT

At around line 215 or so of redboot's main.c change:

#ifdef CYGSEM_REDBOOT_FLASH_CONFIG
    // Give the guy a chance to abort any boot script
    if (script) {

to

#ifdef CYGFUN_REDBOOT_BOOT_SCRIPT
    // Give the guy a chance to abort any boot script
#ifdef CYGDAT_REDBOOT_DEFAULT_BOOT_SCRIPT
    if (!script)
      script = CYGDAT_REDBOOT_DEFAULT_BOOT_SCRIPT;
#endif
    if (script) {

You'll need to do some further tweaking of the CDL options to move some of
the existing options to do with scripting underneath the new
CYGFUN_REDBOOT_BOOT_SCRIPT component.

If you did that and sent the patches, that would be brill :-).

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ECOS] Redboot boot script?
  2001-05-01 22:57 Dennis Ehlin (ECS)
@ 2001-05-02 11:55 ` Jonathan Larmour
  0 siblings, 0 replies; 6+ messages in thread
From: Jonathan Larmour @ 2001-05-02 11:55 UTC (permalink / raw)
  To: Dennis Ehlin (ECS); +Cc: ecos-discuss

"Dennis Ehlin (ECS)" wrote:
> 
> Hi,
> 
> Is this what you ment ?
> I tested it on my ppc target and it seems to work.

Excellent, thanks! I'll put this in our sources, and it'll appear in the
next anonCVS update.

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [ECOS] Redboot boot script?
@ 2001-05-01 22:57 Dennis Ehlin (ECS)
  2001-05-02 11:55 ` Jonathan Larmour
  0 siblings, 1 reply; 6+ messages in thread
From: Dennis Ehlin (ECS) @ 2001-05-01 22:57 UTC (permalink / raw)
  To: 'Jonathan Larmour'; +Cc: ecos-discuss

Hi,

Is this what you ment ?
I tested it on my ppc target and it seems to work.

//Dennis

diff -ur redboot.orig/current/cdl/redboot.cdl redboot/current/cdl/redboot.cdl
--- redboot.orig/current/cdl/redboot.cdl	Sat Apr  7 05:17:50 2001
+++ redboot/current/cdl/redboot.cdl	Wed Apr 25 08:22:29 2001
@@ -323,11 +323,37 @@
               this is somewhat safer, it does add overhead during updates."
         }
 
+        cdl_option CYGSEM_REDBOOT_FIS_CRC_CHECK {
+            display       "Use CRC checksums on FIS images."
+            flavor        bool
+            default_value 1
+            description "
+              When this option is enabled, RedBoot will use CRC checksums
+              when reading and writing flash images."
+        }
+    }
+
+    cdl_option CYGDAT_REDBOOT_DEFAULT_BOOT_SCRIPT {
+	display		"Use default RedBoot boot script"
+	flavor		booldata
+	default_value	0
+	description "
+	  If enabled, this option will tell RedBoot to use this options value
+	  as a default boot script."
+    }
+
+    cdl_component CYGSEM_REDBOOT_BOOT_SCRIPT {
+	display		"Activates RedBoot boot script"
+	flavor		bool
+	default_value	{ CYGDAT_REDBOOT_DEFAULT_BOOT_SCRIPT || CYGSEM_REDBOOT_FLASH_CONFIG }
+	description "
+	  This option enables the RedBoot boot script functionality." 
+
         cdl_option CYGNUM_REDBOOT_FLASH_SCRIPT_TIMEOUT_RESOLUTION {
             display       "Resolution (in ms) for script timeout value."
             flavor        data
             default_value 1000
-            active_if     CYGSEM_REDBOOT_FLASH_CONFIG
+            active_if     { CYGDAT_REDBOOT_DEFAULT_BOOT_SCRIPT || CYGSEM_REDBOOT_FLASH_CONFIG }
             description "
               This option controls the resolution of the script timeout.
               The value is specified in milliseconds (ms), thus to have the
@@ -338,19 +364,10 @@
             display       "Default script timeout value"
             flavor        data
             default_value 10
-            active_if     CYGSEM_REDBOOT_FLASH_CONFIG
+            active_if     { CYGDAT_REDBOOT_DEFAULT_BOOT_SCRIPT || CYGSEM_REDBOOT_FLASH_CONFIG }
             description "
               This option is used to set the default timeout for startup
               scripts, when they are enabled."
-        }
-
-        cdl_option CYGSEM_REDBOOT_FIS_CRC_CHECK {
-            display       "Use CRC checksums on FIS images."
-            flavor        bool
-            default_value 1
-            description "
-              When this option is enabled, RedBoot will use CRC checksums
-              when reading and writing flash images."
         }
     }
 
diff -ur redboot.orig/current/include/redboot.h redboot/current/include/redboot.h
--- redboot.orig/current/include/redboot.h	Sat Apr  7 05:17:50 2001
+++ redboot/current/include/redboot.h	Tue Apr 24 14:45:19 2001
@@ -87,7 +87,7 @@
 EXTERN int gdb_port;
 #endif
 
-#ifdef CYGSEM_REDBOOT_FLASH_CONFIG
+#ifdef CYGSEM_REDBOOT_BOOT_SCRIPT
 EXTERN unsigned char *script;
 EXTERN int script_timeout;
 #endif
diff -ur redboot.orig/current/src/io.c redboot/current/src/io.c
--- redboot.orig/current/src/io.c	Sat Apr  7 05:17:51 2001
+++ redboot/current/src/io.c	Tue Apr 24 14:02:09 2001
@@ -183,7 +183,7 @@
     static char last_ch = '\0';
 
     while (true) {
-#ifdef CYGSEM_REDBOOT_FLASH_CONFIG
+#ifdef CYGSEM_REDBOOT_BOOT_SCRIPT
         if (script && *script) {
             c = *script++;
             do_idle(false);
@@ -318,18 +318,18 @@
 {
     va_list ap;
     char ans[8];
-#ifdef CYGSEM_REDBOOT_FLASH_CONFIG
+#ifdef CYGSEM_REDBOOT_BOOT_SCRIPT
     unsigned char *hold_script = script;
 #endif
 
     va_start(ap, fmt);
     vprintf(fmt, ap);
     printf(" - are you sure (y/n)? ");
-#ifdef CYGSEM_REDBOOT_FLASH_CONFIG
+#ifdef CYGSEM_REDBOOT_BOOT_SCRIPT
     script = (unsigned char *)0;
 #endif
     gets(ans, sizeof(ans), 0);
-#ifdef CYGSEM_REDBOOT_FLASH_CONFIG
+#ifdef CYGSEM_REDBOOT_BOOT_SCRIPT
     script = hold_script;
 #endif
     return ((ans[0] == 'y') || (ans[0] == 'Y'));
diff -ur redboot.orig/current/src/main.c redboot/current/src/main.c
--- redboot.orig/current/src/main.c	Sat Apr  7 05:17:52 2001
+++ redboot/current/src/main.c	Tue Apr 24 14:47:31 2001
@@ -205,8 +205,13 @@
     user_ram_end = workspace_end;
     do_version(0,0);
 
-#ifdef CYGSEM_REDBOOT_FLASH_CONFIG
+#ifdef CYGSEM_REDBOOT_BOOT_SCRIPT
     // Give the guy a chance to abort any boot script
+#ifdef CYGDAT_REDBOOT_DEFAULT_BOOT_SCRIPT
+    script_timeout = CYGNUM_REDBOOT_FLASH_SCRIPT_DEFAULT_TIMEOUT;
+    if (!script)
+      script = CYGDAT_REDBOOT_DEFAULT_BOOT_SCRIPT;
+#endif
     if (script) {
         unsigned char *hold_script = script;
         int script_timeout_ms = script_timeout * CYGNUM_REDBOOT_FLASH_SCRIPT_TIMEOUT_RESOLUTION;

-----Original Message-----
From: Jonathan Larmour [ mailto:jlarmour@redhat.com ]
Sent: Monday, April 23, 2001 7:58 PM
To: Dennis Ehlin (ECS)
Cc: ecos-discuss@sources.redhat.com
Subject: Re: [ECOS] Redboot boot script?


"Dennis Ehlin (ECS)" wrote:
> 
> Is it possible to use a "static boot script" i.e a script defined when RedBoot is compiled ?
> And this without having any flash memory support compiled into RedBoot.
> 
> What I want to do is to get RedBoot to load an image from flash into RAM an exec it after a delay.

Not at present but I think it would be trivial to add.

FWIW, here's my thoughts. Create a new CDL option for scripting, 
CYGFUN_REDBOOT_BOOT_SCRIPT. This can be enabled either when
CYGSEM_REDBOOT_FLASH_CONFIG is enabled, or if a new option of flavor
booldata called CYGDAT_REDBOOT_DEFAULT_BOOT_SCRIPT is defined.

Change this ifdef in redboot.h:

#ifdef CYGSEM_REDBOOT_FLASH_CONFIG
EXTERN unsigned char *script;
EXTERN int script_timeout;
#endif

to #ifdef CYGFUN_REDBOOT_BOOT_SCRIPT

At around line 215 or so of redboot's main.c change:

#ifdef CYGSEM_REDBOOT_FLASH_CONFIG
    // Give the guy a chance to abort any boot script
    if (script) {

to

#ifdef CYGFUN_REDBOOT_BOOT_SCRIPT
    // Give the guy a chance to abort any boot script
#ifdef CYGDAT_REDBOOT_DEFAULT_BOOT_SCRIPT
    if (!script)
      script = CYGDAT_REDBOOT_DEFAULT_BOOT_SCRIPT;
#endif
    if (script) {

You'll need to do some further tweaking of the CDL options to move some of
the existing options to do with scripting underneath the new
CYGFUN_REDBOOT_BOOT_SCRIPT component.

If you did that and sent the patches, that would be brill :-).

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2001-05-18  6:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-04-23  7:22 [ECOS] Redboot boot script? Dennis Ehlin (ECS)
2001-04-23 10:58 ` Jonathan Larmour
2001-05-01 22:57 Dennis Ehlin (ECS)
2001-05-02 11:55 ` Jonathan Larmour
2001-05-17 23:48 Dennis Ehlin (ECS)
2001-05-18  6:49 ` Jonathan Larmour

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).