From owner-freebsd-stable Tue Nov 30 12:59: 2 1999 Delivered-To: freebsd-stable@freebsd.org Received: from alcanet.com.au (border.alcanet.com.au [203.62.196.10]) by hub.freebsd.org (Postfix) with ESMTP id EDAF115A4E for ; Tue, 30 Nov 1999 12:58:57 -0800 (PST) (envelope-from jeremyp@gsmx07.alcatel.com.au) Received: by border.alcanet.com.au id <40322>; Wed, 1 Dec 1999 07:51:13 +1100 Content-return: prohibited Date: Wed, 1 Dec 1999 07:58:30 +1100 From: Peter Jeremy Subject: Re: stack up or stack down. In-reply-to: To: Zhihui Zhang Cc: David Gilbert , freebsd-stable@FreeBSD.ORG Reply-To: peter.jeremy@alcatel.com.au Message-Id: <99Dec1.075113est.40322@border.alcanet.com.au> MIME-version: 1.0 X-Mailer: Mutt 1.0pre3i Content-type: text/plain; charset=us-ascii References: <14404.5187.497998.940864@trooper.velocet.net> Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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