Port-i386 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Multiboot(8) command-line format/parsing



Joerg Sonnenberger wrote:

But GRUB legacy and Xen provide a first argument with the intention of
it being skipped e.g. by Linux.

Ok, since GRUB legacy implicitly puts the booted file as first argument in the multiboot command line, multiboot-compliant kernels that do not care about this information simply skip it. But the multiboot specification does not require this. So the question remains: how do these kernels behave, or should behave, when this first implicit argument is not there?

Out of curiosity, I made some experiments with Xen 3.3 (from pkgsrc) and netbsd-XEN3PAE_DOM0 (i386).

<long_story>

I'm not a Xen user (even less developer), but from what I could see,

1. Xen is booted by multiboot, but Xen itself does *not* use multiboot to boot the DOM0 (at least in this case). The file netbsd-XEN3PAE_DOM0 is not multiboot-compliant anyway (it does not contain the multiboot magic number).

2. the command-line reported by Xen on the boot screen systematically drops the first argument, but, in fact, Xen takes it into account (tested with vga=text-80x50).

For the second point, according to the source code of Xen (in xen/arch/x86), it's actually more complex, as AFAICS command-line parsing is done in:

- arch/x86/boot/cmdline.S: here, the first argument is not skipped unless .Lfind_option skips the first argument (I doubt it, but I'm not fluent in assembly code).

- arch/x86/setup.c: here, the first argument in the command line is systematically skipped; this is performed by cmdline_cook which is called in __start_xen before actual command-line parsing.

</long_story>

So, when parsing the multiboot command-line, Xen skips the first argument -- except in its boot code, but the latter only cares about a subset of options (namely 'no-real-mode', 'tboot=', 'edd=', 'edid=' and 'vga=').

Grégoire







Home | Main Index | Thread Index | Old Index