/arch/arm/include/uapi/asm/setup.h
struct tag {
struct tag_header hdr;
union {
struct tag_core core;
struct tag_mem32 mem;
struct tag_videotext videotext;
struct tag_ramdisk ramdisk;
struct tag_initrd initrd;
struct tag_serialnr serialnr;
struct tag_revision revision;
struct tag_videolfb videolfb;
struct tag_cmdline cmdline;
/*
* Acorn specific
*/
struct tag_acorn acorn;
/*
* DC21285 specific
*/
struct tag_memclk memclk;
} u;
};
内核参数通过一个静态的tag链表在启动的时候传递到内核。每个tag的结构为
+-----------+
tag_header
+-----------+
tag_xxx
+-----------+
其中tag_header为tag头,表明tag_xxx的类型和大小,之所以要标识tag_xxx的类型是因为不同的tag需要不同的处理函数。tag_header的结构为
struct tag_header
{
int size;
int tag;
}
size表示tag的结构大小,