Re: [start_kernel] Suggest to move parse_args() before trap_init()

From: Andrew Morton
Date: Mon Mar 01 2004 - 05:56:43 EST


"Zhu, Yi" <yi.zhu@xxxxxxxxx> wrote:
>
> I'm not sure it is _correct_ to move parse_args() before trap_init() in
> start_kernel(). Is there any potencial dependencies? I did this on my P4 UP
> box, it boots OK.
>
> My issue is if the parse_args() runs after trap_init(), the kernel
> parameter "lapic" and "nolapic" takes no effect. Because lapic_enable()
> is called after init_apic_mappings().
>
>
> --- init/main.c.orig 2004-03-01 16:54:23.000000000 +0800
> +++ init/main.c 2004-03-01 16:54:45.000000000 +0800
> @@ -416,11 +416,11 @@
>
> build_all_zonelists();
> page_alloc_init();
> - trap_init();
> printk("Kernel command line: %s\n", saved_command_line);
> parse_args("Booting kernel", command_line, __start___param,
> __stop___param - __start___param,
> &unknown_bootoption);
> + trap_init();
> sort_main_extable();
> rcu_init();
> init_IRQ();

I think the only problem with this is if we get a fault during
parse_args(), the kernel flies off into outer space. So you lose some
debuggability when using an early console.

But 2.4 does trap_init() after parse_args() and nobody has complained, as
did 2.6 until recently. So the change is probably OK.

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