This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Port to MVME2304-SC and a general memory problem


Hello,

I'm tryring to get the eCos distribution (CVS from the 14. may) working
on the Motorola MVME2304-SC Board, wich is powered by a PPC604
processor. On the Motorola board is a PPC-Bug shell wich I can use as a
bootloader that downloads the image file via tftp into ram. So I think i
don't need RedBoot and the startup type should RAM. Is this correct so
far?
While looking around, it seems, that I need to do a platform port
(Memory Layout and some startup code). To see that everything works fine
on my development system, I tried to compile the distribution for the
fads and then for the cogent board. My development system consits of
SuSE Linux 7.2 (2.4.4 Kernel) and a self compiled powerpc cross compiler
- gcc 2.95.3, binutils 2.10.91.0.4 and newlib 1.9.0 (wich everything
works fine in other projects).
The building process works fine. When it's ready, I can find the
extras.o, libextras.a, libtarget.a, target.ld and vectors.o on the
install/lib directory. I edited target.ld and gave the GROUP(libtarget.a
libgcc.a) a complete path for the libgcc.a, and then called:

powerpc-eabi-ld -Map image.map target.ld -o image.ram

wich gives me for this error (from the cogent board now):

powerpc-eabi-ld: address 0x180f414 of image.ram section .text is not
within region ram
powerpc-eabi-ld: address 0x180f414 of image.ram section .fini is not
within region ram
powerpc-eabi-ld: address 0x1810638 of image.ram section .rodata is not
within region ram
powerpc-eabi-ld: address 0x1810638 of image.ram section .rodata1 is not
within region ram
powerpc-eabi-ld: warning: no memory region specified for section
`.sdata2'
powerpc-eabi-ld: address 0x18105f0 of image.ram section .data is not
within region ram
powerpc-eabi-ld: address 0x18105f0 of image.ram section
.gcc_except_table is not within region ram
powerpc-eabi-ld: address 0x18105f0 of image.ram section .fixup is not
within region ram
powerpc-eabi-ld: address 0x1810638 of image.ram section .sbss is not
within region ram
powerpc-eabi-ld: address 0x1813668 of image.ram section .bss is not
within region ram
powerpc-eabi-ld: section .data [01810078 -> 018105ef] overlaps section
.rodata [0180f418 -> 01810637]
powerpc-eabi-ld: warning: cannot find entry symbol __exception_reset;
defaulting to 01800074
libtarget.a(kernel_intr.o): In function `global destructors keyed to
Cyg_Interrupt::12000.(unsigned int, int, unsigned int, unsigned int
(*)(uns
/root/ecos/packages/kernel/current/src/intr/intr.cxx:63: undefined
reference to `hal_interrupt_stack_call_pending_DSRs'

OK, I'm sure that you will have seen this already very often, but I
can't figure out the reason. When i look into the image.map I can see:

[...]
Memory Configuration
 
Name             Origin             Length             Attributes
*default*        0x00000000         0xffffffff
ram              0x00000000         0x00800000
 
Linker script and memory map
 
LOAD vectors.o
LOAD target.ld
LOAD extras.o
START GROUP
LOAD libtarget.a
LOAD /root/ppccross/out/lib/gcc-lib/powerpc-eabi/2.95.3/libgcc.a
END GROUP
                0x00000000                PROVIDE (__stack, 0x0)
                0x00000000                PROVIDE (___stack, 0x0)
                0x01800074                .=(0x1800000+SIZEOF_HEADERS)
 
.interp
 *(.interp)
 
.hash
 *(.hash)
[...]

So the RAM starts at 0x00000000. Later on the file i can see:


[...]
.init
 *(.init)
 
.text           0x01800074     0xf3a0
 *(.text)
 .text          0x01800074      0x1e8
libtarget.a(hal_powerpc_arch_context.o)
                0x01800184                hal_setjmp
                0x018000f8                hal_thread_load_context
                0x01800074                hal_thread_switch_context
                0x018001f0                hal_longjmp
 .text          0x0180025c       0x40
/root/ppccross/out/lib/gcc-lib/powerpc-eabi/2.95.3/libgcc.a(_ashrdi3.o)
                0x0180025c                __ashrdi3
 .text          0x0180029c      0x524
/root/ppccross/out/lib/gcc-lib/powerpc-eabi/2.95.3/libgcc.a(_udivdi3.o)
                0x0180029c                __udivdi3
 .text          0x018007c0      0x4e4
/root/ppccross/out/lib/gcc-lib/powerpc-eabi/2.95.3/libgcc.a(_umoddi3.o)
                0x018007c0                __umoddi3
 *(.text.*)
 .text.__static_initialization_and_destruction_0
                0x01800ca4       0x70 extras.o

.text._GLOBAL_.I.49000._root_ecos_packages_io_common_current_src_ioinit.cxxvosyga
                0x01800d14       0x2c extras.o
 .text.serial_init
                0x01800d40       0xc4 extras.o

[...]

The textsegment is complety out of the RAM. At the end of the file there
is:

[...]
.debug_varnames
 *(.debug_varnames)
OUTPUT(image.ram elf32-powerpc)
                0x00000000                __reserved_vectors=0x0
                0x00003000                .=(__reserved_vectors+0x3000)
                0x00000700               
__reserved_vsr_table=ALIGN(0x10)
                0x00003200                .=(__reserved_vsr_table+0x200)
                0x00000700               
__reserved_virtual_table=ALIGN(0x10)
                0x00003300               
.=(__reserved_virtual_table+0x100)
                0x00000700                __reserved_for_rom=ALIGN(0x10)
                0x00010000                .=(__reserved_for_rom+0xcd00)
 
.vectors        0x00010000        0x0
                0x00010000                .=.
 *(.vectors)
                0x00010000                _etext=.
                0x00010000                PROVIDE (etext, .)
                0x01810078               
__rom_data_start=LOADADDR(.data)
                0x00010000                __ram_data_end=.
                0x00010000                PROVIDE (__ram_data_end, .)
                0x00010000                _edata=.
                0x00010000                PROVIDE (edata, .)
                0x00010000                __heap1=ALIGN(0x8)
                0x00010000                .=ALIGN(0x4)
                0x00010000                _end=.
                0x00010000                PROVIDE (end, .)
                0x00003000                hal_vsr_table=0x3000
                0x00003200               
hal_virtual_vector_table=0x3200

And there the file ends.

My target.ld section looks like:

[...]
MEMORY
{
    ram : ORIGIN = 0, LENGTH = 0x800000
}
 
SECTIONS
{
 
     __reserved_vectors   = 0; . =  __reserved_vectors   + 0x3000;
     __reserved_vsr_table   = ALIGN (0x10); . =  __reserved_vsr_table  
+ 0x200;
     __reserved_virtual_table   = ALIGN (0x10); . = 
__reserved_virtual_table   + 0x100;
     __reserved_for_rom   = ALIGN (0x10); . =  __reserved_for_rom   +
0xcd00;
    .vectors   ALIGN (0x10)  :      { . = . ; KEEP(*(.vectors)) } >  ram
    .text   ALIGN (0x4)  :      { _stext = .; *(.text*) *(.gnu.warning)
*(.gnu.linkonce*) *(.init) } >  ram  _etext = .;  PROVIDE (etext = .);  
    .rodata1   ALIGN (0x8)  :      { . = . ; *(.rodata1*) } >  ram
    .rodata   ALIGN (0x8)  :      { . = . ; *(.rodata*) } >  ram
    .fixup   ALIGN (0x4)  :      { __FIXUP_START__ = ABSOLUTE(.);
*(.fixup) __FIXUP_END__ = ABSOLUTE(.);} >  ram
    .gcc_except_table   ALIGN (0x1)  :      { __EXCEPT_START__ =
ABSOLUTE(.); *(.gcc_except_table) __EXCEPT_END__ = ABSOLUTE(.);} >  ram
    .data   ALIGN (0x8)  :      { __ram_data_start = ABSOLUTE(.);
*(.data*) __GOT1_START__ = ABSOLUTE(.); *(.got1) __GOT1_END__ =
ABSOLUTE(.);  
     __heap1   = ALIGN (0x8);
    . = ALIGN(4); _end = .; PROVIDE (end = .);
}


I'm quite new to linking, setting the correct regions and that stuff, so
what do I have to change to get the linking process working?
I know these are newbie questions but I can't figure it out by myself.

If there is someone, who would like to help me doing the port to the
MVME2304 or just giving me hints I would be very grateful!

Thank you!


Stephane Boulanger

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]