Index: c/src/lib/libbsp/m68k/efi332/ChangeLog
===================================================================
--- c/src/lib/libbsp/m68k/efi332/ChangeLog	(revision 6c6818678b12d6a1d473761f5e2d17e732aac4d2)
+++ c/src/lib/libbsp/m68k/efi332/ChangeLog	(revision 50bb7627337aa780c4e8e6f3cbded85d2c80381b)
@@ -1,2 +1,24 @@
+2000-10-12	John S Gwynne <jgwynne@mrcday.com>
+
+	* start/start.c: Modified to support generation of ram_init.
+	* start/ram_init.ld, BSP/start/ram_init.sed: New files.
+	These changes enable RTEMS to automatically generate
+	the ram_init file used by gdb with the BDM patches. The 332 has
+	on-board chip select lines (for RAM and FLASH) that must be
+	configured before use of these peripherals. These patches parse
+	data from start.c where the chip select lines are configured in
+	the runtime executable and automatically generates the gdb
+	initialization file using the same settings. A great time saver.
+	A similar file, ram_init_FW (flash writable), is also generated
+	that the flash programming tool uses.
+	* start/Makefile.am: Modified to support above.
+	* CPU/sim.h: Modified to support above.
+	* startup/except_vect_332_ROM.S: Moved to start so it would not
+	be included in libbsp.a.  Moving it to start ensures it is
+	available as a single object file.
+	* start/except_vect_332_ROM.S: Moved from startup.
+	* startup/linkcmds, startup/linkcmds_ROM: Fixes to the memory map
+	shown in the comments.
+
 2000-09-29	Charles-Antoine Gauthier <charles.gauthier@nrc.ca>
 
Index: c/src/lib/libbsp/m68k/efi332/start/Makefile.am
===================================================================
--- c/src/lib/libbsp/m68k/efi332/start/Makefile.am	(revision 6c6818678b12d6a1d473761f5e2d17e732aac4d2)
+++ c/src/lib/libbsp/m68k/efi332/start/Makefile.am	(revision 50bb7627337aa780c4e8e6f3cbded85d2c80381b)
@@ -23,5 +23,39 @@
 	$(INSTALL_DATA) $< $@
 
-TMPINSTALL_FILES += $(PROJECT_RELEASE)/lib/start$(LIB_VARIANT).o
+$(PROJECT_RELEASE)/lib/except_vect_332_ROM$(LIB_VARIANT).o: \
+    $(ARCH)/except_vect_332_ROM.o
+	$(INSTALL_DATA) $< $@
+
+$(PROJECT_RELEASE)/lib/ram_init$(LIB_VARIANT): \
+    $(ARCH)/ram_init
+	$(INSTALL_DATA) $< $@
+
+$(PROJECT_RELEASE)/lib/ram_init_FW$(LIB_VARIANT): \
+    $(ARCH)/ram_init_FW
+	$(INSTALL_DATA) $< $@
+
+$(ARCH)/ram_init: $(srcdir)/start.c $(srcdir)/ram_init.ld \
+    $(srcdir)/ram_init.sed
+	sed -f $(srcdir)/ram_init.sed $(srcdir)/start.c >$(ARCH)/ram_init.S
+	$(CC) -D SIM_CRB=0x0000 -E $(ARCH)/ram_init.S >$(ARCH)/ram_init1.S
+	sed "/.org/ {N; s/\n/%/; P;}; /\.text/P; D;" $(ARCH)/ram_init1.S | \
+           sort | sed "h;1{s/.*/.data/;P;g;};s/%.*//;P;g;s/.*%//;" \
+           >$(ARCH)/ram_init2.S
+	$(CC) -nostdlib -Wl,-T$(srcdir)/ram_init.ld $(ARCH)/ram_init2.S \
+           -o $(ARCH)/ram_init
+
+$(ARCH)/ram_init_FW: $(srcdir)/ram_init.ld $(ARCH)/ram_init.S
+	$(CC) -D FLASHWRITE -D SIM_CRB=0x0000 -E $(ARCH)/ram_init.S \
+           >$(ARCH)/ram_init_FW1.S
+	sed "/.org/ {N; s/\n/%/; P;}; /\.text/P; D;" $(ARCH)/ram_init_FW1.S | \
+           sort | sed "h;1{s/.*/.data/;P;g;};s/%.*//;P;g;s/.*%//;" \
+           >$(ARCH)/ram_init_FW2.S
+	$(CC) -nostdlib -Wl,-T$(srcdir)/ram_init.ld $(ARCH)/ram_init_FW2.S \
+           -o $(ARCH)/ram_init_FW
+
+TMPINSTALL_FILES += $(PROJECT_RELEASE)/lib/start$(LIB_VARIANT).o \
+    $(PROJECT_RELEASE)/lib/ram_init$(LIB_VARIANT) \
+    $(PROJECT_RELEASE)/lib/ram_init_FW$(LIB_VARIANT) \
+    $(PROJECT_RELEASE)/lib/except_vect_332_ROM$(LIB_VARIANT).o
 
 all-local: $(ARCH) $(OBJS) $(PGM) $(TMPINSTALL_FILES)
@@ -29,5 +63,5 @@
 .PRECIOUS: $(PGM)
 
-EXTRA_DIST = start.c
+EXTRA_DIST = start.c except_vect_332_ROM.S ram_init.ld ram_init.sed
 
 include $(top_srcdir)/../../../../../../automake/local.am
