* kernel/printk.c problem
@ 2001-04-17 22:11 Scott A McConnell
2001-04-18 6:53 ` Geert Uytterhoeven
0 siblings, 1 reply; 5+ messages in thread
From: Scott A McConnell @ 2001-04-17 22:11 UTC (permalink / raw)
To: linux-mips
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){
Scott
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: kernel/printk.c problem
2001-04-17 22:11 kernel/printk.c problem Scott A McConnell
@ 2001-04-18 6:53 ` Geert Uytterhoeven
2001-04-18 16:56 ` Scott A McConnell
2001-04-18 17:32 ` Jun Sun
0 siblings, 2 replies; 5+ messages in thread
From: Geert Uytterhoeven @ 2001-04-18 6:53 UTC (permalink / raw)
To: Scott A McConnell; +Cc: linux-mips
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.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven ------------- Sony Software Development Center Europe (SDCE)
Geert.Uytterhoeven@sonycom.com ------------------- Sint-Stevens-Woluwestraat 55
Voice +32-2-7248626 Fax +32-2-7262686 ---------------- B-1130 Brussels, Belgium
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: kernel/printk.c problem
2001-04-18 6:53 ` Geert Uytterhoeven
@ 2001-04-18 16:56 ` Scott A McConnell
2001-04-18 17:32 ` Jun Sun
1 sibling, 0 replies; 5+ messages in thread
From: Scott A McConnell @ 2001-04-18 16:56 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: linux-mips
Geert Uytterhoeven wrote:
> 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.
What a man! You can debug my code from 6000 + miles away without even seeing it
;-)
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: kernel/printk.c problem
2001-04-18 6:53 ` Geert Uytterhoeven
2001-04-18 16:56 ` Scott A McConnell
@ 2001-04-18 17:32 ` Jun Sun
2001-04-18 18:28 ` Juan Quintela
1 sibling, 1 reply; 5+ messages in thread
From: Jun Sun @ 2001-04-18 17:32 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: Scott A McConnell, linux-mips
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.
>
Interesting. What is the reason behind the policy? Is that because
initialized variable are put in a different section that takes more size in
the image?
Jun
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: kernel/printk.c problem
2001-04-18 17:32 ` Jun Sun
@ 2001-04-18 18:28 ` Juan Quintela
0 siblings, 0 replies; 5+ messages in thread
From: Juan Quintela @ 2001-04-18 18:28 UTC (permalink / raw)
To: Jun Sun; +Cc: Geert Uytterhoeven, Scott A McConnell, linux-mips
>>>>> "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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2001-04-18 18:28 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-04-17 22:11 kernel/printk.c problem Scott A McConnell
2001-04-18 6:53 ` Geert Uytterhoeven
2001-04-18 16:56 ` Scott A McConnell
2001-04-18 17:32 ` Jun Sun
2001-04-18 18:28 ` Juan Quintela
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox