Le 29/12/12 22:23, Jeff Rizzo a écrit :
On 12/29/12 1:12 PM, Greg Troxel wrote:I would like to have a way to pass a string composed of the same flags (we can continue to use our existing "-a", "-s" and other flags) in a consistent manner from one platform to another, to be able to adjust driver options, kernel options, whatever, and to be able to expect it to be similar whether I'm on amd64, macppc, evbppc, evbarm, or whatever. Are you talking about the UI of how the strings are written and what they mean or how the bootloader stage that interacts with the user/prom communicates this to the kernel? For platforms with existing conventions, I don't see how we can interact with native bootloaders without meeting their interface.There are always going to be exceptions; certain platforms (especially older ones) are not flexible enough to do everything we want the way we want it. What I _would_ like to get to is "this is the recommended goal to shoot for".
That really depends on the capabilities of the MD component. I have a good example with Xen though.
Xen port parses a command line for which the syntax is very close to the one used by Linux (key=value) syntax [1]. Having a command line close to this syntax has a potential for code reuse, or even turn it into an MI/MD interface.
As we have a decent module framework too, I would look at what module(7) offers when we pass arguments to them. I would expect modules and kernel share the same code when parsing args, this makes sense somehow. Typical example is (again) Xen with a DOM0 kernel, where the kernel is loaded as a module.
This is more an exception than a rule, but this shows that the kernel can be made standalone or turned into a module depending on the context and both should accept the same syntax (and API). Currently it does not, which leads to confusion (see my poor attempt at documenting this in boot(8) with the "load" directive).
That is not an "API" per-see, but it shows that there is prior art even in src/, but without a clear goal/good design behind.
Happy new year's eve :)[1] http://nxr.netbsd.org/source/xref/src/sys/arch/xen/xen/xen_machdep.c#xen_parse_cmdline
-- Jean-Yves Migeon jeanyves.migeon%free.fr@localhost