[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: printk



> 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.



Reply to: