使用dmesg打印所有日志( 十 )

< 0 && ((end - cur_index) > 2) &&LOG_BUF(cur_index + 0) == '<' &&LOG_BUF(cur_index + 1) >= '0' &&LOG_BUF(cur_index + 1) <= '7' &&LOG_BUF(cur_index + 2) == '>') {msg_level = LOG_BUF(cur_index + 1) - '0';cur_index += 3;start_print = cur_index;}while (cur_index != end) {char c = LOG_BUF(cur_index);cur_index++;if (c == '\n') {if (msg_level < 0) {msg_level = default_message_loglevel;}_call_console_drivers(start_print, cur_index, msg_level);msg_level = -1;start_print = cur_index;break;}}}_call_console_drivers(start_print, end, msg_level);}_call_console_drivers函数//调用console的写方法static void __call_console_drivers(unsigned start, unsigned end){struct console *con;for_each_console(con) {//遍历console_drivers数组 #define for_each_console(con) for (con = console_drivers; con != NULL; con = con->next)if ((con->flags & CON_ENABLED) && con->write &&(cpu_online(smp_processor_id()) ||(con->flags & CON_ANYTIME)))con->write(con, &LOG_BUF(start), end - start);//调用console的写方法}}//由于已经注册的终端是serial8250_console,这个终端的写方法是调用serial8250_console_write()函数--->uart_console_write()--->serial8250_console_putchar()//--->serial_out()最终打印在串口2终端上/*static struct console serial8250_console = {.name= "ttyS",.write= serial8250_console_write,//写方法.device= uart_console_device,//tty驱动.setup= serial8250_console_setup,//设置串口波特率,也就是设置串口 。很重要,里面涉及到平台特性,波特率相关 。.early_setup= serial8250_console_early_setup,.flags= CON_PRINTBUFFER | CON_ANYTIME,.index= -1,.data= http://www.kingceram.com/post/&serial8250_reg,};*/console_drivers链表在register_console中会设置