Index: c/src/lib/libbsp/m68k/efi332/start/except_vect_332_ROM.S
===================================================================
--- c/src/lib/libbsp/m68k/efi332/start/except_vect_332_ROM.S	(revision 50bb7627337aa780c4e8e6f3cbded85d2c80381b)
+++ c/src/lib/libbsp/m68k/efi332/start/except_vect_332_ROM.S	(revision 50bb7627337aa780c4e8e6f3cbded85d2c80381b)
@@ -0,0 +1,290 @@
+/*
+ *  $Id$
+ */
+
+/* Exception Vector definitions follow */	
+
+	/* !!! Warning !!! This table is not tested, and
+	   the user must make sure it is complete. */
+
+	/* If we use TRAP #15 for reboot, note that group 0 and 1 exceptions 
+	   will have priority. */
+
+	/* Vector 0:	RESET:	Initial SSP */
+	.long	_RamEnd
+	/* Vector 1:	RESET:	Initial PC */
+	.long	start
+
+	/* default action for undefined vectors is to re-boot */
+
+	/* Note group 0 and 1 exception (like trace) have priority 
+	   over other exceptions (like trap #15) that may call this. */
+
+	/* Vectors 2-255 */
+	.long reboot   /* exception vector:   2 */
+	.long reboot   /* exception vector:   3 */
+	.long reboot   /* exception vector:   4 */
+	.long reboot   /* exception vector:   5 */
+	.long reboot   /* exception vector:   6 */
+	.long reboot   /* exception vector:   7 */
+	.long reboot   /* exception vector:   8 */
+	.long reboot   /* exception vector:   9 */
+	.long reboot   /* exception vector:  10 */
+	.long reboot   /* exception vector:  11 */
+	.long reboot   /* exception vector:  12 */
+	.long reboot   /* exception vector:  13 */
+	.long reboot   /* exception vector:  14 */
+	.long reboot   /* exception vector:  15 */
+	.long reboot   /* exception vector:  16 */
+	.long reboot   /* exception vector:  17 */
+	.long reboot   /* exception vector:  18 */
+	.long reboot   /* exception vector:  19 */
+	.long reboot   /* exception vector:  20 */
+	.long reboot   /* exception vector:  21 */
+	.long reboot   /* exception vector:  22 */
+	.long reboot   /* exception vector:  23 */
+	.long reboot   /* exception vector:  24 */
+	.long reboot   /* exception vector:  25 */
+	.long reboot   /* exception vector:  26 */
+	.long reboot   /* exception vector:  27 */
+	.long reboot   /* exception vector:  28 */
+	.long reboot   /* exception vector:  29 */
+	.long reboot   /* exception vector:  30 */
+	.long reboot   /* exception vector:  31 */
+	.long reboot   /* exception vector:  32 */
+	.long reboot   /* exception vector:  33 */
+	.long reboot   /* exception vector:  34 */
+	.long reboot   /* exception vector:  35 */
+	.long reboot   /* exception vector:  36 */
+	.long reboot   /* exception vector:  37 */
+	.long reboot   /* exception vector:  38 */
+	.long reboot   /* exception vector:  39 */
+	.long reboot   /* exception vector:  40 */
+	.long reboot   /* exception vector:  41 */
+	.long reboot   /* exception vector:  42 */
+	.long reboot   /* exception vector:  43 */
+	.long reboot   /* exception vector:  44 */
+	.long reboot   /* exception vector:  45 */
+	.long reboot   /* exception vector:  46 */
+	.long _reboot  /* the reboot trap:   47 */
+	.long reboot   /* exception vector:  48 */
+	.long reboot   /* exception vector:  49 */
+	.long reboot   /* exception vector:  50 */
+	.long reboot   /* exception vector:  51 */
+	.long reboot   /* exception vector:  52 */
+	.long reboot   /* exception vector:  53 */
+	.long reboot   /* exception vector:  54 */
+	.long reboot   /* exception vector:  55 */
+	.long reboot   /* exception vector:  56 */
+	.long reboot   /* exception vector:  57 */
+	.long reboot   /* exception vector:  58 */
+	.long reboot   /* exception vector:  59 */
+	.long reboot   /* exception vector:  60 */
+	.long reboot   /* exception vector:  61 */
+	.long reboot   /* exception vector:  62 */
+	.long reboot   /* exception vector:  63 */
+	.long reboot   /* exception vector:  64 */
+	.long reboot   /* exception vector:  65 */
+	.long reboot   /* exception vector:  66 */
+	.long reboot   /* exception vector:  67 */
+	.long reboot   /* exception vector:  68 */
+	.long reboot   /* exception vector:  69 */
+	.long reboot   /* exception vector:  70 */
+	.long reboot   /* exception vector:  71 */
+	.long reboot   /* exception vector:  72 */
+	.long reboot   /* exception vector:  73 */
+	.long reboot   /* exception vector:  74 */
+	.long reboot   /* exception vector:  75 */
+	.long reboot   /* exception vector:  76 */
+	.long reboot   /* exception vector:  77 */
+	.long reboot   /* exception vector:  78 */
+	.long reboot   /* exception vector:  79 */
+	.long reboot   /* exception vector:  80 */
+	.long reboot   /* exception vector:  81 */
+	.long reboot   /* exception vector:  82 */
+	.long reboot   /* exception vector:  83 */
+	.long reboot   /* exception vector:  84 */
+	.long reboot   /* exception vector:  85 */
+	.long reboot   /* exception vector:  86 */
+	.long reboot   /* exception vector:  87 */
+	.long reboot   /* exception vector:  88 */
+	.long reboot   /* exception vector:  89 */
+	.long reboot   /* exception vector:  90 */
+	.long reboot   /* exception vector:  91 */
+	.long reboot   /* exception vector:  92 */
+	.long reboot   /* exception vector:  93 */
+	.long reboot   /* exception vector:  94 */
+	.long reboot   /* exception vector:  95 */
+	.long reboot   /* exception vector:  96 */
+	.long reboot   /* exception vector:  97 */
+	.long reboot   /* exception vector:  98 */
+	.long reboot   /* exception vector:  99 */
+	.long reboot   /* exception vector: 100 */
+	.long reboot   /* exception vector: 101 */
+	.long reboot   /* exception vector: 102 */
+	.long reboot   /* exception vector: 103 */
+	.long reboot   /* exception vector: 104 */
+	.long reboot   /* exception vector: 105 */
+	.long reboot   /* exception vector: 106 */
+	.long reboot   /* exception vector: 107 */
+	.long reboot   /* exception vector: 108 */
+	.long reboot   /* exception vector: 109 */
+	.long reboot   /* exception vector: 110 */
+	.long reboot   /* exception vector: 111 */
+	.long reboot   /* exception vector: 112 */
+	.long reboot   /* exception vector: 113 */
+	.long reboot   /* exception vector: 114 */
+	.long reboot   /* exception vector: 115 */
+	.long reboot   /* exception vector: 116 */
+	.long reboot   /* exception vector: 117 */
+	.long reboot   /* exception vector: 118 */
+	.long reboot   /* exception vector: 119 */
+	.long reboot   /* exception vector: 120 */
+	.long reboot   /* exception vector: 121 */
+	.long reboot   /* exception vector: 122 */
+	.long reboot   /* exception vector: 123 */
+	.long reboot   /* exception vector: 124 */
+	.long reboot   /* exception vector: 125 */
+	.long reboot   /* exception vector: 126 */
+	.long reboot   /* exception vector: 127 */
+	.long reboot   /* exception vector: 128 */
+	.long reboot   /* exception vector: 129 */
+	.long reboot   /* exception vector: 130 */
+	.long reboot   /* exception vector: 131 */
+	.long reboot   /* exception vector: 132 */
+	.long reboot   /* exception vector: 133 */
+	.long reboot   /* exception vector: 134 */
+	.long reboot   /* exception vector: 135 */
+	.long reboot   /* exception vector: 136 */
+	.long reboot   /* exception vector: 137 */
+	.long reboot   /* exception vector: 138 */
+	.long reboot   /* exception vector: 139 */
+	.long reboot   /* exception vector: 140 */
+	.long reboot   /* exception vector: 141 */
+	.long reboot   /* exception vector: 142 */
+	.long reboot   /* exception vector: 143 */
+	.long reboot   /* exception vector: 144 */
+	.long reboot   /* exception vector: 145 */
+	.long reboot   /* exception vector: 146 */
+	.long reboot   /* exception vector: 147 */
+	.long reboot   /* exception vector: 148 */
+	.long reboot   /* exception vector: 149 */
+	.long reboot   /* exception vector: 150 */
+	.long reboot   /* exception vector: 151 */
+	.long reboot   /* exception vector: 152 */
+	.long reboot   /* exception vector: 153 */
+	.long reboot   /* exception vector: 154 */
+	.long reboot   /* exception vector: 155 */
+	.long reboot   /* exception vector: 156 */
+	.long reboot   /* exception vector: 157 */
+	.long reboot   /* exception vector: 158 */
+	.long reboot   /* exception vector: 159 */
+	.long reboot   /* exception vector: 160 */
+	.long reboot   /* exception vector: 161 */
+	.long reboot   /* exception vector: 162 */
+	.long reboot   /* exception vector: 163 */
+	.long reboot   /* exception vector: 164 */
+	.long reboot   /* exception vector: 165 */
+	.long reboot   /* exception vector: 166 */
+	.long reboot   /* exception vector: 167 */
+	.long reboot   /* exception vector: 168 */
+	.long reboot   /* exception vector: 169 */
+	.long reboot   /* exception vector: 170 */
+	.long reboot   /* exception vector: 171 */
+	.long reboot   /* exception vector: 172 */
+	.long reboot   /* exception vector: 173 */
+	.long reboot   /* exception vector: 174 */
+	.long reboot   /* exception vector: 175 */
+	.long reboot   /* exception vector: 176 */
+	.long reboot   /* exception vector: 177 */
+	.long reboot   /* exception vector: 178 */
+	.long reboot   /* exception vector: 179 */
+	.long reboot   /* exception vector: 180 */
+	.long reboot   /* exception vector: 181 */
+	.long reboot   /* exception vector: 182 */
+	.long reboot   /* exception vector: 183 */
+	.long reboot   /* exception vector: 184 */
+	.long reboot   /* exception vector: 185 */
+	.long reboot   /* exception vector: 186 */
+	.long reboot   /* exception vector: 187 */
+	.long reboot   /* exception vector: 188 */
+	.long reboot   /* exception vector: 189 */
+	.long reboot   /* exception vector: 190 */
+	.long reboot   /* exception vector: 191 */
+	.long reboot   /* exception vector: 192 */
+	.long reboot   /* exception vector: 193 */
+	.long reboot   /* exception vector: 194 */
+	.long reboot   /* exception vector: 195 */
+	.long reboot   /* exception vector: 196 */
+	.long reboot   /* exception vector: 197 */
+	.long reboot   /* exception vector: 198 */
+	.long reboot   /* exception vector: 199 */
+	.long reboot   /* exception vector: 200 */
+	.long reboot   /* exception vector: 201 */
+	.long reboot   /* exception vector: 202 */
+	.long reboot   /* exception vector: 203 */
+	.long reboot   /* exception vector: 204 */
+	.long reboot   /* exception vector: 205 */
+	.long reboot   /* exception vector: 206 */
+	.long reboot   /* exception vector: 207 */
+	.long reboot   /* exception vector: 208 */
+	.long reboot   /* exception vector: 209 */
+	.long reboot   /* exception vector: 210 */
+	.long reboot   /* exception vector: 211 */
+	.long reboot   /* exception vector: 212 */
+	.long reboot   /* exception vector: 213 */
+	.long reboot   /* exception vector: 214 */
+	.long reboot   /* exception vector: 215 */
+	.long reboot   /* exception vector: 216 */
+	.long reboot   /* exception vector: 217 */
+	.long reboot   /* exception vector: 218 */
+	.long reboot   /* exception vector: 219 */
+	.long reboot   /* exception vector: 220 */
+	.long reboot   /* exception vector: 221 */
+	.long reboot   /* exception vector: 222 */
+	.long reboot   /* exception vector: 223 */
+	.long reboot   /* exception vector: 224 */
+	.long reboot   /* exception vector: 225 */
+	.long reboot   /* exception vector: 226 */
+	.long reboot   /* exception vector: 227 */
+	.long reboot   /* exception vector: 228 */
+	.long reboot   /* exception vector: 229 */
+	.long reboot   /* exception vector: 230 */
+	.long reboot   /* exception vector: 231 */
+	.long reboot   /* exception vector: 232 */
+	.long reboot   /* exception vector: 233 */
+	.long reboot   /* exception vector: 234 */
+	.long reboot   /* exception vector: 235 */
+	.long reboot   /* exception vector: 236 */
+	.long reboot   /* exception vector: 237 */
+	.long reboot   /* exception vector: 238 */
+	.long reboot   /* exception vector: 239 */
+	.long reboot   /* exception vector: 240 */
+	.long reboot   /* exception vector: 241 */
+	.long reboot   /* exception vector: 242 */
+	.long reboot   /* exception vector: 243 */
+	.long reboot   /* exception vector: 244 */
+	.long reboot   /* exception vector: 245 */
+	.long reboot   /* exception vector: 246 */
+	.long reboot   /* exception vector: 247 */
+	.long reboot   /* exception vector: 248 */
+	.long reboot   /* exception vector: 249 */
+	.long reboot   /* exception vector: 250 */
+	.long reboot   /* exception vector: 251 */
+	.long reboot   /* exception vector: 252 */
+	.long reboot   /* exception vector: 253 */
+	.long reboot   /* exception vector: 254 */
+	.long reboot   /* exception vector: 255 */
+
+
+_reboot:
+	move	#0x2700,%sr	/* mask interrupts */
+	movea.l	(0x0).w,%a7	/* load stack */
+	movea.l	(0x4).w,%a0	/* jmp to location of reset vector */
+	jmp	(%a0)
+
+reboot:	
+	trap	#15		/* use trap exception to enter supervisor 
+				   state. Trace mode ( and other group 0 
+				   and 1 exceptions) *could* screw this up if 
+				   not vectored to reboot or did not return. */
Index: c/src/lib/libbsp/m68k/efi332/start/ram_init.ld
===================================================================
--- c/src/lib/libbsp/m68k/efi332/start/ram_init.ld	(revision 50bb7627337aa780c4e8e6f3cbded85d2c80381b)
+++ c/src/lib/libbsp/m68k/efi332/start/ram_init.ld	(revision 50bb7627337aa780c4e8e6f3cbded85d2c80381b)
@@ -0,0 +1,22 @@
+OUTPUT_ARCH(m68k)
+__DYNAMIC  =  0;
+
+start = 0;
+
+MEMORY
+{
+  ram     : ORIGIN = 0xfffa00, LENGTH = 256K
+}
+
+SECTIONS
+{
+  .text : {
+	*(.text)
+        } >ram
+  .data : {
+        *(.data)
+        } >ram
+   .bss : {
+        *(.bss)
+        } >ram 
+}
Index: c/src/lib/libbsp/m68k/efi332/start/ram_init.sed
===================================================================
--- c/src/lib/libbsp/m68k/efi332/start/ram_init.sed	(revision 50bb7627337aa780c4e8e6f3cbded85d2c80381b)
+++ c/src/lib/libbsp/m68k/efi332/start/ram_init.sed	(revision 50bb7627337aa780c4e8e6f3cbded85d2c80381b)
@@ -0,0 +1,47 @@
+1 {
+i\
+#include <efi332.h>\
+#define ASM\
+#include "sim.h"\
+\
+/* This file is automatically generated from EFI332_crt0.c -- DO NOT EDIT */\
+\
+/* note: For one reason or another, I could not get '|' (bit-or) to\
+   work in the version of gas I'm using. I've replaced them with \
+   '+' (addition) for this file. */\
+\
+	.text\
+\
+
+D;
+};
+/include in ram_init.S/,/end include in ram_init.S/ {
+/\*.*= *\(.*\)/ {
+s/*/	.org	/
+h;
+s/=.*//
+P;
+g;
+/(.*short int)/ s/.*short int)/	.short	/
+/(.*char)/ s/.*char)/	.byte	/
+s/\/\*.*\*\///
+t dumby
+:dumby
+s/;//;
+t next
+N;
+s/ *\/\*.*\*\/ *//
+t dumby
+b dumby
+:next
+s/	/ /g
+s/ /	/
+s/ *\n *//g
+s/|/+/g
+P;
+D;
+}
+P;
+D;
+}
+D;
Index: c/src/lib/libbsp/m68k/efi332/start/start.c
===================================================================
--- c/src/lib/libbsp/m68k/efi332/start/start.c	(revision 6c6818678b12d6a1d473761f5e2d17e732aac4d2)
+++ c/src/lib/libbsp/m68k/efi332/start/start.c	(revision 50bb7627337aa780c4e8e6f3cbded85d2c80381b)
@@ -113,5 +113,5 @@
 #ifdef FLASHWRITE
   *CSORBT = (unsigned short int)
