From owner-freebsd-hackers Thu Jan 11 18:43:44 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from reddog.yi.org (cg632877-a.adubn1.nj.home.com [24.12.124.217]) by hub.freebsd.org (Postfix) with ESMTP id 2A1E337B400 for ; Thu, 11 Jan 2001 18:43:27 -0800 (PST) Received: by reddog.yi.org (Postfix, from userid 1001) id CAD74D250; Thu, 11 Jan 2001 21:46:07 -0500 (EST) Date: Thu, 11 Jan 2001 21:46:07 -0500 From: spectre To: Zhiui Zhang Cc: John Polstra , hackers@freebsd.org Subject: Re: Process virtual memory question Message-ID: <20010111214607.A5230@reddog.yi.org> References: <200101111742.f0BHgMt10004@vashon.polstra.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Lime V3.141 In-Reply-To: ; from zzhang@cs.binghamton.edu on Thu, Jan 11, 2001 at 02:03:27PM -0500 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > Thanks. It just occurs to me that Linux kernel used to have something > like this in routine BUG(): > > * ((char *) 0) = 0; > > It is called when there is a kernel bug. So address 0 should not be > mapped writable, otherwise all C statements " char * p = NULL; * p = > value; " would be legal. > > The book "Unix Internals - A Practical Approach" by S.D. Pate has a figure > showing in ELF format, the stack lies BELOW the code segment and grows > downwards. This might have something to do with code starting from > 0x8048000. > Also remember that for CPUs with virtually indexed caches, base addresses for text, data, and stack matter a great deal. Perhaps this is a remanence? For reference, see: "UNIX Systems for Modern Architectures" by Curt Schimmel, chapter 7. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message