From andi --- Documentation/kernel-parameters.txt | 17 +++++++++++++++++ arch/i386/Kconfig | 3 +++ arch/i386/kernel/Makefile | 3 +++ arch/i386/kernel/setup.c | 12 ++++++++++++ arch/x86_64/kernel/early_printk.c | 4 ++++ 5 files changed, 39 insertions(+) diff -puN arch/i386/Kconfig~early_printk arch/i386/Kconfig --- 25/arch/i386/Kconfig~early_printk 2004-02-09 00:14:26.000000000 -0800 +++ 25-akpm/arch/i386/Kconfig 2004-02-09 00:14:26.000000000 -0800 @@ -1208,6 +1208,9 @@ config DEBUG_KERNEL Say Y here if you are developing drivers or trying to debug and identify kernel problems. +config EARLY_PRINTK + default y + config DEBUG_STACKOVERFLOW bool "Check for stack overflows" depends on DEBUG_KERNEL diff -puN arch/i386/kernel/Makefile~early_printk arch/i386/kernel/Makefile --- 25/arch/i386/kernel/Makefile~early_printk 2004-02-09 00:14:26.000000000 -0800 +++ 25-akpm/arch/i386/kernel/Makefile 2004-02-09 00:14:26.000000000 -0800 @@ -32,6 +32,9 @@ obj-y += sysenter.o vsyscall.o obj-$(CONFIG_ACPI_SRAT) += srat.o obj-$(CONFIG_HPET_TIMER) += time_hpet.o obj-$(CONFIG_EFI) += efi.o efi_stub.o +obj-$(CONFIG_EARLY_PRINTK) += early_printk.o + +early_printk-y := ../../x86_64/kernel/early_printk.o EXTRA_AFLAGS := -traditional diff -puN arch/i386/kernel/setup.c~early_printk arch/i386/kernel/setup.c --- 25/arch/i386/kernel/setup.c~early_printk 2004-02-09 00:14:26.000000000 -0800 +++ 25-akpm/arch/i386/kernel/setup.c 2004-02-09 00:14:26.000000000 -0800 @@ -1165,6 +1165,18 @@ void __init setup_arch(char **cmdline_p) #endif paging_init(); +#ifdef CONFIG_EARLY_PRINTK + { + char *s = strstr(*cmdline_p, "earlyprintk="); + if (s) { + extern void setup_early_printk(char *); + setup_early_printk(s+12); + printk("early console enabled\n"); + } + } +#endif + + dmi_scan_machine(); #ifdef CONFIG_X86_GENERICARCH diff -puN arch/x86_64/kernel/early_printk.c~early_printk arch/x86_64/kernel/early_printk.c --- 25/arch/x86_64/kernel/early_printk.c~early_printk 2004-02-09 00:14:26.000000000 -0800 +++ 25-akpm/arch/x86_64/kernel/early_printk.c 2004-02-09 00:14:26.000000000 -0800 @@ -7,7 +7,11 @@ /* Simple VGA output */ +#ifdef __i386__ +#define VGABASE (__PAGE_OFFSET + 0xb8000UL) +#else #define VGABASE 0xffffffff800b8000UL +#endif #define MAX_YPOS 25 #define MAX_XPOS 80 diff -puN Documentation/kernel-parameters.txt~early_printk Documentation/kernel-parameters.txt --- 25/Documentation/kernel-parameters.txt~early_printk 2004-02-09 00:14:26.000000000 -0800 +++ 25-akpm/Documentation/kernel-parameters.txt 2004-02-09 00:14:26.000000000 -0800 @@ -317,6 +317,23 @@ running once the system is up. dtc3181e= [HW,SCSI] + earlyprintk= [x86, x86_64] + earlyprintk=vga + earlyprintk=serial[,ttySn[,baudrate]] + + Append ,keep to not disable it when the real console + takes over. + + Only vga or serial at a time, not both. + + Currently only ttyS0 and ttyS1 are supported. + + Interaction with the standard serial driver is not + very good. + + The VGA output is eventually overwritten by the real + console. + eata= [HW,SCSI] eda= [HW,PS2] _