2011年7月14日星期四

set console to com

When developing linux host driver, it cause the PC hang/reset, but there is no such crash log in /var/log/kern.log, the only solution is that the kernel crash message has to print out in real time, the ttyS0.

console
The console settings. When using this option, you will need to specify the serial console port and baud rate. For example: console=ttyS0,38400 where ttyS0 is the serial console port and 38400 is the baud rate for the serial port. Another example: console=ttyS0,384008N1 where 8 is is data bits, N is odd parity and 1 is stop bits.


/proc/sys/kernel/printk
The four values in this file are console_loglevel, default_mes-
sage_loglevel, minimum_console_level and default_con-
sole_loglevel. These values influence printk() behavior when
printing or logging error messages. See syslog(2) for more info
on the different loglevels. Messages with a higher priority
than console_loglevel will be printed to the console. Messages
without an explicit priority will be printed with priority
default_message_level. minimum_console_loglevel is the minimum
(highest) value to which console_loglevel can be set.
default_console_loglevel is the default value for con-
sole_loglevel.

1. edit /etc/default/grub, the CMDLINE
2. echo "15 x x x" > /proc/sys/kernel/printk
3. grub-update

Then i can get the kernel crash message, however the system is running very slow, after fix the bug, need to change the /etc/default/grub to get PC back to the normal performance

沒有留言:

發佈留言