linux-mips
[Top] [All Lists]

Re: kernel/printk.c problem

To: Jun Sun <jsun@mvista.com>
Subject: Re: kernel/printk.c problem
From: Juan Quintela <quintela@mandrakesoft.com>
Date: 18 Apr 2001 20:28:42 +0200
Cc: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>, Scott A McConnell <samcconn@cotw.com>, linux-mips@oss.sgi.com
In-reply-to: <3ADDCFAB.549DA4FA@mvista.com>
References: <Pine.GSO.4.10.10104180852450.17832-100000@escobaria.sonytel.be> <3ADDCFAB.549DA4FA@mvista.com>
Sender: owner-linux-mips@oss.sgi.com
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7
>>>>> "jun" == Jun Sun <jsun@mvista.com> writes:

jun> Geert Uytterhoeven wrote:
>> 
>> On Tue, 17 Apr 2001, Scott A McConnell wrote:
>> > struct console *console_drivers = NULL;                          <----
>> > Need the NULL.
>> >
>> > Otherwise, bad things can happen on the following statement in printk
>> >
>> > ~line 311
>> >
>> >        if ((c->flags & CON_ENABLED) && c->write){
>> 
>> Current policy is not explicitly initializing variables to zero. If this 
>> causes
>> problems, there's a bug in the routine that clears the BSS on kernel entry.
>> 

jun> Interesting.  What is the reason behind the policy?  Is that because
jun> initialized variable are put in a different section that takes more size in
jun> the image?

Yes.  In linux the BSS section (aka non explicitely initialized vars)
is initializated with 0.  The initialzed variables need to be in the
data section of the kernel image (what only adds size, nothing else).

Later, Juan.



-- 
In theory, practice and theory are the same, but in practice they 
are different -- Larry McVoy

<Prev in Thread] Current Thread [Next in Thread>