Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Dec 1999 07:58:30 +1100
From:      Peter Jeremy <jeremyp@gsmx07.alcatel.com.au>
To:        Zhihui Zhang <zzhang@cs.binghamton.edu>
Cc:        David Gilbert <dgilbert@velocet.ca>, freebsd-stable@FreeBSD.ORG
Subject:   Re: stack up or stack down.
Message-ID:  <99Dec1.075113est.40322@border.alcanet.com.au>
In-Reply-To: <Pine.GSO.3.96.991130132615.730A-100000@sol.cs.binghamton.edu>
References:  <14404.5187.497998.940864@trooper.velocet.net> <Pine.GSO.3.96.991130132615.730A-100000@sol.cs.binghamton.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On 1999-Dec-01 05:31:23 +1100, Zhihui Zhang wrote:
>On Tue, 30 Nov 1999, David Gilbert wrote:
>>  To that end, does the kernel
>> stack build up (from low to high addresses) or down (high to low
>> addresses) in FreeBSD?
>
>This is a question determined by the Intel hardware, not by FreeBSD. So it
>should grow downwards (to lower addresses).  Wait, it may depend on how
>an OS like FreeBSD sets the stack segment attributes...  I'd like to know
>the answer.

On i386, it always goes high to low - this is hard-wired into the
stack manipulating instructions.  The segment attributes just select
between `normal' and `stack' segments - the difference being how the
base/limit is calculated (it's easy to extend a normal segment towards
higher addresses and a stack segment towards lower addresses).

On the Alpha, there is no hardware support for a stack, so the stack
growth direction is determined by the OS and development tools.
(Though I think all Alpha systems use high-to-low stacks).

Peter


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?99Dec1.075113est.40322>