public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* RE: [ECOS] Separate the heap from bss section
@ 2001-05-13 18:23 Ho Shui Choy Stanley PS03B NCS
  2001-05-13 19:33 ` Jonathan Larmour
  2001-05-13 19:57 ` Lewin A.R.W. Edwards
  0 siblings, 2 replies; 11+ messages in thread
From: Ho Shui Choy Stanley PS03B NCS @ 2001-05-13 18:23 UTC (permalink / raw)
  To: 'Jonathan Larmour'; +Cc: Ecos-Discuss (E-mail)

I have found out that when the heap section is defined in the same memory
region with bss section, then only it will use the specify heap. When the
bss section and the heap is defined in different memory region, the heap
count will be 0. Why is this so? Is it a known bug?

Stanley

-----Original Message-----
From: Jonathan Larmour [ mailto:jlarmour@redhat.com ]
Sent: Friday, May 11, 2001 13:50
To: Ho Shui Choy Stanley PS03B NCS
Cc: Ecos-Discuss (E-mail)
Subject: Re: [ECOS] Separate the heap from bss section


Ho Shui Choy Stanley PS03B NCS wrote:
> 
> I have done that but it is still not used. I have specify that the heap
size
> be 128KB and the fall back memory pool size is 64KB. When I use the
> mallinfo, it reported that the size was only 64KB.
> 
> below is from the generated from the build in pkgconf/heaps.hxx
> 
[snip]
> #define CYGMEM_HEAP_COUNT 0
[snip]
> Should the heap count be 1 instead of 0?

Yes, but changing it by hand won't do the right thing. Try deleting the
heaps.cxx file in the services/memalloc/common/current build directory. The
problem you are seeing may be associated with this FIXME in the CDL:

       # FIXME this should have a dependency on mlt_headers, but CDL
doesn't
        # permit custom build rules depending on phony targets
 

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [ECOS] Separate the heap from bss section
  2001-05-13 18:23 [ECOS] Separate the heap from bss section Ho Shui Choy Stanley PS03B NCS
@ 2001-05-13 19:33 ` Jonathan Larmour
  2001-05-13 19:57 ` Lewin A.R.W. Edwards
  1 sibling, 0 replies; 11+ messages in thread
From: Jonathan Larmour @ 2001-05-13 19:33 UTC (permalink / raw)
  To: Ho Shui Choy Stanley PS03B NCS; +Cc: Ecos-Discuss (E-mail)

Ho Shui Choy Stanley PS03B NCS wrote:
> 
> I have found out that when the heap section is defined in the same memory
> region with bss section, then only it will use the specify heap. When the
> bss section and the heap is defined in different memory region, the heap
> count will be 0. Why is this so? Is it a known bug?

By memory region, you mean something like "ram" and "sdram" lines in the
MLT or similar? If it is a bug, it's not a known one. Can you send the MLT
.ldi file in the failing case?

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [ECOS] Separate the heap from bss section
  2001-05-13 18:23 [ECOS] Separate the heap from bss section Ho Shui Choy Stanley PS03B NCS
  2001-05-13 19:33 ` Jonathan Larmour
@ 2001-05-13 19:57 ` Lewin A.R.W. Edwards
  1 sibling, 0 replies; 11+ messages in thread
From: Lewin A.R.W. Edwards @ 2001-05-13 19:57 UTC (permalink / raw)
  To: Ho Shui Choy Stanley PS03B NCS; +Cc: Ecos-Discuss (E-mail)

>I have found out that when the heap section is defined in the same memory
>region with bss section, then only it will use the specify heap. When the

Hi Stanley,

In working with the EB40 (not eCos) I have found a strange condition where 
symbols imported from the linker script sometimes don't get the right 
address. I haven't been able to isolate this problem yet, nor have I tested 
with a newer snapshot of binutils (currently working with 2.10).

