linux-mips
[Top] [All Lists]

Re: printk

To: "John D. Davis" <johnd@Stanford.EDU>
Subject: Re: printk
From: James Simmons <jsimmons@transvirtual.com>
Date: Fri, 3 Aug 2001 14:36:16 -0700 (PDT)
Cc: SGI MIPS list <linux-mips@oss.sgi.com>, Debian MIPS list <debian-mips@lists.debian.org>
In-reply-to: <Pine.GSO.4.31.0108031412450.675-100000@myth1.Stanford.EDU>
Sender: owner-linux-mips@oss.sgi.com
> Does anyone know off hand, the earlies point that I can use printk?  

Very early. Right after IRQs are setup and started. If no hardware is
present that can print the messages out the messages are queued in the
log buffer and once a device registers itself as a console it will flush
that buffer, thus printing everything. How soon can a register a device
as a console. Well that depends on when linux initializes the hardware.

> I added some printk statements to driver/char/console.c and the
> resulting kernel hangs with only the logo showing and no text.  

Printk calls the functons in console.c which in turn calls printk which
in turn and so on. So you get this recursive loop that goes on forever. 
So be careful. Also never call printk in interrupt handler. Printk turns
off IRQs when printing. This will be fixed in 2.5.X.


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