Index: c/src/lib/libbsp/m68k/ods68302/start/reset.S
===================================================================
--- c/src/lib/libbsp/m68k/ods68302/start/reset.S	(revision 1e41f5a7492f8204cdc3f88077b22e0c7b4e9355)
+++ c/src/lib/libbsp/m68k/ods68302/start/reset.S	(revision 8f3e0c820e2791e688493eaf5eaa548eb9573fae)
@@ -38,5 +38,5 @@
 | Initial stack pointer is in the dual ported RAM
 |
-        .sect   .text
+        .sect   .resettext
 
         .global M68Kvec                 | Vector Table
@@ -470,6 +470,7 @@
         jlt     zerobss_loop                    | loop until _end reached
 
-        movel   %d0,_stack_init                 | load stack top
-
+        movel   #stack_end,%d0
+        andl    #0xfffffffc,%d0                 | align it on 16 byte boundary
+ 
         movw    #0x3700,%sr                     | SUPV MODE,INTERRUPTS OFF!!!
         movel   %d0,%a7                         | set master stack pointer
@@ -494,5 +495,4 @@
                 
 EXCEPTION_HANDLER(#, 0)
-#if 0
 EXCEPTION_HANDLER(#, 1)
 EXCEPTION_HANDLER(#, 2)
@@ -776,11 +776,6 @@
 EXCEPTION_HANDLER(#, 255)                                
 
-#endif
-
-
-
 common_exception_handler: 
 
-#if 0
         |
         | Need to put the format/vector above the PC and status register
@@ -802,5 +797,4 @@
 
         bra     ceh_20
-
 ceh_10:              
 
@@ -810,5 +804,5 @@
         move.l  %d0,-(%sp)                      | free a register, again
         move.w  4(%sp),%d0                      | get the format/vector id
-
+        
 ceh_20:
 
@@ -828,10 +822,12 @@
         | check to see if ROM is mapped to zero
         |
-        
+
+        move.l  #(ROM_SIZE - 1),%d1
+        not.l   %d1
+        lea.l   %pc@(0),%a0                     | were are we currently
+        move.l  %a0,%d0                         | need to use a data register
+        and.l   %d1,%d0                         | keep the top part of the address
         move.l  #trace_exception,%d1            | get the linked address
         and.l   #(ROM_SIZE - 1),%d1             | obtain the offset into the ROM
-        lea.l   %pc@(0),%a0                     | were are we currently
-        move.l  %a0,%d0                         | need to use a data register
-        and.l   #~(ROM_SIZE - 1),%d0            | keep the top part of the address
         or.l    %d1,%d0                         | apply it to the trace exception offset
         move.l  %d0,%a0                         | need an address register for jumping
@@ -840,9 +836,9 @@
 ceh_30:                 
         jmp     ceh_30
+
 |
 | The RAM based vector table
 |
 
-#endif
         .sect   .vtable
 
@@ -863,8 +859,4 @@
         .space  4,0
 
-        .global stack_start
-        
-stack_start:
-        .space  4,0
 
 |
@@ -885,4 +877,10 @@
         .global stack_size
         .set    stack_size,0x1000
-
-
+        .global stack_start
+        
+stack_start:
+stack_base:
+        .space  0x2000, 0
+stack_end:
+        .long   0
+ 
Index: c/src/lib/libbsp/m68k/ods68302/startup/cpuboot.c
===================================================================
--- c/src/lib/libbsp/m68k/ods68302/startup/cpuboot.c	(revision 1e41f5a7492f8204cdc3f88077b22e0c7b4e9355)
+++ c/src/lib/libbsp/m68k/ods68302/startup/cpuboot.c	(revision 8f3e0c820e2791e688493eaf5eaa548eb9573fae)
@@ -69,6 +69,7 @@
 #endif
   
-  m302.reg.gimr = m302.reg.ipr = m302.reg.imr = m302.reg.isr = 0;
-  
+  m302.reg.ipr = m302.reg.imr = m302.reg.isr = 0;
+  m302.reg.gimr = 0x0080;
+
   m302.reg.simode = 0;
 
@@ -102,6 +103,6 @@
 #endif
   
-  WRITE_BR(CSEL_ROM, ROM_BASE, BR_READ_ONLY, BR_FC_NULL, BR_ENABLED);
-  WRITE_BR(CSEL_RAM, RAM_BASE, BR_READ_WRITE, BR_FC_NULL, BR_ENABLED);
+  WRITE_BR(CSEL_ROM, _ROM_BASE, BR_READ_ONLY, BR_FC_NULL, BR_ENABLED);
+  WRITE_BR(CSEL_RAM, _RAM_BASE, BR_READ_WRITE, BR_FC_NULL, BR_ENABLED);
   
 #if defined(LED_CONTROL)
@@ -111,5 +112,5 @@
 
   /* seems to want 2, looked at assember code output */
-  *(&stack + 2) |= ROM_BASE;
+  *((volatile rtems_unsigned32*) (&stack + 2)) |= ROM_BASE;
 }
 
Index: c/src/lib/libbsp/m68k/ods68302/startup/linkcmds
===================================================================
--- c/src/lib/libbsp/m68k/ods68302/startup/linkcmds	(revision 1e41f5a7492f8204cdc3f88077b22e0c7b4e9355)
+++ c/src/lib/libbsp/m68k/ods68302/startup/linkcmds	(revision 8f3e0c820e2791e688493eaf5eaa548eb9573fae)
@@ -13,4 +13,13 @@
 _HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
 _StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
+
+/*
+ * Memory map.
+ */
+RAM_BASE = DEFINED(RAM_BASE) ? RAM_BASE : 0x00000000;
+RAM_SIZE = DEFINED(RAM_SIZE) ? RAM_SIZE : 0x00100000;
+ROM_BASE = DEFINED(ROM_BASE) ? ROM_BASE : 0x00C00000;
+ROM_SIZE = DEFINED(ROM_SIZE) ? ROM_SIZE : 0x00100000;
+MC68302_BASE = DEFINED(MC68302_BASE) ? MC68302_BASE : 0x00700000;
 
 /*
@@ -22,9 +31,5 @@
 SECTIONS
 {
-	ram : {
-		. = .;
-	} >ram
-
-	.vtable :
+	.vtable RAM_BASE :
 	{
 		vtable_start = .;
@@ -33,9 +38,17 @@
 	} >ram
 
-
         /*
          * Text, data and bss segments
          */
-        .text : {
+        .text ROM_BASE : {
+                /*
+                 * Needs to be first. 8K limit on CS0 at reset.
+                 */
+		*(.resettext);
+                *cpuboot.o(.text)
+
+                /*
+                 * The reset of the text is entered once CS0 is remapped.
+                 */
                 *(.text)
 
@@ -115,6 +128,8 @@
                  . = ALIGN (16);
                 PROVIDE (_etext = .);
-        } >ram
-        .data : {
+        } >rom
+
+        .data (ADDR(.vtable) + SIZEOF(.vtable)) : 
+          AT (ADDR(.text) + SIZEOF(.text)) {
                 PROVIDE (_copy_start = .);
                 *(.data)
@@ -126,5 +141,5 @@
                 PROVIDE (_copy_end = .);
         } >ram
-        .bss : {
+        .bss (ADDR(.data) + SIZEOF(.data)) : {
                 _clear_start = .;
                 *(.bss)
@@ -182,9 +197,4 @@
 }
 
-RAM_BASE = DEFINED(RAM_BASE) ? RAM_BASE : 0x00000000;
-RAM_SIZE = DEFINED(RAM_SIZE) ? RAM_SIZE : 0x00100000;
-ROM_BASE = DEFINED(ROM_BASE) ? ROM_BASE : 0x00C00000;
-ROM_SIZE = DEFINED(ROM_SIZE) ? ROM_SIZE : 0x00100000;
-MC68302_BASE = DEFINED(MC68302_BASE) ? MC68302_BASE : 0x00700000;
 m302 = MC68302_BASE;
 _VBR = ADDR(.vtable);		/* location of the VBR table (in RAM) */
