This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
Redboot jumb patch
- From: Andrew Lunn <andrew dot lunn at ascom dot ch>
- To: ecos-patches at sources dot redhat dot com
- Date: Mon, 5 Aug 2002 17:12:35 +0200
- Subject: Redboot jumb patch
Hi Folks
Here is a patch for redboot. I needed to make redboot smaller so that
i could squeeze it into the same space an older, less feature rich
version used. I've made more of the commands conditional
compilable. Being able to leave out xzymodem when using networking
helps a lot. The linker then leaves out all the crc16 code which has a
big table etc. Unless you are running linux, the exec command is a
waste of space so i've also made is possible to disabled that. Thats
was not so easy since each HAL provides this command. I had to modify
quite a few HALs.
I also fixed one bug in the boot script code. See my recent
ecos-discuss email.
Andrew
Index: hal/arm/arch/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/arch/current/ChangeLog,v
retrieving revision 1.72
diff -c -c -r1.72 ChangeLog
*** hal/arm/arch/current/ChangeLog 15 Jul 2002 19:37:12 -0000 1.72
--- hal/arm/arch/current/ChangeLog 5 Aug 2002 14:36:14 -0000
***************
*** 1,3 ****
--- 1,7 ----
+ 2002-08-02 Andrew Lunn <Andrew.Lunn@ascom.ch>
+
+ * src/redboot_cmds.c: exec command can now be disabled by CDL
+
2002-07-15 Mark Salter <msalter@redhat.com>
* include/arm_stub.h: Comment out NUMREGBYTES.
Index: hal/arm/arch/current/src/redboot_linux_exec.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/arch/current/src/redboot_linux_exec.c,v
retrieving revision 1.3
diff -c -c -r1.3 redboot_linux_exec.c
*** hal/arm/arch/current/src/redboot_linux_exec.c 31 May 2002 01:05:54 -0000 1.3
--- hal/arm/arch/current/src/redboot_linux_exec.c 5 Aug 2002 14:36:14 -0000
***************
*** 71,76 ****
--- 71,78 ----
#include <cyg/hal/hal_io.h>
+ #ifdef CYGBLD_BUILD_REDBOOT_WITH_EXEC
+
#ifndef CYGARC_PHYSICAL_ADDRESS
# error
# define CYGARC_PHYSICAL_ADDRESS(x) (x)
***************
*** 400,404 ****
--- 402,407 ----
}
#endif // HAL_PLATFORM_MACHINE_TYPE - otherwise we do not support this stuff...
+ #endif // CYGBLD_BUILD_REDBOOT_WITH_EXEC
// EOF redboot_linux_exec.c
Index: hal/arm/ebsa285/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/ebsa285/current/ChangeLog,v
retrieving revision 1.25
diff -c -c -r1.25 ChangeLog
*** hal/arm/ebsa285/current/ChangeLog 23 May 2002 23:01:54 -0000 1.25
--- hal/arm/ebsa285/current/ChangeLog 5 Aug 2002 14:36:15 -0000
***************
*** 1,3 ****
--- 1,7 ----
+ 2002-08-02 Andrew Lunn <Andrew.Lunn@ascom.ch>
+
+ * src/redboot_cmds.c: exec command can now be disabled by CDL
+
2002-05-14 Jesper Skov <jskov@redhat.com>
* src/ebsa285_misc.c: Fixed warning.
Index: hal/arm/ebsa285/current/src/redboot_cmds.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/ebsa285/current/src/redboot_cmds.c,v
retrieving revision 1.6
diff -c -c -r1.6 redboot_cmds.c
*** hal/arm/ebsa285/current/src/redboot_cmds.c 23 May 2002 23:01:56 -0000 1.6
--- hal/arm/ebsa285/current/src/redboot_cmds.c 5 Aug 2002 14:36:15 -0000
***************
*** 58,63 ****
--- 58,65 ----
#include <cyg/hal/hal_intr.h>
#include <cyg/hal/hal_cache.h>
+ #ifdef CYGBLD_BUILD_REDBOOT_WITH_EXEC
+
// Exported CLI function(s)
static void do_exec(int argc, char *argv[]);
RedBoot_cmd("exec",
***************
*** 198,200 ****
--- 200,204 ----
"movs pc,lr" : : );
end1:
}
+
+ #endif
Index: hal/mips/arch/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/mips/arch/current/ChangeLog,v
retrieving revision 1.63
diff -c -c -r1.63 ChangeLog
*** hal/mips/arch/current/ChangeLog 23 May 2002 23:03:17 -0000 1.63
--- hal/mips/arch/current/ChangeLog 5 Aug 2002 14:36:19 -0000
***************
*** 1,3 ****
--- 1,7 ----
+ 2002-08-02 Andrew Lunn <Andrew.Lunn@ascom.ch>
+
+ * src/redboot_cmds.c: exec command can now be disabled by CDL
+
2002-05-17 Jesper Skov <jskov@redhat.com>
* include/hal_intr.h: Fix CYGNUM_HAL_EXCEPTION_MIN definition so
Index: hal/mips/arch/current/src/redboot_linux_exec.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/mips/arch/current/src/redboot_linux_exec.c,v
retrieving revision 1.6
diff -c -c -r1.6 redboot_linux_exec.c
*** hal/mips/arch/current/src/redboot_linux_exec.c 23 May 2002 23:03:23 -0000 1.6
--- hal/mips/arch/current/src/redboot_linux_exec.c 5 Aug 2002 14:36:19 -0000
***************
*** 56,61 ****
--- 56,63 ----
#include <cyg/hal/hal_cache.h>
#include <cyg/hal/hal_if.h>
+ #ifdef CYGBLD_BUILD_REDBOOT_WITH_EXEC
+
#define xstr(s) str(s)
#define str(s...) #s
***************
*** 174,176 ****
--- 176,180 ----
linux(2, pb->argv, pb);
}
+
+ #endif
Index: hal/mn10300/asb2305/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/mn10300/asb2305/current/ChangeLog,v
retrieving revision 1.2
diff -c -c -r1.2 ChangeLog
*** hal/mn10300/asb2305/current/ChangeLog 23 May 2002 23:04:04 -0000 1.2
--- hal/mn10300/asb2305/current/ChangeLog 5 Aug 2002 14:36:19 -0000
***************
*** 1,3 ****
--- 1,7 ----
+ 2002-08-02 Andrew Lunn <Andrew.Lunn@ascom.ch>
+
+ * src/redboot_cmds.c: exec command can now be disabled by CDL
+
2001-10-18 David Howells <dhowells@redhat.com>
* cdl/hal_mn10300_am33_asb2305.cdl: change incorrect "BootFlash"
Index: hal/mn10300/asb2305/current/src/redboot_cmds.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/mn10300/asb2305/current/src/redboot_cmds.c,v
retrieving revision 1.2
diff -c -c -r1.2 redboot_cmds.c
*** hal/mn10300/asb2305/current/src/redboot_cmds.c 23 May 2002 23:04:05 -0000 1.2
--- hal/mn10300/asb2305/current/src/redboot_cmds.c 5 Aug 2002 14:36:20 -0000
***************
*** 57,62 ****
--- 57,64 ----
#include <cyg/hal/hal_intr.h>
#include <cyg/hal/hal_cache.h>
+ #ifdef CYGBLD_BUILD_REDBOOT_WITH_EXEC
+
// Exported CLI function(s)
// The exec command works like the go command in YAMON - that is,
***************
*** 128,132 ****
--- 130,136 ----
HAL_DCACHE_INVALIDATE_ALL();
(*entry)();
}
+
+ #endif
// EOF redboot_cmds.c
Index: hal/powerpc/mbx/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/powerpc/mbx/current/ChangeLog,v
retrieving revision 1.28
diff -c -c -r1.28 ChangeLog
*** hal/powerpc/mbx/current/ChangeLog 27 Jun 2002 20:27:16 -0000 1.28
--- hal/powerpc/mbx/current/ChangeLog 5 Aug 2002 14:36:20 -0000
***************
*** 1,3 ****
--- 1,7 ----
+ 2002-08-02 Andrew Lunn <Andrew.Lunn@ascom.ch>
+
+ * src/redboot_cmds.c: exec command can now be disabled by CDL
+
2002-06-27 Gary Thomas <gary@chez-thomas.org>
* include/plf_regs.h: New file - platform overrides.
Index: hal/powerpc/mbx/current/src/redboot_linux_exec.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/powerpc/mbx/current/src/redboot_linux_exec.c,v
retrieving revision 1.2
diff -c -c -r1.2 redboot_linux_exec.c
*** hal/powerpc/mbx/current/src/redboot_linux_exec.c 23 May 2002 23:04:25 -0000 1.2
--- hal/powerpc/mbx/current/src/redboot_linux_exec.c 5 Aug 2002 14:36:21 -0000
***************
*** 69,75 ****
#include <cyg/hal/hal_cache.h>
#ifdef CYGSEM_REDBOOT_HAL_LINUX_BOOT
!
#include CYGHWR_MEMORY_LAYOUT_H
//=========================================================================
--- 69,75 ----
#include <cyg/hal/hal_cache.h>
#ifdef CYGSEM_REDBOOT_HAL_LINUX_BOOT
! #ifdef CYGBLD_BUILD_REDBOOT_WITH_EXEC
#include CYGHWR_MEMORY_LAYOUT_H
//=========================================================================
***************
*** 305,310 ****
--- 305,311 ----
);
}
+ #endif // CYGBLD_BUILD_REDBOOT_WITH_EXEC
#endif // CYGSEM_REDBOOT_HAL_LINUX_BOOT
//=========================================================================
Index: hal/powerpc/viper/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/powerpc/viper/current/ChangeLog,v
retrieving revision 1.14
diff -c -c -r1.14 ChangeLog
*** hal/powerpc/viper/current/ChangeLog 31 Jul 2002 14:16:33 -0000 1.14
--- hal/powerpc/viper/current/ChangeLog 5 Aug 2002 14:36:21 -0000
***************
*** 1,3 ****
--- 1,7 ----
+ 2002-08-02 Andrew Lunn <Andrew.Lunn@ascom.ch>
+
+ * src/redboot_cmds.c: exec command can now be disabled by CDL
+
2002-07-31 Gary Thomas <gary@chez-thomas.org>
* misc/redboot_ROMRAM.ecm:
Index: hal/powerpc/viper/current/src/redboot_linux_exec.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/powerpc/viper/current/src/redboot_linux_exec.c,v
retrieving revision 1.2
diff -c -c -r1.2 redboot_linux_exec.c
*** hal/powerpc/viper/current/src/redboot_linux_exec.c 24 Jul 2002 14:49:07 -0000 1.2
--- hal/powerpc/viper/current/src/redboot_linux_exec.c 5 Aug 2002 14:36:21 -0000
***************
*** 75,80 ****
--- 75,81 ----
#endif
#ifdef CYGSEM_REDBOOT_HAL_LINUX_BOOT
+ #ifdef CYGBLD_BUILD_REDBOOT_WITH_EXEC
#include CYGHWR_MEMORY_LAYOUT_H
***************
*** 266,272 ****
);
}
!
#endif // CYGSEM_REDBOOT_HAL_LINUX_BOOT
//=========================================================================
--- 267,273 ----
);
}
! #endif // CYGBLD_BUILD_REDBOOT_WITH_EXEC
#endif // CYGSEM_REDBOOT_HAL_LINUX_BOOT
//=========================================================================
Index: hal/sh/arch/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/sh/arch/current/ChangeLog,v
retrieving revision 1.39
diff -c -c -r1.39 ChangeLog
*** hal/sh/arch/current/ChangeLog 23 May 2002 23:04:35 -0000 1.39
--- hal/sh/arch/current/ChangeLog 5 Aug 2002 14:36:22 -0000
***************
*** 1,3 ****
--- 1,7 ----
+ 2002-08-02 Andrew Lunn <Andrew.Lunn@ascom.ch>
+
+ * src/redboot_cmds.c: exec command can now be disabled by CDL
+
2002-04-30 Jesper Skov <jskov@redhat.com>
* include/hal_var_sp.inc: Allow variant to provide custom
Index: hal/sh/arch/current/src/redboot_linux_exec.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/sh/arch/current/src/redboot_linux_exec.c,v
retrieving revision 1.2
diff -c -c -r1.2 redboot_linux_exec.c
*** hal/sh/arch/current/src/redboot_linux_exec.c 23 May 2002 23:04:39 -0000 1.2
--- hal/sh/arch/current/src/redboot_linux_exec.c 5 Aug 2002 14:36:22 -0000
***************
*** 55,60 ****
--- 55,62 ----
#include <cyg/hal/hal_intr.h>
#include <cyg/hal/hal_cache.h>
+ #ifdef CYGBLD_BUILD_REDBOOT_WITH_EXEC
+
#define xstr(s) str(s)
#define str(s...) #s
***************
*** 161,163 ****
--- 163,167 ----
asm ("jmp @%0\n\tnop" : : "r" (entry));
}
+
+ #endif CYGBLD_BUILD_REDBOOT_WITH_EXEC
Index: redboot/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/redboot/current/ChangeLog,v
retrieving revision 1.64
diff -c -c -r1.64 ChangeLog
*** redboot/current/ChangeLog 30 Jul 2002 12:59:22 -0000 1.64
--- redboot/current/ChangeLog 5 Aug 2002 14:36:27 -0000
***************
*** 1,3 ****
--- 1,14 ----
+ 2002-08-06 Andrew Lunn <Andrew.Lunn@ascom.ch>
+
+ * src/io.c: Fix the parsing of boot scripts to allow the use
+ of aliases. This was broken when the ability to do startup
+ type specific scripting was added.
+
+ 2002-08-05 Andrew Lunn <Andrew.Lunn@ascom.ch>
+
+ * src/main.c: Made more of the commands conditionally compilable
+ * cdl/redboot.cdl: CDL code to control the compilation.
+
2002-07-30 Gary Thomas <gary@chez-thomas.org>
* src/net/net_io.c: Handle broadcast/mask setup better (failed if
Index: redboot/current/cdl/redboot.cdl
===================================================================
RCS file: /cvs/ecos/ecos/packages/redboot/current/cdl/redboot.cdl,v
retrieving revision 1.39
diff -c -c -r1.39 redboot.cdl
*** redboot/current/cdl/redboot.cdl 9 Jul 2002 20:23:47 -0000 1.39
--- redboot/current/cdl/redboot.cdl 5 Aug 2002 14:36:27 -0000
***************
*** 68,73 ****
--- 68,78 ----
default_value 1
}
+
+ cdl_interface CYGINT_REDBOOT_LOAD_METHOD {
+ display "Redboot of methods of loading images using redboot"
+ }
+
cdl_component CYGBLD_BUILD_REDBOOT {
display "Build Redboot ROM ELF image"
default_value 0
***************
*** 87,92 ****
--- 92,98 ----
requires CYGINT_ISO_STRING_MEMFUNCS
requires CYGINT_ISO_STRING_STRFUNCS
+ requires CYGINT_REDBOOT_LOAD_METHOD
cdl_option CYGBLD_BUILD_REDBOOT_WITH_ZLIB {
display "Include support gzip/zlib decompression"
***************
*** 97,102 ****
--- 103,116 ----
compile decompress.c
}
+ cdl_option CYGBLD_BUILD_REDBOOT_WITH_XYZMODEM {
+ display "Include support for xyzModem downloads"
+ no_define
+ default_value 1
+ implements CYGINT_REDBOOT_LOAD_METHOD
+ compile xyzModem.c
+ }
+
cdl_option CYGBLD_BUILD_REDBOOT_WITH_THREADS {
display "Threads debugging support"
no_define
***************
*** 145,150 ****
--- 159,179 ----
default_value 1
}
+ cdl_option CYGBLD_BUILD_REDBOOT_WITH_DUMP {
+ display "Include memory dump command"
+ default_value 1
+ }
+
+ cdl_option CYGBLD_BUILD_REDBOOT_WITH_CACHES {
+ display "Include cache command"
+ default_value 1
+ }
+
+ cdl_option CYGBLD_BUILD_REDBOOT_WITH_EXEC {
+ display "Include exec command"
+ default_value 1
+ }
+
no_define
description "This option enables the building of the Redboot ELF image.
The image may require further relocation or symbol
***************
*** 153,159 ****
compile main.c crc.c
compile misc_funs.c io.c parse.c ticks.c syscall.c alias.c
! compile -library=libextras.a load.c xyzModem.c
make -priority 320 {
<PREFIX>/bin/redboot.elf : $(PREFIX)/lib/target.ld $(PREFIX)/lib/vectors.o $(PREFIX)/lib/libtarget.a $(PREFIX)/lib/libextras.a
--- 182,188 ----
compile main.c crc.c
compile misc_funs.c io.c parse.c ticks.c syscall.c alias.c
! compile -library=libextras.a load.c
make -priority 320 {
<PREFIX>/bin/redboot.elf : $(PREFIX)/lib/target.ld $(PREFIX)/lib/vectors.o $(PREFIX)/lib/libtarget.a $(PREFIX)/lib/libextras.a
***************
*** 168,173 ****
--- 197,203 ----
flavor bool
active_if CYGPKG_IO_ETH_DRIVERS
default_value 1
+ implements CYGINT_REDBOOT_LOAD_METHOD
compile net/bootp.c net/udp.c net/ip.c net/pktbuf.c net/cksum.c
compile net/enet.c net/icmp.c net/tcp.c net/timers.c net/arp.c
compile net/net_io.c net/inet_addr.c
Index: redboot/current/src/io.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/redboot/current/src/io.c,v
retrieving revision 1.26
diff -c -c -r1.26 io.c
*** redboot/current/src/io.c 11 Jul 2002 16:42:35 -0000 1.26
--- redboot/current/src/io.c 5 Aug 2002 14:36:27 -0000
***************
*** 284,291 ****
} else {
*cp = *script++;
! if (*cp == '\n')
! newline = true;
return true;
}
}
--- 284,294 ----
} else {
*cp = *script++;
! if (*cp == '\n') {
! newline = true;
! } else {
! newline = false;
! }
return true;
}
}
Index: redboot/current/src/main.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/redboot/current/src/main.c,v
retrieving revision 1.32
diff -c -c -r1.32 main.c
*** redboot/current/src/main.c 23 May 2002 23:08:31 -0000 1.32
--- redboot/current/src/main.c 5 Aug 2002 14:36:27 -0000
***************
*** 94,99 ****
--- 94,100 ----
"[-w <timeout>] [entry]",
do_go
);
+ #ifdef CYGBLD_BUILD_REDBOOT_WITH_DUMP
RedBoot_cmd("dump",
"Display (hex dump) a range of memory",
"-b <location> [-l <length>] [-s] [-1|2|4]",
***************
*** 104,109 ****
--- 105,111 ----
"-b <location> [-l <length>] [-s] [-1|2|4]",
do_x
);
+ #endif
#ifdef CYGBLD_BUILD_REDBOOT_WITH_CKSUM
RedBoot_cmd("cksum",
"Compute a 32bit checksum [POSIX algorithm] for a range of memory",
***************
*** 125,135 ****
--- 127,139 ----
do_mcmp
);
#endif
+ #ifdef CYGBLD_BUILD_REDBOOT_WITH_CACHES
RedBoot_cmd("cache",
"Manage machine caches",
"[ON | OFF]",
do_caches
);
+ #endif
#ifdef HAL_PLATFORM_RESET
RedBoot_cmd("reset",
"Reset the system",
***************
*** 368,373 ****
--- 372,378 ----
}
}
+ #ifdef CYGBLD_BUILD_REDBOOT_WITH_CACHES
void
do_caches(int argc, char *argv[])
{
***************
*** 403,409 ****
dcache_on?"On":"Off", icache_on?"On":"Off");
}
}
!
void
show_help(struct cmd *cmd, struct cmd *cmd_end, char *which, char *pre)
{
--- 408,414 ----
dcache_on?"On":"Off", icache_on?"On":"Off");
}
}
! #endif
void
show_help(struct cmd *cmd, struct cmd *cmd_end, char *which, char *pre)
{
***************
*** 443,448 ****
--- 448,454 ----
return;
}
+ #ifdef CYGBLD_BUILD_REDBOOT_WITH_DUMP
void
do_dump(int argc, char *argv[])
{
***************
*** 533,539 ****
{
do_dump(argc, argv);
}
!
#ifdef CYGBLD_BUILD_REDBOOT_WITH_CKSUM
void
do_cksum(int argc, char *argv[])
--- 539,545 ----
{
do_dump(argc, argv);
}
! #endif
#ifdef CYGBLD_BUILD_REDBOOT_WITH_CKSUM
void
do_cksum(int argc, char *argv[])