lkml.org 
[lkml]   [2009]   [Jul]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectRe: Boot Consoles question...
Date
On Sat 4 Jul 2009 06:29, Ingo Molnar pondered:
> Could be changed i guess ... but is it really an issue?

It is just a change from "normal" (when the kernel has no boot console).

We were looking at shipping our default kernel, with a boot console that wrote
to a fixed place in memory - If something got hosed before the "real" console
was registered, the bootloader would print it out on the next boot...

No more people complaining about the kernel crashing or hanging without any
output on the console. (which happens more often than you would like with
people doing weird things to their kernel during embedded development).

The down side - is the above - the info before the "real" console starts does
not come out the real console...

> All messages
> should be in the syslog buffer (if it's large enough).

Yes. it does - but it still changes the "normal" boot look & feel...

> One artifact
> could be manual scroll-back - it would perhaps be nice indeed to
> allow the scrollback to the top of the bootlog.

Exactly.

One of my thoughts (was since CON_PRINTBUFFER isn't used after
register_console()) - was for the CON_BOOT's CON_PRINTBUFFER flag to control
the clearing of the CON_PRINTBUFFER for the real console or not...

All early_printk consoles that I looked at have their CON_PRINTBUFFER set.

Which means that something like should do the trick -- allow people who want
to override things to do so, and still have the today's setup work as is...

--- kernel/printk.c (revision 6920)
+++ kernel/printk.c (working copy)
@@ -1144,7 +1144,7 @@
@@ -1230,12 +1230,16 @@
* everything out, before we unregister the console(s)
*/
printk(KERN_INFO "console handover:");
- for_each_console(bcon)
+ flags = 0;
+ for_each_console(bcon) {
printk("boot [%s%d] ", bcon->name, bcon->index);
+ flags |= bcon->flags & CON_PRINTBUFFER;
+ }
printk(" -> real [%s%d]\n", newcon->name, newcon->index);
for_each_console(bcon)
unregister_console(bcon);
- newcon->flags &= ~CON_PRINTBUFFER;
+ if (flags)
+ newcon->flags &= ~CON_PRINTBUFFER;
} else {
printk(KERN_INFO "%sconsole [%s%d] enabled\n",
(newcon->flags & CON_BOOT) ? "boot" : "" ,
And then in my early_printk console_enable:

register_console(&early_shadow_console);
/* Make sure that the real console prints from the beginning */
early_shadow_console->flags &= ~CON_PRINTBUFFER;
?

Thoughts?


\
 
 \ /
  Last update: 2009-07-04 18:07    [W:0.138 / U:0.380 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site