-    ( BothBytes | ReadWrite | SyncAS | WaitStates_0 | UserSupSpace );
+    ( BothBytes | ReadWrite | SyncAS | WaitStates_2 | UserSupSpace );
 #else /* FLASHWRITE */
   *CSORBT = (unsigned short int)
@@ -186,5 +186,5 @@
   /* Port E and F Pin Assignment Register */
   /*    see section 9 of the SIM Reference Manual */
-  *PEPAR = (unsigned char) 0;
+  *PEPAR = (unsigned char) 0xc3; /* siz1|siz0|dsack1|dsack0 */
   *PFPAR = (unsigned char) 0;
 
Index: c/src/lib/libbsp/m68k/efi332/startup/Makefile.am
===================================================================
--- c/src/lib/libbsp/m68k/efi332/startup/Makefile.am	(revision 6c6818678b12d6a1d473761f5e2d17e732aac4d2)
+++ c/src/lib/libbsp/m68k/efi332/startup/Makefile.am	(revision 50bb7627337aa780c4e8e6f3cbded85d2c80381b)
@@ -13,5 +13,5 @@
 C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.o)
 
-S_FILES = except_vect_332_ROM.S
+S_FILES = 
 S_O_FILES = $(S_FILES:%.S=$(ARCH)/%.o)
 
