This is the mail archive of the ecos-devel@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]

malloc problem.


Hi,
I have a simple program that just malloc some memory.

Following are the steps I do 

 1. ecosconfig new leon
 2. configtool 
 3. Verify  under dynamic memory allocation node 
everything is turn on.(Using Doug lea's malloc)
 4. Compile my application code with ecos kernel
library. In my application code I malloc some memory
and printf "Hello world ". 

Now my system just crashes when I do "printf". However
if I dont use malloc. My program is fine.

I used gdb to debug it further, I found "printf"
crashs while doing some memcpy. 

I looked at the mem map files. It looked fine. I am
not sure where to look now. Here are my configuration
files.
 
FileName :mtl_sparc_leon_ram.ldi 
================================
#include <cyg/infra/cyg_type.inc>

MEMORY
{
    ram : ORIGIN = 0x40000000, LENGTH = 0x80000
}

SECTIONS
{
    SECTIONS_BEGIN
    SECTION_rom_vectors (ram, 0x40000000, LMA_EQ_VMA)
    SECTION_text (ram, ALIGN (0x1), LMA_EQ_VMA)
    SECTION_fini (ram, ALIGN (0x1), LMA_EQ_VMA)
    SECTION_rodata (ram, ALIGN (0x1), LMA_EQ_VMA)
    SECTION_rodata1 (ram, ALIGN (0x1), LMA_EQ_VMA)
    SECTION_fixup (ram, ALIGN (0x1), LMA_EQ_VMA)
    SECTION_gcc_except_table (ram, ALIGN (0x1),
LMA_EQ_VMA)
    SECTION_data (ram, ALIGN (0x1), LMA_EQ_VMA)
    SECTION_bss (ram, ALIGN (0x8), LMA_EQ_VMA)
    CYG_LABEL_DEFN(__heap1) = ALIGN (0x8);
    SECTIONS_END
}


File Name:mlt_sparc_leon_ram.h 
==============================
#ifndef __ASSEMBLER__
#include <cyg/infra/cyg_type.h>
#include <stddef.h>

#endif
#define CYGMEM_REGION_ram (0x40000000)
#define CYGMEM_REGION_ram_SIZE (0x80000)
#define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R |
CYGMEM_REGION_ATTR_W)
#ifndef __ASSEMBLER__
extern char CYG_LABEL_NAME (__heap1) [];
#endif
#define CYGMEM_SECTION_heap1 (CYG_LABEL_NAME
(__heap1))
#define CYGMEM_SECTION_heap1_SIZE (0x40080000 -
(size_t) CYG_LABEL_NAME (__heap1))

#define CYGHWR_HAL_SPARC_MULTIPLE_VECTOR_TRAPPING


           Hadi 
          


 

__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com


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