grub-devel
[Top][All Lists]
Advanced

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

Re: identifying module types


From: Yoshinori K. Okuji
Subject: Re: identifying module types
Date: Tue, 12 Dec 2006 23:28:16 +0100
User-agent: KMail/1.8.2

On Saturday 09 December 2006 01:02, Hollis Blanchard wrote:
> On the consumer side of multiboot (in this case Xen), we need to loop
> over the tags, and when we find a module tag, how do we know which it
> is? The Multiboot2 spec tells us "The order of modules is not
> guaranteed." (Why not?)

Because the spec does not know how modules are loaded by a boot loader at all. 
It does not know how to configure a boot loader. It does not know whether it 
is possible to interact with a boot loader at runtime. On the assumption in 
the spec, all we can say is that it is recommended that modules are loaded in 
the order specified by the user, if possible. We may not say "must" here.

> One option is a fixed-length encoded field, say 32 bytes wide. To avoid
> namespace collisions, we could require that projects prefix types with
> their project name, which must be at least 4 bytes.
>
> Another alternative would be a NULL-terminated string, which would
> appear in memory just before the NULL-terminated command line, e.g.
>       x e n \0 c o n s o l e = c o m 2 \0
> This is more flexible, but slightly more awkward on the consumer side:
>       type = module_tag->text;
>       cmdline = strchr(module_tag->text, '\0') + 1;

Isn't it easier to pass two strings rather than packing them to a single 
string?

type = module->type;
cmdline = module->cmdline;

Okuji




reply via email to

[Prev in Thread] Current Thread [Next in Thread]