Andrew Morton <akpm@digeo.com> writes:
> I think what we need James is just the low-level hook in printk.c which
> the various platforms and boards can plug into. The one in Martin's
> patch (module some cleanups, docco, conversion to C, etc) looks
> suitable to me. The actual early console drivers don't appear to have
> much relationship at all to the console layer really. They're just
> minimal-code busy-wait port banging.
The hook already exists and it is called register_console. Has been there
for years. early_printk on x86-64 uses that. Originally I used the hackish
printk hook way, but Linus put me on the right track.
Your arch code just does a register_console very early which does the low level
output.
Actually you need one new hook for cosmetic reason: when the real console
starts you want to disable the early console, otherwise you get duplicated
output when they go to the same output device. This can be done with a
straight forward function call in console_init.
BTW the x86-64 early console should just work fine on i386 too, with minor
changes.
All you need to do is:
- cp arch/x86_64/kernel/early_printk.c arch/i386/kernel/early_printk.c
- edit arch/i386/kernel/early_printk.c and replace VGABASE with
__PAGE_OFFSET+0xb8000
- add it to arch/i386/kernel/Makefile
- (optional - if you don't do it will be only initialised after setup_arch when
__setup arguments are parsed)
add something like
if (c == ' ' && !memcmp(from,"earlyprintk=",12)) {
extern int setup_early_printk(char *opt)
setup_early_printk(from+12);
}
to the comand line parsing in arch/i386/kernel/setup.c
- Enable CONFIG_EARLY_PRINTK so that console_init disables it.
- Boot with earlyprintk=vga (for vga output)
or earlyprintk=serial,ttySx,baud for serial output.
Add ,keep when you want to keep it even after console_init
-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Tue Oct 15 2002 - 22:00:48 EST