This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Where is my stack ?! (for my i386)
- To: Fabrice Gautier <Fabrice_Gautier at sdesigns dot com>
- Subject: Re: [ECOS] Where is my stack ?! (for my i386)
- From: Jonathan Larmour <jlarmour at redhat dot com>
- Date: Fri, 20 Oct 2000 03:19:36 +0100
- CC: "Ecos-List (E-mail)" <ecos-discuss at sourceware dot cygnus dot com>
- Organization: Red Hat UK Ltd.
- References: <5AF611D83988D4118ACF00E0B10400540557D8@mr-intranet.sdesigns.net>
Fabrice Gautier wrote:
>
> Hi,
>
> Where does the startup stack, the one used by cyg_start, is supposed to be ?
>
> In the i386, it is located just in front of the startup code, and this is
> very bad. At least i think the stack should be in a defined area of the
> memory map and not in the void... Just where I was trying to put the idt,
> the vsr table and the virtual vector tables.
It's the startup stack. It's meant to exist very transiently and then get
zapped. It's size should be configurable, but it's no big deal if it is
discarded later. On some archs the interrupt stack is used as the startup
stack.
But it's certainly a bad place to put tables that you intend to stick
around.
> How is this done in the other arch ? Where is the stack located ?
Well, certainly in front of the startup code seems an unwise place. It
should be a fixed location in memory, which may later be reused. Why don't
you just look at the other archs?
> And is there any way to detect a stack overflow when it happens ?
Generally no, but I believe the x86 can be setup to do this?
Jifl
--
Red Hat, 35 Cambridge Place, Cambridge, UK. CB2 1NS Tel: +44 (1223) 728762
"Plan to be spontaneous tomorrow." || These opinions are all my own fault