@@ -38,12 +38,7 @@
 	$(INSTALL_DATA) $< $@
 
-$(PROJECT_RELEASE)/lib/except_vect_332_ROM$(LIB_VARIANT).o: \
-    $(ARCH)/except_vect_332_ROM.o
-	$(INSTALL_DATA) $< $@
-
 # the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
 TMPINSTALL_FILES += $(PROJECT_RELEASE)/lib/linkcmds \
-    $(PROJECT_RELEASE)/lib/linkcmds_ROM \
-    $(PROJECT_RELEASE)/lib/except_vect_332_ROM$(LIB_VARIANT).o
+    $(PROJECT_RELEASE)/lib/linkcmds_ROM
 
 all-local: $(ARCH) $(OBJS) $(PGM) $(TMPINSTALL_FILES)
@@ -51,6 +46,5 @@
 .PRECIOUS: $(PGM)
 
-EXTRA_DIST = bspclean.c bspstart.c except_vect_332_ROM.S linkcmds \
-    linkcmds_ROM
+EXTRA_DIST = bspclean.c bspstart.c linkcmds linkcmds_ROM
 
 include $(top_srcdir)/../../../../../../automake/local.am
Index: src/lib/libbsp/m68k/efi332/startup/except_vect_332_ROM.S
===================================================================
--- c/src/lib/libbsp/m68k/efi332/startup/except_vect_332_ROM.S	(revision 6c6818678b12d6a1d473761f5e2d17e732aac4d2)
+++ 	(revision )
@@ -1,290 +1,0 @@
-/*
- *  $Id$
- */
-
-/* Exception Vector definitions follow */	
-
-	/* !!! Warning !!! This table is not tested, and
-	   the user must make sure it is complete. */
-
-	/* If we use TRAP #15 for reboot, note that group 0 and 1 exceptions 
-	   will have priority. */
-
-	/* Vector 0:	RESET:	Initial SSP */
-	.long	_RamEnd
-	/* Vector 1:	RESET:	Initial PC */
-	.long	start
-
-	/* default action for undefined vectors is to re-boot */
-
-	/* Note group 0 and 1 exception (like trace) have priority 
-	   over other exceptions (like trap #15) that may call this. */
-
-	/* Vectors 2-255 */
-	.long reboot   /* exception vector:   2 */
-	.long reboot   /* exception vector:   3 */
-	.long reboot   /* exception vector:   4 */
-	.long reboot   /* exception vector:   5 */
-	.long reboot   /* exception vector:   6 */
-	.long reboot   /* exception vector:   7 */
-	.long reboot   /* exception vector:   8 */
-	.long reboot   /* exception vector:   9 */
-	.long reboot   /* exception vector:  10 */
-	.long reboot   /* exception vector:  11 */
-	.long reboot   /* exception vector:  12 */
-	.long reboot   /* exception vector:  13 */
-	.long reboot   /* exception vector:  14 */
-	.long reboot   /* exception vector:  15 */
-	.long reboot   /* exception vector:  16 */
-	.long reboot   /* exception vector:  17 */
-	.long reboot   /* exception vector:  18 */
-	.long reboot   /* exception vector:  19 */
-	.long reboot   /* exception vector:  20 */
-	.long reboot   /* exception vector:  21 */
-	.long reboot   /* exception vector:  22 */
-	.long reboot   /* exception vector:  23 */
-	.long reboot   /* exception vector:  24 */
-	.long reboot   /* exception vector:  25 */
-	.long reboot   /* exception vector:  26 */
-	.long reboot   /* exception vector:  27 */
-	.long reboot   /* exception vector:  28 */
-	.long reboot   /* exception vector:  29 */
-	.long reboot   /* exception vector:  30 */
-	.long reboot   /* exception vector:  31 */
-	.long reboot   /* exception vector:  32 */
-	.long reboot   /* exception vector:  33 */
-	.long reboot   /* exception vector:  34 */
-	.long reboot   /* exception vector:  35 */
-	.long reboot   /* exception vector:  36 */
-	.long reboot   /* exception vector:  37 */
-	.long reboot   /* exception vector:  38 */
-	.long reboot   /* exception vector:  39 */
-	.long reboot   /* exception vector:  40 */
-	.long reboot   /* exception vector:  41 */
-	.long reboot   /* exception vector:  42 */
-	.long reboot   /* exception vector:  43 */
-	.long reboot   /* exception vector:  44 */
-	.long reboot   /* exception vector:  45 */
-	.long reboot   /* exception vector:  46 */
-	.long _reboot  /* the reboot trap:   47 */
-	.long reboot   /* exception vector:  48 */
-	.long reboot   /* exception vector:  49 */
-	.long reboot   /* exception vector:  50 */
-	.long reboot   /* exception vector:  51 */
-	.long reboot   /* exception vector:  52 */
-	.long reboot   /* exception vector:  53 */
-	.long reboot   /* exception vector:  54 */
-	.long reboot   /* exception vector:  55 */
-	.long reboot   /* exception vector:  56 */
-	.long reboot   /* exception vector:  57 */
-	.long reboot   /* exception vector:  58 */
-	.long reboot   /* exception vector:  59 */
-	.long reboot   /* exception vector:  60 */
-	.long reboot   /* exception vector:  61 */
-	.long reboot   /* exception vector:  62 */
-	.long reboot   /* exception vector:  63 */
-	.long reboot   /* exception vector:  64 */
-	.long reboot   /* exception vector:  65 */
-	.long reboot   /* exception vector:  66 */
-	.long reboot   /* exception vector:  67 */
-	.long reboot   /* exception vector:  68 */
-	.long reboot   /* exception vector:  69 */
-	.long reboot   /* exception vector:  70 */
-	.long reboot   /* exception vector:  71 */
-	.long reboot   /* exception vector:  72 */
-	.long reboot   /* exception vector:  73 */
-	.long reboot   /* exception vector:  74 */
-	.long reboot   /* exception vector:  75 */
-	.long reboot   /* exception vector:  76 */
-	.long reboot   /* exception vector:  77 */
-	.long reboot   /* exception vector:  78 */
-	.long reboot   /* exception vector:  79 */
-	.long reboot   /* exception vector:  80 */
-	.long reboot   /* exception vector:  81 */
-	.long reboot   /* exception vector:  82 */
-	.long reboot   /* exception vector:  83 */
-	.long reboot   /* exception vector:  84 */
-	.long reboot   /* exception vector:  85 */
-	.long reboot   /* exception vector:  86 */
-	.long reboot   /* exception vector:  87 */
-	.long reboot   /* exception vector:  88 */
-	.long reboot   /* exception vector:  89 */
-	.long reboot   /* exception vector:  90 */
-	.long reboot   /* exception vector:  91 */
-	.long reboot   /* exception vector:  92 */
-	.long reboot   /* exception vector:  93 */
-	.long reboot   /* exception vector:  94 */
-	.long reboot   /* exception vector:  95 */
-	.long reboot   /* exception vector:  96 */
-	.long reboot   /* exception vector:  97 */
-	.long reboot   /* exception vector:  98 */
-	.long reboot   /* exception vector:  99 */
-	.long reboot   /* exception vector: 100 */
-	.long reboot   /* exception vector: 101 */
-	.long reboot   /* exception vector: 102 */
-	.long reboot   /* exception vector: 103 */
-	.long reboot   /* exception vector: 104 */
-	.long reboot   /* exception vector: 105 */
-	.long reboot   /* exception vector: 106 */
-	.long reboot   /* exception vector: 107 */
-	.long reboot   /* exception vector: 108 */
-	.long reboot   /* exception vector: 109 */
-	.long reboot   /* exception vector: 110 */
-	.long reboot   /* exception vector: 111 */
-	.long reboot   /* exception vector: 112 */
-	.long reboot   /* exception vector: 113 */
-	.long reboot   /* exception vector: 114 */
-	.long reboot   /* exception vector: 115 */
-	.long reboot   /* exception vector: 116 */
-	.long reboot   /* exception vector: 117 */
-	.long reboot   /* exception vector: 118 */
-	.long reboot   /* exception vector: 119 */
-	.long reboot   /* exception vector: 120 */
-	.long reboot   /* exception vector: 121 */
-	.long reboot   /* exception vector: 122 */
-	.long reboot   /* exception vector: 123 */
-	.long reboot   /* exception vector: 124 */
-	.long reboot   /* exception vector: 125 */
-	.long reboot   /* exception vector: 126 */
-	.long reboot   /* exception vector: 127 */
-	.long reboot   /* exception vector: 128 */
-	.long reboot   /* exception vector: 129 */
-	.long reboot   /* exception vector: 130 */
-	.long reboot   /* exception vector: 131 */
-	.long reboot   /* exception vector: 132 */
-	.long reboot   /* exception vector: 133 */
-	.long reboot   /* exception vector: 134 */
-	.long reboot   /* exception vector: 135 */
-	.long reboot   /* exception vector: 136 */
-	.long reboot   /* exception vector: 137 */
-	.long reboot   /* exception vector: 138 */
-	.long reboot   /* exception vector: 139 */
-	.long reboot   /* exception vector: 140 */
-	.long reboot   /* exception vector: 141 */
-	.long reboot   /* exception vector: 142 */
-	.long reboot   /* exception vector: 143 */
-	.long reboot   /* exception vector: 144 */
-	.long reboot   /* exception vector: 145 */
-	.long reboot   /* exception vector: 146 */
-	.long reboot   /* exception vector: 147 */
-	.long reboot   /* exception vector: 148 */
-	.long reboot   /* exception vector: 149 */
-	.long reboot   /* exception vector: 150 */
-	.long reboot   /* exception vector: 151 */
-	.long reboot   /* exception vector: 152 */
-	.long reboot   /* exception vector: 153 */
-	.long reboot   /* exception vector: 154 */
-	.long reboot   /* exception vector: 155 */
-	.long reboot   /* exception vector: 156 */
-	.long reboot   /* exception vector: 157 */
-	.long reboot   /* exception vector: 158 */
-	.long reboot   /* exception vector: 159 */
-	.long reboot   /* exception vector: 160 */
-	.long reboot   /* exception vector: 161 */
-	.long reboot   /* exception vector: 162 */
-	.long reboot   /* exception vector: 163 */
-	.long reboot   /* exception vector: 164 */
-	.long reboot   /* exception vector: 165 */
-	.long reboot   /* exception vector: 166 */
-	.long reboot   /* exception vector: 167 */
-	.long reboot   /* exception vector: 168 */
-	.long reboot   /* exception vector: 169 */
-	.long reboot   /* exception vector: 170 */
-	.long reboot   /* exception vector: 171 */
-	.long reboot   /* exception vector: 172 */
-	.long reboot   /* exception vector: 173 */
-	.long reboot   /* exception vector: 174 */
-	.long reboot   /* exception vector: 175 */
-	.long reboot   /* exception vector: 176 */
-	.long reboot   /* exception vector: 177 */
-	.long reboot   /* exception vector: 178 */
-	.long reboot   /* exception vector: 179 */
-	.long reboot   /* exception vector: 180 */
-	.long reboot   /* exception vector: 181 */
-	.long reboot   /* exception vector: 182 */
-	.long reboot   /* exception vector: 183 */
-	.long reboot   /* exception vector: 184 */
-	.long reboot   /* exception vector: 185 */
-	.long reboot   /* exception vector: 186 */
-	.long reboot   /* exception vector: 187 */
-	.long reboot   /* exception vector: 188 */
-	.long reboot   /* exception vector: 189 */
-	.long reboot   /* exception vector: 190 */
-	.long reboot   /* exception vector: 191 */
-	.long reboot   /* exception vector: 192 */
-	.long reboot   /* exception vector: 193 */
-	.long reboot   /* exception vector: 194 */
-	.long reboot   /* exception vector: 195 */
-	.long reboot   /* exception vector: 196 */
-	.long reboot   /* exception vector: 197 */
-	.long reboot   /* exception vector: 198 */
-	.long reboot   /* exception vector: 199 */
-	.long reboot   /* exception vector: 200 */
-	.long reboot   /* exception vector: 201 */
-	.long reboot   /* exception vector: 202 */
-	.long reboot   /* exception vector: 203 */
-	.long reboot   /* exception vector: 204 */
-	.long reboot   /* exception vector: 205 */
-	.long reboot   /* exception vector: 206 */
-	.long reboot   /* exception vector: 207 */
-	.long reboot   /* exception vector: 208 */
-	.long reboot   /* exception vector: 209 */
-	.long reboot   /* exception vector: 210 */
-	.long reboot   /* exception vector: 211 */
-	.long reboot   /* exception vector: 212 */
-	.long reboot   /* exception vector: 213 */
-	.long reboot   /* exception vector: 214 */
-	.long reboot   /* exception vector: 215 */
-	.long reboot   /* exception vector: 216 */
-	.long reboot   /* exception vector: 217 */
-	.long reboot   /* exception vector: 218 */
-	.long reboot   /* exception vector: 219 */
-	.long reboot   /* exception vector: 220 */
-	.long reboot   /* exception vector: 221 */
-	.long reboot   /* exception vector: 222 */
-	.long reboot   /* exception vector: 223 */
-	.long reboot   /* exception vector: 224 */
-	.long reboot   /* exception vector: 225 */
-	.long reboot   /* exception vector: 226 */
-	.long reboot   /* exception vector: 227 */
-	.long reboot   /* exception vector: 228 */
-	.long reboot   /* exception vector: 229 */
-	.long reboot   /* exception vector: 230 */
-	.long reboot   /* exception vector: 231 */
-	.long reboot   /* exception vector: 232 */
-	.long reboot   /* exception vector: 233 */
-	.long reboot   /* exception vector: 234 */
-	.long reboot   /* exception vector: 235 */
-	.long reboot   /* exception vector: 236 */
-	.long reboot   /* exception vector: 237 */
-	.long reboot   /* exception vector: 238 */
-	.long reboot   /* exception vector: 239 */
-	.long reboot   /* exception vector: 240 */
-	.long reboot   /* exception vector: 241 */
-	.long reboot   /* exception vector: 242 */
-	.long reboot   /* exception vector: 243 */
-	.long reboot   /* exception vector: 244 */
-	.long reboot   /* exception vector: 245 */
-	.long reboot   /* exception vector: 246 */
-	.long reboot   /* exception vector: 247 */
-	.long reboot   /* exception vector: 248 */
-	.long reboot   /* exception vector: 249 */
-	.long reboot   /* exception vector: 250 */
-	.long reboot   /* exception vector: 251 */
-	.long reboot   /* exception vector: 252 */
-	.long reboot   /* exception vector: 253 */
-	.long reboot   /* exception vector: 254 */
-	.long reboot   /* exception vector: 255 */
-
-
-_reboot:
-	move	#0x2700,%sr	/* mask interrupts */
-	movea.l	(0x0).w,%a7	/* load stack */
-	movea.l	(0x4).w,%a0	/* jmp to location of reset vector */
-	jmp	(%a0)
-
-reboot:	
-	trap	#15		/* use trap exception to enter supervisor 
-				   state. Trace mode ( and other group 0 
-				   and 1 exceptions) *could* screw this up if 
-				   not vectored to reboot or did not return. */
Index: c/src/lib/libbsp/m68k/efi332/startup/linkcmds
===================================================================
--- c/src/lib/libbsp/m68k/efi332/startup/linkcmds	(revision 6c6818678b12d6a1d473761f5e2d17e732aac4d2)
+++ c/src/lib/libbsp/m68k/efi332/startup/linkcmds	(revision 50bb7627337aa780c4e8e6f3cbded85d2c80381b)
@@ -10,4 +10,5 @@
  * The memory map looks like this:
  * +--------------------+ <- low memory
