2010年6月29日 星期二

Using the Low Level debug on kernel

Using the Low Level debug
a) Enable the Low Level debug in the menuconfig
Kernel hacking --->
[*] Kernel low-level debugging functions

b) Add the code (the red lines) in the file kernel/printk.c
extern void printch(char c);
static void emit_log_char(char c)
{
LOG_BUF(log_end) = c;
log_end++;
if (log_end - log_start > log_buf_len)
log_start = log_end - log_buf_len;
if (log_end - con_start > log_buf_len)
con_start = log_end - log_buf_len;
if (logged_chars < log_buf_len)
logged_chars++;
printch(c);
}
c) Use the new kernel, then you can get the uart info.
Note: if it cannot work, please make sure in the file -- include/asm-arm/arch-pxa/debug-macro.S, there is the right map for UART registers.

沒有留言:

張貼留言