Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Sep 2000 09:41:01 -0700
From:      Peter Wemm <peter@netplex.com.au>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        Matthew Jacob <mjacob@feral.com>, "Matthew N. Dodd" <mdodd@FreeBSD.org>, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/kern subr_bus.c 
Message-ID:  <200009181641.e8IGf1G25853@netplex.com.au>
In-Reply-To: <Pine.BSF.4.21.0009190145470.17074-100000@besplex.bde.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
Bruce Evans wrote:
> On Mon, 18 Sep 2000, Matthew Jacob wrote:
> 
> > Yeah, I wondered about that too. I thought
> > 
> > int foo;
> > 
> > and
> > 
> > int foo=0;
> > 
> > were supposed to be the same. Is the kernel now forgetting to clear bss?
> 
> Same for the C abstract machine, which we mostly depend on in the
> kernel (although the kernel is not entirely implementable in C).  Of
> course, it is an implementation detail that the explicit initialization
> puts the variable in the data section instead of in the bss, at least
> for gcc on i386's.
> 
> The bss clearing code hasn't changed for years on  i386's.  I can't see
> where the bss is cleared on alphas (alpha_init is called very early
> in locore.s).

BSS is pre-zeroed by the loader.
src/sys/boot/common/load_elf.c and load_aout.c

Cheers,
-Peter
--
Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au
"All of this is for nothing if we don't go to the stars" - JMS/B5



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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200009181641.e8IGf1G25853>