Once we discovered the kernel was indeed booting, but the console wasn't printing, it was time to begin.
First, we forced the kernel to boot using a specified configuration for the serial port,
in our case 9600n1, and did not allow any command line options or boot time considerations etc.
The first place to go is drivers/char/tty_io.c, to console_init().
This function determines the console configuration at startup. Here's a small part of it:
memset(, 0, sizeof(struct termios));
memcpy(tty_std_termios.c_cc, INIT_C_CC, NCCS);
tty_std_termios.c_iflag = ICRNL | IGNPAR;
tty_std_termios.c_oflag = OPOST | ONLCR;
tty_std_termios.c_cflag = CLOCAL | B9600 | CS8 | CREAD;
tty_std_termios.c_cflag &= ~(CRTSCTS);
tty_std_termios.c_lflag = ISIG | ICANON | ECHO | ECHOE | ECHOK | ECHOCTL | ECHOKE | IEXTEN;
tty_std_termios.c_iflag = ICRNL | IXON;
tty_std_termios.c_oflag = OPOST | ONLCR;
tty_std_termios.c_cflag = B38400 | CS8 | CREAD | HUPCL;
tty_std_termios.c_lflag = ISIG | ICANON | ECHO | ECHOE | ECHOK | ECHOCTL | ECHOKE | IEXTEN;
|
The first (naive) thing we tried, was to configure the console the way we wanted.
Of course, this didn't help us much ;-)Disappointed but not discouraged, we remembered that we didn't have a bootloader yet, and that we didn't
really know if any option was being passed on to the kernel. "Maybe the kernel gets some garbage for command line?"
we (again, naively) thought. So we tried to stop the kernel from parsing command-line options, and manually
inserted our command line. This didn't help us much ;-)