It is very easy to add a new boot parameter. In linux kernel, there is a macro name __setup(...).
Here is example:
#include <linux/init.h> // for function __setup(...)
157 extern long simple_strtol(const char *, char **, unsigned int);
158 unsigned long boot_cache_mask = 0;
159 static int __init cache_mask_setup(char *mask)
160 {
161 printk("@cache_mask_setup: mask = %s\n", mask);
162 boot_cache_mask = simple_strtol(mask, NULL, 0);
163 printk("@cache_mask_setup: boot_cache_mask = %ld\n", boot_cache_mask);
164 return 1;
165 }
166 __setup("cache_mask=", cache_mask_setup);
|
阅读(850) | 评论(0) | 转发(0) |