(well, to be accurate: in any linker script I've handwritten, the function 
hasn't worked right. Only with other peoples' code does it seem to work 
correctly, and I haven't been able to work out the difference yet).

Anyway, I think it likely you're getting a similar problem. The symbol 
marking end of BSS is getting the same address as the start of BSS, which 
is exactly the problem I have in my handwritten linker scripts.

=== Lewin A.R.W. Edwards (Embedded Engineer)
Work: http://www.digi-frame.com/
Personal: http://www.zws.com/ and http://www.larwe.com/

"... a man who is endowed with real qualities of leadership will be tempted 
to refrain from taking part in political life; because [...] the situation 
does not call for a man who has a capacity for constructive statesmanship 
but rather for a man who is capable of bargaining for the favour of the 
majority. Thus the situation will appeal to small minds and will attract 
them accordingly."

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [ECOS] Separate the heap from bss section
  2001-05-13 20:41 Ho Shui Choy Stanley PS03B NCS
@ 2001-05-15  6:03 ` Jonathan Larmour
  0 siblings, 0 replies; 11+ messages in thread
From: Jonathan Larmour @ 2001-05-15  6:03 UTC (permalink / raw)
  To: Ho Shui Choy Stanley PS03B NCS; +Cc: Ecos-Discuss (E-mail)

Ho Shui Choy Stanley PS03B NCS wrote:
> 
> Where can I get the binary file to run on Win NT?

That page! The section "Updated configuration tools for Windows".

Jifl
 
> -----Original Message-----
> From: Jonathan Larmour [ mailto:jlarmour@redhat.com ]
> Sent: Monday, May 14, 2001 11:26
> To: Ho Shui Choy Stanley PS03B NCS
> Cc: Ecos-Discuss (E-mail)
> Subject: Re: [ECOS] Separate the heap from bss section
> 
> Ho Shui Choy Stanley PS03B NCS wrote:
> >
> > here is the files requested.
> 
> Your configuration tool is not the current version appropriate for the
> current anon CVS repository. I'm surprised it works at all! Get a new one
> from http://sources.redhat.com/ecos/anoncvs.html


-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [ECOS] Separate the heap from bss section
@ 2001-05-13 20:41 Ho Shui Choy Stanley PS03B NCS
  2001-05-15  6:03 ` Jonathan Larmour
  0 siblings, 1 reply; 11+ messages in thread
From: Ho Shui Choy Stanley PS03B NCS @ 2001-05-13 20:41 UTC (permalink / raw)
  To: 'Jonathan Larmour'; +Cc: Ecos-Discuss (E-mail)

Where can I get the binary file to run on Win NT?

-----Original Message-----
From: Jonathan Larmour [ mailto:jlarmour@redhat.com ]
Sent: Monday, May 14, 2001 11:26
To: Ho Shui Choy Stanley PS03B NCS
Cc: Ecos-Discuss (E-mail)
Subject: Re: [ECOS] Separate the heap from bss section


Ho Shui Choy Stanley PS03B NCS wrote:
> 
> here is the files requested.

Your configuration tool is not the current version appropriate for the
current anon CVS repository. I'm surprised it works at all! Get a new one
from http://sources.redhat.com/ecos/anoncvs.html

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [ECOS] Separate the heap from bss section
  2001-05-13 19:54 Ho Shui Choy Stanley PS03B NCS
@ 2001-05-13 20:25 ` Jonathan Larmour
  0 siblings, 0 replies; 11+ messages in thread
From: Jonathan Larmour @ 2001-05-13 20:25 UTC (permalink / raw)
  To: Ho Shui Choy Stanley PS03B NCS; +Cc: Ecos-Discuss (E-mail)

Ho Shui Choy Stanley PS03B NCS wrote:
> 
> here is the files requested.

Your configuration tool is not the current version appropriate for the
current anon CVS repository. I'm surprised it works at all! Get a new one
from http://sources.redhat.com/ecos/anoncvs.html

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [ECOS] Separate the heap from bss section
@ 2001-05-13 19:54 Ho Shui Choy Stanley PS03B NCS
  2001-05-13 20:25 ` Jonathan Larmour
  0 siblings, 1 reply; 11+ messages in thread
From: Ho Shui Choy Stanley PS03B NCS @ 2001-05-13 19:54 UTC (permalink / raw)
  To: 'Jonathan Larmour'; +Cc: Ecos-Discuss (E-mail)

[-- Attachment #1: Type: text/plain, Size: 925 bytes --]

here is the files requested.

-----Original Message-----
From: Jonathan Larmour [ mailto:jlarmour@redhat.com ]
Sent: Monday, May 14, 2001 10:34
To: Ho Shui Choy Stanley PS03B NCS
Cc: Ecos-Discuss (E-mail)
Subject: Re: [ECOS] Separate the heap from bss section


Ho Shui Choy Stanley PS03B NCS wrote:
> 
> I have found out that when the heap section is defined in the same memory
> region with bss section, then only it will use the specify heap. When the
> bss section and the heap is defined in different memory region, the heap
> count will be 0. Why is this so? Is it a known bug?

By memory region, you mean something like "ram" and "sdram" lines in the
MLT or similar? If it is a bug, it's not a known one. Can you send the MLT
.ldi file in the failing case?

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine


[-- Attachment #2: mlt_arm_eb01_rom.h --]
[-- Type: text/x-c, Size: 769 bytes --]

// eCos memory layout - Mon May 14 10:42:18 2001

// This is a generated file - do not edit

#include <cyg/infra/cyg_type.h>
#include <stddef.h>

#define CYGMEM_REGION_sram (0x100000)
#define CYGMEM_REGION_sram_SIZE (0x20000)
#define CYGMEM_REGION_sram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)
#define CYGMEM_REGION_rom (0x1010000)
#define CYGMEM_REGION_rom_SIZE (0x10000)
#define CYGMEM_REGION_rom_ATTR (CYGMEM_REGION_ATTR_R)
#define CYGMEM_REGION_ram (0x2000000)
#define CYGMEM_REGION_ram_SIZE (0x80000)
#define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)
extern char CYG_LABEL_NAME (_heap1) [];
#define CYGMEM_SECTION_heap1 (CYG_LABEL_NAME (_heap1))
#define CYGMEM_SECTION_heap1_SIZE (0x2080000 - (size_t) CYG_LABEL_NAME (_heap1))

[-- Attachment #3: mlt_arm_eb01_rom.ldi --]
[-- Type: text/plain, Size: 847 bytes --]

// eCos memory layout - Mon May 14 10:42:18 2001

// This is a generated file - do not edit

MEMORY
{
    sram : ORIGIN = 0x100000, LENGTH = 0x20000
    rom : ORIGIN = 0x1010000, LENGTH = 0x10000
    ram : ORIGIN = 0x2000000, LENGTH = 0x80000
}

SECTIONS
{
    SECTIONS_BEGIN
    SECTION_rom_vectors (rom, 0x1010000, LMA_EQ_VMA)
    SECTION_text (rom, ALIGN (0x4), LMA_EQ_VMA)
    SECTION_fini (rom, ALIGN (0x4), LMA_EQ_VMA)
    SECTION_rodata (rom, ALIGN (0x4), LMA_EQ_VMA)
    SECTION_rodata1 (rom, ALIGN (0x4), LMA_EQ_VMA)
    SECTION_fixup (rom, ALIGN (0x4), LMA_EQ_VMA)
    SECTION_gcc_except_table (rom, ALIGN (0x4), LMA_EQ_VMA)
    SECTION_data (sram, 0x100000, FOLLOWING (.gcc_except_table))
    SECTION_bss (sram, ALIGN (0x4), LMA_EQ_VMA)
    SECTION_fixed_vectors (ram, 0x2000020, LMA_EQ_VMA)
    __heap1 = 0x2000800;
    SECTIONS_END
}

[-- Attachment #4: mlt_arm_eb01_rom.mlt --]
[-- Type: text/plain, Size: 632 bytes --]

version 0
region sram 100000 20000 0 !
region rom 1010000 10000 1 !
region ram 2000000 80000 0 !
section data 0 1 1 1 1 1 0 0 100000 bss !
section bss 0 4 0 1 0 0 0 0 !
section rom_vectors 0 1 0 1 1 1 1 1 1010000 1010000 text text !
section text 0 4 0 1 0 1 0 1 fini fini !
section fini 0 4 0 1 0 1 0 1 rodata rodata !
section rodata 0 4 0 1 0 1 0 1 rodata1 rodata1 !
section rodata1 0 4 0 1 0 1 0 1 fixup fixup !
section fixup 0 4 0 1 0 1 0 1 gcc_except_table gcc_except_table !
section gcc_except_table 0 4 0 1 0 0 0 1 data !
section fixed_vectors 0 1 0 1 1 0 1 0 2000020 2000020 !
section heap1 0 1 0 0 1 0 1 0 2000800 2000800 !

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [ECOS] Separate the heap from bss section
  2001-05-10 22:44 Ho Shui Choy Stanley PS03B NCS
@ 2001-05-10 22:49 ` Jonathan Larmour
  0 siblings, 0 replies; 11+ messages in thread
From: Jonathan Larmour @ 2001-05-10 22:49 UTC (permalink / raw)
  To: Ho Shui Choy Stanley PS03B NCS; +Cc: Ecos-Discuss (E-mail)

Ho Shui Choy Stanley PS03B NCS wrote:
> 
> I have done that but it is still not used. I have specify that the heap size
> be 128KB and the fall back memory pool size is 64KB. When I use the
> mallinfo, it reported that the size was only 64KB.
> 
> below is from the generated from the build in pkgconf/heaps.hxx
> 
[snip]
> #define CYGMEM_HEAP_COUNT 0
[snip]
> Should the heap count be 1 instead of 0?

Yes, but changing it by hand won't do the right thing. Try deleting the
heaps.cxx file in the services/memalloc/common/current build directory. The
problem you are seeing may be associated with this FIXME in the CDL:

       # FIXME this should have a dependency on mlt_headers, but CDL
doesn't
        # permit custom build rules depending on phony targets
 

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [ECOS] Separate the heap from bss section
@ 2001-05-10 22:44 Ho Shui Choy Stanley PS03B NCS
  2001-05-10 22:49 ` Jonathan Larmour
  0 siblings, 1 reply; 11+ messages in thread
From: Ho Shui Choy Stanley PS03B NCS @ 2001-05-10 22:44 UTC (permalink / raw)
  To: 'Jonathan Larmour'; +Cc: Ecos-Discuss (E-mail)

I have done that but it is still not used. I have specify that the heap size
be 128KB and the fall back memory pool size is 64KB. When I use the
mallinfo, it reported that the size was only 64KB.

below is from the generated from the build in pkgconf/heaps.hxx

#ifndef CYGONCE_PKGCONF_HEAPS_HXX
#define CYGONCE_PKGCONF_HEAPS_HXX
/* <pkgconf/heaps.hxx> */

/* This is a generated file - do not edit! */

#define CYGMEM_HEAP_COUNT 0
#include <cyg/memalloc/dlmalloc.hxx>

extern Cyg_Mempool_dlmalloc *cygmem_memalloc_heaps[ 1 ];

#endif
/* EOF <pkgconf/heaps.hxx> */

Should the heap count be 1 instead of 0?

Thanks
Stanley

-----Original Message-----
From: Jonathan Larmour [ mailto:jlarmour@redhat.com ]
Sent: Friday, May 11, 2001 12:57
To: Ho Shui Choy Stanley PS03B NCS
Cc: Ecos-Discuss (E-mail)
Subject: Re: [ECOS] Separate the heap from bss section


Ho Shui Choy Stanley PS03B NCS wrote:
> 
> In my memory layout,  I did not specify a section for my heap. So when I
> make my application, the heap is automatically appended to the bss
section.
> My bss section is currently residing in external RAM. I like to shift the
> bss section to internal RAM, but the heap section remains in external RAM.
> How do I seprate them?

Create a user defined section in the MLT named "heap1", located wherever
you want. Look at other standard targets for comparison if that helps.

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [ECOS] Separate the heap from bss section
  2001-05-10 19:28 Ho Shui Choy Stanley PS03B NCS
@ 2001-05-10 21:57 ` Jonathan Larmour
  0 siblings, 0 replies; 11+ messages in thread
From: Jonathan Larmour @ 2001-05-10 21:57 UTC (permalink / raw)
  To: Ho Shui Choy Stanley PS03B NCS; +Cc: Ecos-Discuss (E-mail)

Ho Shui Choy Stanley PS03B NCS wrote:
> 
> In my memory layout,  I did not specify a section for my heap. So when I
> make my application, the heap is automatically appended to the bss section.
> My bss section is currently residing in external RAM. I like to shift the
> bss section to internal RAM, but the heap section remains in external RAM.
> How do I seprate them?

Create a user defined section in the MLT named "heap1", located wherever
you want. Look at other standard targets for comparison if that helps.

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [ECOS] Separate the heap from bss section
@ 2001-05-10 19:28 Ho Shui Choy Stanley PS03B NCS
  2001-05-10 21:57 ` Jonathan Larmour
  0 siblings, 1 reply; 11+ messages in thread
From: Ho Shui Choy Stanley PS03B NCS @ 2001-05-10 19:28 UTC (permalink / raw)
  To: Ecos-Discuss (E-mail)

In my memory layout,  I did not specify a section for my heap. So when I
make my application, the heap is automatically appended to the bss section.
My bss section is currently residing in external RAM. I like to shift the
bss section to internal RAM, but the heap section remains in external RAM.
How do I seprate them?

Thanks
Stanley
> ____________________________
> This email (including all attachments) contains confidential information
> which may be privileged. It is intended solely for the identified
> recipient(s) to whom it is addressed. If you are not an intended
> recipient, please reply to us immediately and delete this message from
> your system. You may not copy or use it for any purpose, or otherwise
> disclose its contents to any person. 
> 

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2001-05-15  6:03 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-13 18:23 [ECOS] Separate the heap from bss section Ho Shui Choy Stanley PS03B NCS
2001-05-13 19:33 ` Jonathan Larmour
2001-05-13 19:57 ` Lewin A.R.W. Edwards
  -- strict thread matches above, loose matches on Subject: below --
2001-05-13 20:41 Ho Shui Choy Stanley PS03B NCS
2001-05-15  6:03 ` Jonathan Larmour
2001-05-13 19:54 Ho Shui Choy Stanley PS03B NCS
2001-05-13 20:25 ` Jonathan Larmour
2001-05-10 22:44 Ho Shui Choy Stanley PS03B NCS
2001-05-10 22:49 ` Jonathan Larmour
2001-05-10 19:28 Ho Shui Choy Stanley PS03B NCS
2001-05-10 21:57 ` Jonathan Larmour

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).