+ * |        _RamBase    |
  * | .text              |
  * |        etext       |
@@ -24,8 +25,9 @@
  * |        _end        | start of heap, used by sbrk()
  * +--------------------+
+ * |         _WorkspaceBase 
+ * |    work space      |
+ * |        heapStart   |
  * |    heap space      |
- * |        _ENDHEAP    |
- * |    stack space     | 
- * |        __stack     | top of stack
+ * |        _RamEnd     | top of stack
  * +--------------------+ <- high memory
  */
Index: c/src/lib/libbsp/m68k/efi332/startup/linkcmds_ROM
===================================================================
--- c/src/lib/libbsp/m68k/efi332/startup/linkcmds_ROM	(revision 6c6818678b12d6a1d473761f5e2d17e732aac4d2)
+++ c/src/lib/libbsp/m68k/efi332/startup/linkcmds_ROM	(revision 50bb7627337aa780c4e8e6f3cbded85d2c80381b)
@@ -9,4 +9,5 @@
 
 /*
+ * The memory map looks like this:
  * ROM:
  * +--------------------+ <- low memory
@@ -23,4 +24,5 @@
  * RAM:
  * +--------------------+ <- low memory
+ * |        _RamBase    |
  * | .data              | initialized data goes here
  * |        _sdata      |
@@ -28,23 +30,30 @@
  * +--------------------+
  * | .bss               |
- * |        __bss_start | start of bss, cleared by crt0
+ * |        _clear_start| start of bss, cleared by crt0
  * |        _end        | start of heap, used by sbrk()
  * +--------------------+
+ * |         _WorkspaceBase 
+ * |    work space      |
+ * |        heapStart   |
  * |    heap space      |
- * |        _ENDHEAP    |
- * |    stack space     | 
- * |        __stack     | top of stack
+ * |        _RamEnd     | top of stack
  * +--------------------+ <- high memory
  */
