Re: [PATCH 1/1] x86: Add config option to setup early serial console

From: Mike Travis
Date: Thu Jun 12 2008 - 18:55:28 EST


H. Peter Anvin wrote:
> Mike Travis wrote:
>> * Add config option EARLY_SERIAL_CONSOLE to enable early
>> printk's to be directed to the serial console.
>>
>> Based on linux-next
>>
>> Signed-off-by: Mike Travis <travis@xxxxxxx>
>
> Is there any reason this can't be done dynamically, via a command-line
> option instead?
>
> We can get to the command line extremely early if need be.
>
> -hpa

We could. My current debugging is in x86_64_start_kernel() almost at
the start of the function (before the "Kernel alive" message). The
code is below. (cut and pasted so no tabs)

One benefit of a startup option instead of a config option is we rely
on the standard distribution for the kernel and unless they set this
option it won't do us much good.

(Maybe the failed attempts was trying to tell me something? ;-)

Thanks,
Mike

/* Cleanup the over mapped high alias */
cleanup_highmap();

... my debugging is here ...

for (i = 0; i < NUM_EXCEPTION_VECTORS; i++) {
#ifdef CONFIG_EARLY_PRINTK
set_intr_gate(i, &early_idt_handlers[i]);
#else
set_intr_gate(i, early_idt_handler);
#endif
}
load_idt((const struct desc_ptr *)&idt_descr);

early_printk("Kernel alive\n");

for (i = 0; i < NR_CPUS; i++)
cpu_pda(i) = &boot_cpu_pda[i];

pda_init(0);
copy_bootdata(__va(real_mode_data));

... startup params available here ...

reserve_early(__pa_symbol(&_text), __pa_symbol(&_end), "TEXT DATA BSS");

#ifdef CONFIG_BLK_DEV_INITRD
/* Reserve INITRD */
if (boot_params.hdr.type_of_loader && boot_params.hdr.ramdisk_image) {
unsigned long ramdisk_image = boot_params.hdr.ramdisk_image;
unsigned long ramdisk_size = boot_params.hdr.ramdisk_size;
unsigned long ramdisk_end = ramdisk_image + ramdisk_size;
reserve_early(ramdisk_image, ramdisk_end, "RAMDISK");
}
#endif





--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/