Linux 起動時のメッセージを表示させる

linux/kernel/ の printk.c の中に、console_setup を変更します。
"strncpy(name, str, sizeof(name) - 1);"
の箇所を”strcpy(name,"tty0");”に変更。

static int __init console_setup(char *str)
{
 struct console_cmdline *c;
 char name[sizeof(c->name)];
 char *s, *options;
 int i, idx;

 /*
  * Decode str into name, index, options.
  */
 if (str[0] >= '0' && str[0] <= '9') {
  strcpy(name, "ttyS");
  strncpy(name + 4, str, sizeof(name) - 5);
 } else {
  /* strncpy(name, str, sizeof(name) - 1); */
  strcpy(name,"tty0");
 }
 name[sizeof(name) - 1] = 0;