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]

Re: eCOS/Redboot memory requirements


On Wed, 2003-04-02 at 11:29, Uwe Kindler wrote:
> Hello,
> 
> I have a question about the memory requirements of eCOS and Redboot.
> I ported eCOS for the Hitachi H8S 2357. This controller has 128 KByte ROM
> and 8 KByte internal RAM - there is no external RAM on the board I use.
> 
> Now i would like to build Redboot but I get a linker error because the
> data + bss sections are larger than 8 KByte and do not fit into RAM.
> Here is the error message:
> 
> h8300-elf/bin/ld: address 0x1000790 of
> /ecos-d/CodingXP/cygwin/opt/ecos/ecos-work/h8sredboot2_install/bin/redboot.e
> lf section .bss is not within region ram
> 
> If I change the the RAM size within *.ldi *.mlt file from 8 KByte to 16
> KByte then the build process finishes successfull. The data section is not
> very large but the bss section requires about 9 KByte.
> 
> Here is a memory map of bss part of  the redboot.elf file -
> i marked the lines wich require a lot of space:
> 
> 00ffe33c A ___bss_start
> 00ffe33c A ___CTOR_END__
> 00ffe33c A ___DTOR_END__
> 00ffe33c A ___DTOR_LIST__
> 00ffe33c A ___ram_data_end
> 00ffe33c A __edata
> 00ffe33c A __GOT_END_
> 00ffe33c A __GOT_START
> 00ffe33c A __SDA_BASE_
> 00ffe33c B __intvector
> 00ffe340 b __interrupt_stack_base
> 00ffe340 B _cyg_interrupt_stack_base       <--- 1024 Bytes
> 00ffe740 b __interrupt_stack
> 00ffe740 B _cyg_interrupt_stack
> 00ffe760 b _xyz                                         <--- 1076 Bytes

You can trim this some.  In the file .../redboot/current/src/xyzmodem.c
The problem is that input packets from the Xmodem/Ymodem protocol can be
up to 1024 bytes.

> 00ffeb94 b __base___0
> 00ffeb98 b __len___1
> 00ffeb9c b _buf___0

You might try and find this buffer - another 512 bytes which
might be smaller.

> 00ffed2c b _hexMemCount
> 00ffed30 b _hexMemSrc
> 00ffed34 b _hexMemDst
> 00ffed38 b _may_fault_mode

> 00ffed3c b _program_argv
> 00ffed8c b _program_argc
> 00ffed90 b _last_program_arg
> 00ffed94 b _program_argstr

I just checked in a change which will make these vanish (they're
unused).

> 00ffee14 b _argptr
> 00ffee18 b _crc32_table                        <--- 1024 Bytes

This is used by the Xmodem/Ymodem

> 00fff218 b _thread___0
> 00fff220 b _lastthread___1
> 00fff228 b _nextthread___2
> 00fff230 b _break_buffer
> 00fff238 b _memCount
> 00fff23c b _dbg_syscall_ptr
> 00fff240 b _tcall
> 00fff24c b _comm_channels
> 00fff2cc b ___mangler_line
> 00fff330 b _cyg_dummy_diag_init_obj
> 00fff334 b _line___0

Another input line buffer - maybe could be smaller.

> 00fff434 b __base___1
> 00fff438 b __len___2
> 00fff43c b _go_saved_context
> 00fff440 b _go_return_status
> 00fff444 b __cl_lines___1                       <--- 4096 Bytes

This can be easily adjusted via CDL.  Look at 
CYGNUM_REDBOOT_CMD_LINE_EDITING.  If you make it 1, you'll
still enable command line editing, even if there is no history.

> 01000444 b __mon_timeout
> 01000448 b _asyncBuffer
> 01000450 b _break_mem_data
> 01000454 b _channels
> 01000478 B _getc_info
> 0100059c B ___remcomInBuffer
> 0100060c B ___remcomOutBuffer
> 0100067c B ___disable_interrupts_hook
> 01000680 B __get_trace_register_hook
> 01000684 B __gdb_general_thread
> 01000688 B __gdb_cont_thread
> 0100068c B _cyg_hal_gdb_break
> 01000690 B __hal_registers
> 01000694 B _registers
> 010006bc B _alt_registers
> 010006e4 B _orig_registers
> 0100070c B _hal_saved_interrupt_state
> 01000710 B __cyg_hal_compiler_dummy
> 01000714 B _argv
> 01000754 B _workspace_start
> 01000758 B _workspace_size
> 0100075c B _entry_address
> 01000760 B _load_address_end
> 01000764 B _console_selected
> 01000768 B _ram_start
> 0100076c B _cmd_history
> 01000770 B _gdb_active
> 01000774 B _user_ram_end
> 01000778 B _load_address
> 0100077c B _ram_end
> 01000780 B _user_ram_start
> 01000784 B _workspace_end
> 01000788 B _argc
> 0100078c B _console_echo
> 01000790 A ___bss_end
> 01000790 A __heap1
> 02003f3c D __GLOBAL_OFFSET_TABLE_
> 
> Are there any hints to minimize the RAM memory requirements. I already
> move the virtual vector table into ROM. Are there any experiences with eCOS
> and
> a small RAM memory?

It's really tough - functionality simply costs memory.
-- 
.--------------------------------------------------------.
|       Mind: Embedded Linux and eCos Development        |
|--------------------------------------------------------|
| Gary Thomas              email:  gary dot thomas at mind dot be   |
| Mind ( http://mind.be )  tel:    +1 (970) 229-1963     |
| gpg: http://www.chez-thomas.org/gary/gpg_key.asc       |
'--------------------------------------------------------'


-- 
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]