------以下内容转自:http://blog.csdn.net/cpuwolf/article/details/4492822------

  如果你运气不太好,那么第一次启动kernel,最多看见: uncompressing linux...ok, booting the kernel 

  从串口ttyS0出来,然后你什么都没了。这总情况遇见的机会还是很多的。多数原因是内核卡住了。你可能会问,内核卡住了不要紧呀,至少没卡住的代码中的printk应该可以出来。你这样想,那就是你还没有读过printk的代码。  在串口驱动初始话前的printk语句是不会即时的打出,而是存在内存中,然后等串口初始化完毕,这些message一下就冲了出来。 问题是如果在串口初始化完毕之前,内核卡住,那么你就什么message也看不见. 因此,问题就是解决这个即时打印的问题,linux kernel其实提供了这套机制,它的相关代码用 CONFIG_DEBUG_LL包裹着。 一旦被打开,那么printk就会call printascii()函数。 

        printacii是汇编语言写成,在kernel/arch/arm/kernel/debug.S有定义.它不做实质的动作,主要判断string的结束。这个函数会call几个函数: addruart, waituart, senduart, busyuart . 这些函数要求由汇编写成,并且和体系结构相关,一般都一定在下面的文件里 kernel/arch/arm/mach-xxx/include/mach/debug-macro.S 而且这个文件不会被单独编译,他其实就被包含在kernel/arch/arm/kernel/debug.S中: #include <mach/debug-macro.S> 打开CONFIG_DEBUG_LL这个标志以后,你就可以得到即时debug message了

-------以上内容转自:http://blog.csdn.net/cpuwolf/article/details/4492822-------


以下是关于如何打开内核的low level debug 配置

make menuconfig ---> Kernel hacking ---> 选中:Kernel debugging。

当选中Kernel debugging后,才能看见Kernel low-level debugging functions. 选中即可。

GitHub 加速计划 / li / linux-dash
10.39 K
1.2 K
下载
A beautiful web dashboard for Linux
最近提交(Master分支:23 天前 )
186a802e added ecosystem file for PM2 4 年前
5def40a3 Add host customization support for the NodeJS version 4 年前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