From owner-freebsd-hackers Thu Jan 11 11:54:40 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from wall.polstra.com (rtrwan160.accessone.com [206.213.115.74]) by hub.freebsd.org (Postfix) with ESMTP id 21D5637B400 for ; Thu, 11 Jan 2001 11:54:20 -0800 (PST) Received: from vashon.polstra.com (vashon.polstra.com [206.213.73.13]) by wall.polstra.com (8.9.3/8.9.3) with ESMTP id LAA27319; Thu, 11 Jan 2001 11:54:07 -0800 (PST) (envelope-from jdp@wall.polstra.com) Received: (from jdp@localhost) by vashon.polstra.com (8.11.1/8.11.0) id f0BJs6T10330; Thu, 11 Jan 2001 11:54:06 -0800 (PST) (envelope-from jdp) Date: Thu, 11 Jan 2001 11:54:06 -0800 (PST) Message-Id: <200101111954.f0BJs6T10330@vashon.polstra.com> To: hackers@freebsd.org From: John Polstra Reply-To: hackers@freebsd.org Cc: zzhang@cs.binghamton.edu Subject: Re: Process virtual memory question In-Reply-To: References: Organization: Polstra & Co., Seattle, WA Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In article , Zhiui Zhang wrote: > > 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. Right. Address 0 is not mapped writable in FreeBSD. > 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. Yes, I think you are right, now that my memory is returning. :-) In SVR4 the stack grew downwards from 0x8000000. I think that libc and the dynamic linker (all together in one shared library) were mapped between 0x8000000 and 0x8048000. But that is just a guess. Most modern libcs wouldn't fit in that amount of space these days. John -- John Polstra jdp@polstra.com John D. Polstra & Co., Inc. Seattle, Washington USA "Disappointment is a good sign of basic intelligence." -- Chögyam Trungpa To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message