+
+/*
+ * Declare some sizes.
+ */
+_RamBase = DEFINED(_RamBase) ? _RamBase : 0x80000;
+_RamSize = DEFINED(_RamSize) ? _RamSize : 0x40000;
+_RamEnd = _RamBase + _RamSize;
+_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
+_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
 
 MEMORY
 {
   rom     : ORIGIN = 0x00000, LENGTH = 256K
-  ram     : ORIGIN = 0x80000, LENGTH = 512K
+  ram     : ORIGIN = 0x80000, LENGTH = 256K
 }
 
-_RamBase = DEFINED(_RamBase) ? _RamBase : 0x080000;
-
-__end_of_ram = 0x100000;
 _copy_data_from_rom = 1;
 
@@ -54,68 +63,144 @@
 SECTIONS
 {
-  .text :
+	ram : {
+		. = .;
+	} >ram
+
+        /*
+         * Text, data and bss segments
+         */
+        .text : {
+    *(.text)
+
+		/*
+		 * C++ constructors/destructors
+		 */
+		*(.gnu.linkonce.t.*)
+
+		/*
+		 * Initialization and finalization code.
+     		 *
+     		 * Various files can provide initialization and finalization
+		 * functions.  crtbegin.o and crtend.o are two instances. The
+		 * body of these functions are in .init and .fini sections. We
+		 * accumulate the bodies here, and prepend function prologues
+		 * from crti.o and function epilogues from crtn.o. crti.o must
+		 * be linked first; crtn.o must be linked last.  Because these
+		 * are wildcards, it doesn't matter if the user does not
+		 * actually link against crti.o and crtn.o; the linker won't
+		 * look for a file to match a wildcard.  The wildcard also
+		 * means that it doesn't matter which directory crti.o and
+		 * crtn.o are in. 
+		 */
+		PROVIDE (_init = .);
+		*crti.o(.init)
+		*(.init)
+		*crtn.o(.init)
+		PROVIDE (_fini = .);
+		*crti.o(.fini)
+		*(.fini)
+		*crtn.o(.fini)
+
+		/*
+		 * C++ constructors/destructors
+     		 *
+     		 * gcc uses crtbegin.o to find the start of the constructors
+		 * and destructors so we make sure it is first.  Because this
+		 * is a wildcard, it doesn't matter if the user does not
+		 * actually link against crtbegin.o; the linker won't look for
+		 * a file to match a wildcard.  The wildcard also means that
+		 * it doesn't matter which directory crtbegin.o is in. The
+		 * constructor and destructor list are terminated in
+		 * crtend.o.  The same comments apply to it.
+		 */
+		. = ALIGN (16);
+		*crtbegin.o(.ctors)
+    *(.ctors)
+		*crtend.o(.ctors)
+		*crtbegin.o(.dtors)
+    *(.dtors)
+		*crtend.o(.dtors)
+
+		/*
+		 * Exception frame info
+		 */
+		. = ALIGN (16);
+		*(.eh_frame)
+
+		/*
+		 * Read-only data
+		 */
+		. = ALIGN (16);
+		_rodata_start = . ;
+		*(.rodata)
+		*(.gnu.linkonce.r*)
+
+                 . = ALIGN (16);
+                PROVIDE (_etext = .);
+        } >rom
+  .data :
+	AT ( ADDR(.text) + SIZEOF( .text ) )
   {
-    CREATE_OBJECT_SYMBOLS
-    text_start = .;
-    _text_start = .;
-    *(.text)
-    . = ALIGN (16);
-
-    *(.eh_fram)
-    . = ALIGN (16);
-
-    etext = ALIGN(0x10);
-    _etext = .;
-    __CTOR_LIST__ = .;
-    LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
-    *(.ctors)
-    LONG(0)
-    __CTOR_END__ = .;
-    __DTOR_LIST__ = .;
-    LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
-    *(.dtors)
-    LONG(0)
-    __DTOR_END__ = .;
-    *(.lit)
-    *(.shdata)
-    _endtext = .;
-  } > rom
-  .gcc_exc :
-  AT ( ADDR(.text) + SIZEOF( .text ) )
-  {
-    *(.gcc_exc)
-  } > ram
-  .data :
-  {
-    data_start = .;
-    _data_start = .;
-    _sdata = . ;
+                PROVIDE (_copy_start = .);
     *(.data)
-    CONSTRUCTORS
-    edata = ALIGN(0x10);
-    _edata = .;
-  } > ram
-  .shbss :
-  {
-    *(.shbss)
-  } > ram
-  .bss :
-  {
-    __bss_start = ALIGN(0x8);
-    bss_start = .;
-    _bss_start = .;
+		*(.gnu.linkonce.d*)
+		*(.gcc_except_table)
+                . = ALIGN (16);
+                PROVIDE (_edata = .);
+                PROVIDE (_copy_end = .);
+        } >ram
+        .bss : {
+                _clear_start = .;
     *(.bss)
     *(COMMON)
-    end = .;
-    _end = ALIGN(0x8);
-    __end = ALIGN(0x8);
-  } > ram
-  .stab . (NOLOAD) :
-  {
-    [ .stab ]
-  }
-  .stabstr . (NOLOAD) :
-  {
-    [ .stabstr ]
-  }
+                . = ALIGN (16);
+                PROVIDE (end = .);
+
+                . += _StackSize;
+                . = ALIGN (16);
+                _stack_init = .;
+                _clear_end = .;
+
+                _WorkspaceBase = .;
+        } >ram
+
+  /* Stabs debugging sections.  */
+  .stab 0 : { *(.stab) }
+  .stabstr 0 : { *(.stabstr) }
+  .stab.excl 0 : { *(.stab.excl) }
+  .stab.exclstr 0 : { *(.stab.exclstr) }
+  .stab.index 0 : { *(.stab.index) }
+  .stab.indexstr 0 : { *(.stab.indexstr) }
+  .comment 0 : { *(.comment) }
+
+  /* DWARF debug sections.
+     Symbols in the DWARF debugging sections are relative to the beginning
+     of the section so we begin them at 0.  */
+  /* DWARF 1 */
+  .debug          0 : { *(.debug) }
+  .line           0 : { *(.line) }
+  
+  /* GNU DWARF 1 extensions */
+  .debug_srcinfo  0 : { *(.debug_srcinfo) }
+  .debug_sfnames  0 : { *(.debug_sfnames) }
+  
+  /* DWARF 1.1 and DWARF 2 */
+  .debug_aranges  0 : { *(.debug_aranges) }
+  .debug_pubnames 0 : { *(.debug_pubnames) }
+  
+  /* DWARF 2 */
+  .debug_info     0 : { *(.debug_info) }
+  .debug_abbrev   0 : { *(.debug_abbrev) }
+  .debug_line     0 : { *(.debug_line) }
+  .debug_frame    0 : { *(.debug_frame) }
+  .debug_str      0 : { *(.debug_str) }
+  .debug_loc      0 : { *(.debug_loc) }
+  .debug_macinfo  0 : { *(.debug_macinfo) }
+  
+  /* SGI/MIPS DWARF 2 extensions */
+  .debug_weaknames 0 : { *(.debug_weaknames) }
+  .debug_funcnames 0 : { *(.debug_funcnames) }
+  .debug_typenames 0 : { *(.debug_typenames) }
+  .debug_varnames  0 : { *(.debug_varnames) }
+  /* These must appear regardless of  .  */
 }
