<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>
hi<BR>
i'm doing a bsp for SAM7 which is an arm with code in ROM, so i can get the rom version of this linker file and  how to use the function you are talking about to detect work area so that we can standarise it.<BR>
 <BR>
Thanks<BR><BR>> Date: Mon, 15 Sep 2008 14:02:07 +0200<BR>> From: sebastian.huber@embedded-brains.de<BR>> To: joel.sherrill@oarcorp.com<BR>> Subject: Re: ARM Initialization Question<BR>> CC: rtems-users@rtems.com<BR>> <BR>> Joel Sherrill wrote:<BR>> > Sebastian Huber wrote:<BR>> >> Hi,<BR>> >> I am quite new to the ARM architecture and try to develop a BSP for the<BR>> >> LPC2478. I have a question to the initialization code (random start.S):<BR>> >><BR>> >> <BR>> > Just firing a warning shot .. I am starting to refactor out<BR>> > more common code from the BSPs. Please try to help out<BR>> > by moving with me to the better place. :)<BR>> > <BR>> > + You know about bsp_get_work_area. I am starting to<BR>> > put it in "startup/bspgetworkarea.c" not bspstart.c<BR>> > and reworking all BSPs to have one.<BR>> [...]<BR>> <BR>> I try to provide two general purpose linker command files (one for RAM <BR>> only and one for code in ROM). With such a linker command file it is <BR>> possible to use a generic version of bsp_get_work_area(). Reducing the <BR>> amount of linker command files increases the maintainablity and makes <BR>> development of new BSPs easier. Here is my proposal for the ARM:<BR>> <BR>> /**<BR>> * @file<BR>> *<BR>> * @brief Linker command file for configuration with internal and <BR>> external RAM.<BR>> */<BR>> <BR>> /*<BR>> * Copyright (c) 2008<BR>> * Embedded Brains GmbH<BR>> * Obere Lagerstr. 30<BR>> * D-82178 Puchheim<BR>> * Germany<BR>> * rtems@embedded-brains.de<BR>> *<BR>> * The license and distribution terms for this file may be found in the <BR>> file<BR>> * LICENSE in this distribution or at http://www.rtems.com/license/LICENSE.<BR>> */<BR>> <BR>> OUTPUT_FORMAT ("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")<BR>> <BR>> OUTPUT_ARCH (arm)<BR>> <BR>> ENTRY (start)<BR>> <BR>> /*<BR>> * BSP: Symbols that may be defined externally. The minimum alignment<BR>> * requirement for regions is bsp_section_align.<BR>> */<BR>> bsp_ram_int_size = DEFINED (bsp_ram_int_size) ? bsp_ram_int_size : <BR>> LENGTH (RAM_INT);<BR>> <BR>> bsp_ram_ext_size = DEFINED (bsp_ram_ext_size) ? bsp_ram_ext_size : <BR>> LENGTH (RAM_EXT);<BR>> <BR>> bsp_stack_abt_size = DEFINED (bsp_stack_abt_size) ? bsp_stack_abt_size : <BR>> 128;<BR>> <BR>> bsp_stack_fiq_size = DEFINED (bsp_stack_fiq_size) ? bsp_stack_fiq_size : <BR>> 128;<BR>> <BR>> bsp_stack_irq_size = DEFINED (bsp_stack_irq_size) ? bsp_stack_irq_size : <BR>> 256;<BR>> <BR>> bsp_stack_svc_size = DEFINED (bsp_stack_svc_size) ? bsp_stack_svc_size : <BR>> 256;<BR>> <BR>> bsp_stack_undef_size = DEFINED (bsp_stack_undef_size) ? <BR>> bsp_stack_undef_size : 128;<BR>> <BR>> /*<BR>> * BSP: Global symbols<BR>> */<BR>> bsp_ram_int_start = ORIGIN (RAM_INT);<BR>> bsp_ram_int_end = bsp_ram_int_start + bsp_ram_int_size;<BR>> <BR>> bsp_ram_ext_start = ORIGIN (RAM_EXT);<BR>> bsp_ram_ext_end = bsp_ram_ext_start + bsp_ram_ext_size;<BR>> <BR>> bsp_section_align = 16;<BR>> <BR>> bsp_stack_align = 16;<BR>> <BR>> SECTIONS {<BR>> .vector : {<BR>> /*<BR>> * BSP: Start of vector section<BR>> */<BR>> bsp_section_vector_start = .;<BR>> <BR>> /*<BR>> * BSP: Reserve space for the exception vector table and<BR>> * the pointers to the default exceptions handlers.<BR>> */<BR>> . = . + 64;<BR>> <BR>> . = ALIGN (bsp_section_align);<BR>> <BR>> /*<BR>> * BSP: End of vector section<BR>> */<BR>> bsp_section_vector_end = .;<BR>> } > RAM_INT<BR>> <BR>> .text : {<BR>> /*<BR>> * BSP: Start of text section<BR>> */<BR>> bsp_section_text_start = .;<BR>> <BR>> /*<BR>> * BSP: System startup entry<BR>> */<BR>> KEEP (*(.entry))<BR>> <BR>> /*<BR>> * BSP: Moved into .text from .init<BR>> */<BR>> KEEP (*(.init))<BR>> <BR>> *(.text .stub .text.* .gnu.linkonce.t.*)<BR>> KEEP (*(.text.*personality*))<BR>> /* .gnu.warning sections are handled specially by elf32.em. */<BR>> *(.gnu.warning)<BR>> <BR>> /*<BR>> * BSP: Magic ARM stuff<BR>> */<BR>> *(.ARM.*)<BR>> *(.glue_7)<BR>> *(.glue_7t)<BR>> *(.vfp11_veneer)<BR>> <BR>> /*<BR>> * BSP: Special FreeBSD sysctl sections<BR>> */<BR>> . = ALIGN (16);<BR>> __start_set_sysctl_set = .;<BR>> *(set_sysctl_*);<BR>> __stop_set_sysctl_set = ABSOLUTE(.);<BR>> *(set_domain_*);<BR>> *(set_pseudo_*);<BR>> <BR>> /*<BR>> * BSP: Moved into .text from .*<BR>> */<BR>> *(.rodata .rodata.* .gnu.linkonce.r.*)<BR>> *(.rodata1)<BR>> *(.eh_frame_hdr)<BR>> <BR>> /*<BR>> * BSP: Required by cpukit/score/src/threadhandler.c<BR>> */<BR>> PROVIDE (_fini = .);<BR>> <BR>> /*<BR>> * BSP: Moved into .text from .fini<BR>> */<BR>> KEEP (*(.fini))<BR>> <BR>> . = ALIGN (bsp_section_align);<BR>> <BR>> /*<BR>> * BSP: End of text section<BR>> */<BR>> bsp_section_text_end = .;<BR>> } > RAM_EXT<BR>> <BR>> .data : {<BR>> /*<BR>> * BSP: Start of data section<BR>> */<BR>> bsp_section_data_start = .;<BR>> <BR>> /*<BR>> * BSP: Moved into .data from .ctors<BR>> */<BR>> /* gcc uses crtbegin.o to find the start of<BR>> the constructors, so we make sure it is<BR>> first. Because this is a wildcard, it<BR>> doesn't matter if the user does not<BR>> actually link against crtbegin.o; the<BR>> linker won't look for a file to match a<BR>> wildcard. The wildcard also means that it<BR>> doesn't matter which directory crtbegin.o<BR>> is in. */<BR>> KEEP (*crtbegin.o(.ctors))<BR>> KEEP (*crtbegin?.o(.ctors))<BR>> /* We don't want to include the .ctor section from<BR>> the crtend.o file until after the sorted ctors.<BR>> The .ctor section from the crtend file contains the<BR>> end of ctors marker and it must be last */<BR>> KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))<BR>> KEEP (*(SORT(.ctors.*)))<BR>> KEEP (*(.ctors))<BR>> <BR>> /*<BR>> * BSP: Moved into .data from .dtors<BR>> */<BR>> KEEP (*crtbegin.o(.dtors))<BR>> KEEP (*crtbegin?.o(.dtors))<BR>> KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))<BR>> KEEP (*(SORT(.dtors.*)))<BR>> KEEP (*(.dtors))<BR>> <BR>> /*<BR>> * BSP: Moved into .data from .*<BR>> */<BR>> *(.data1)<BR>> KEEP (*(.eh_frame))<BR>> *(.gcc_except_table .gcc_except_table.*)<BR>> KEEP (*(.jcr))<BR>> <BR>> *(.data .data.* .gnu.linkonce.d.*)<BR>> KEEP (*(.gnu.linkonce.d.*personality*))<BR>> SORT(CONSTRUCTORS)<BR>> <BR>> . = ALIGN (bsp_section_align);<BR>> <BR>> /*<BR>> * BSP: End of data section<BR>> */<BR>> bsp_section_data_end = .;<BR>> } > RAM_EXT<BR>> <BR>> .bss : {<BR>> /*<BR>> * BSP: Start of bss section<BR>> */<BR>> bsp_section_bss_start = .;<BR>> <BR>> *(COMMON)<BR>> *(.dynbss)<BR>> *(.bss .bss.* .gnu.linkonce.b.*)<BR>> <BR>> . = ALIGN (bsp_section_align);<BR>> <BR>> /*<BR>> * BSP: End of bss section<BR>> */<BR>> bsp_section_bss_end = .;<BR>> } > RAM_EXT<BR>> <BR>> .stack : {<BR>> /*<BR>> * BSP: Start of stack section<BR>> */<BR>> bsp_section_stack_start = .;<BR>> <BR>> . = ALIGN (bsp_stack_align);<BR>> bsp_stack_abt_start = .;<BR>> . = . + bsp_stack_abt_size;<BR>> <BR>> . = ALIGN (bsp_stack_align);<BR>> bsp_stack_fiq_start = .;<BR>> . = . + bsp_stack_fiq_size;<BR>> <BR>> . = ALIGN (bsp_stack_align);<BR>> bsp_stack_irq_start = .;<BR>> . = . + bsp_stack_irq_size;<BR>> <BR>> . = ALIGN (bsp_stack_align);<BR>> bsp_stack_svc_start = .;<BR>> . = . + bsp_stack_svc_size;<BR>> <BR>> . = ALIGN (bsp_stack_align);<BR>> bsp_stack_undef_start = .;<BR>> . = . + bsp_stack_undef_size;<BR>> <BR>> . = ALIGN (bsp_section_align);<BR>> <BR>> /*<BR>> * BSP: End of stack section<BR>> */<BR>> bsp_section_stack_end = .;<BR>> } > RAM_INT<BR>> <BR>> .work_area : {<BR>> /*<BR>> * BSP: Start of work area. The work area will occupy the remaining<BR>> * RAM_EXT region and contains the RTEMS work space and heap. We <BR>> cannot<BR>> * assign the region end directly since this leads to a region full<BR>> * warning.<BR>> */<BR>> bsp_work_area_start = .;<BR>> <BR>> . = bsp_ram_ext_end - 4;<BR>> <BR>> . = ALIGN (bsp_section_align);<BR>> <BR>> /*<BR>> * BSP: End of work area<BR>> */<BR>> bsp_work_area_end = .;<BR>> } > RAM_EXT<BR>> <BR>> bsp_section_vector_size = bsp_section_vector_end - <BR>> bsp_section_vector_start;<BR>> <BR>> bsp_section_text_size = bsp_section_text_end - bsp_section_text_start;<BR>> <BR>> bsp_section_data_size = bsp_section_data_end - bsp_section_data_start;<BR>> <BR>> bsp_section_bss_size = bsp_section_bss_end - bsp_section_bss_start;<BR>> <BR>> bsp_section_stack_size = bsp_section_stack_end - bsp_section_stack_start;<BR>> <BR>> bsp_work_area_size = bsp_work_area_end - bsp_work_area_start;<BR>> <BR>> /* Stabs debugging sections. */<BR>> .stab 0 : { *(.stab) }<BR>> .stabstr 0 : { *(.stabstr) }<BR>> .stab.excl 0 : { *(.stab.excl) }<BR>> .stab.exclstr 0 : { *(.stab.exclstr) }<BR>> .stab.index 0 : { *(.stab.index) }<BR>> .stab.indexstr 0 : { *(.stab.indexstr) }<BR>> .comment 0 : { *(.comment) }<BR>> /* DWARF debug sections.<BR>> Symbols in the DWARF debugging sections are relative to the beginning<BR>> of the section so we begin them at 0. */<BR>> /* DWARF 1 */<BR>> .debug 0 : { *(.debug) }<BR>> .line 0 : { *(.line) }<BR>> /* GNU DWARF 1 extensions */<BR>> .debug_srcinfo 0 : { *(.debug_srcinfo) }<BR>> .debug_sfnames 0 : { *(.debug_sfnames) }<BR>> /* DWARF 1.1 and DWARF 2 */<BR>> .debug_aranges 0 : { *(.debug_aranges) }<BR>> .debug_pubnames 0 : { *(.debug_pubnames) }<BR>> /* DWARF 2 */<BR>> .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }<BR>> .debug_abbrev 0 : { *(.debug_abbrev) }<BR>> .debug_line 0 : { *(.debug_line) }<BR>> .debug_frame 0 : { *(.debug_frame) }<BR>> .debug_str 0 : { *(.debug_str) }<BR>> .debug_loc 0 : { *(.debug_loc) }<BR>> .debug_macinfo 0 : { *(.debug_macinfo) }<BR>> /* SGI/MIPS DWARF 2 extensions */<BR>> .debug_weaknames 0 : { *(.debug_weaknames) }<BR>> .debug_funcnames 0 : { *(.debug_funcnames) }<BR>> .debug_typenames 0 : { *(.debug_typenames) }<BR>> .debug_varnames 0 : { *(.debug_varnames) }<BR>> /* DWARF 3 */<BR>> .debug_pubtypes 0 : { *(.debug_pubtypes) }<BR>> .debug_ranges 0 : { *(.debug_ranges) }<BR>> .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }<BR>> <BR>> /DISCARD/ : {<BR>> *(.note.GNU-stack) *(.gnu_debuglink)<BR>> }<BR>> <BR>> /*<BR>> * BSP: Catch all unknown sections<BR>> */<BR>> .nirvana : {<BR>> *(*)<BR>> } > NIRVANA<BR>> }<BR>> <BR>> -- <BR>> Sebastian Huber, Embedded Brains GmbH<BR>> <BR>> Address : Obere Lagerstr. 30, D-82178 Puchheim, Germany<BR>> Phone : +49 89 18 90 80 79-6<BR>> Fax : +49 89 18 90 80 79-9<BR>> E-Mail : sebastian.huber@embedded-brains.de<BR>> PGP : Public key available on request<BR>> <BR>> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.<BR>> _______________________________________________<BR>> rtems-users mailing list<BR>> rtems-users@rtems.com<BR>> http://rtems.rtems.org/mailman/listinfo/rtems-users<BR><BR><br /><hr />Get more out of the Web. Learn 10 hidden secrets of Windows Live. <a href='http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-cns!550F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_getmore_092008' target='_new'>Learn Now</a></body>
</html>