TI中文支持网
TI专业的中文技术问题搜集分享网站

对于内核启动的疑问

背景:

我在给335x打xenomia补丁,xenomai对于linux的补丁文件仅有linux3.2.21.但是板子提供的是linux3.2.0,于是打个小补丁将linux3.2.0升级到linux3.2.21,升级后再打xenomia补丁。

一些就绪后,编译内核生成uImage,通过uboot下载到板子上面

在内核启动后,可以看到不断的打印出启动信息,但是当打印到:

[ 0.000000] NR_IRQS:396
[ 0.000000] IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrupts
[ 0.000000] Total of 128 interrupts on 1 active controller
[ 0.000000] OMAP clockevent source: GPTIMER2 at 24000000 Hz
[ 0.000000] OMAP clocksource: GPTIMER1 at 24000000 Hz
[ 0.000000] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 178956ms
[ 0.000000] Interrupt pipeline (release #4)
[ 0.000000] ————[ cut here ]————

内核停止打印。

经测试, ————[ cut here ]————是由内核目录下的Panic.c (kernel)中的下面函数打印出来的:

static void warn_slowpath_common(const char *file, int line, void *caller,
unsigned taint, struct slowpath_args *args)
{
const char *board;

printk(KERN_WARNING "————[ cut here ]————\n");
printk(KERN_WARNING "WARNING: at %s:%d %pS()\n", file, line, caller);
board = dmi_get_system_info(DMI_PRODUCT_NAME);
if (board)
printk(KERN_WARNING "Hardware name: %s\n", board);

if (args)
vprintk(args->fmt, args->args);

print_modules();
dump_stack();
print_oops_end_marker();
add_taint(taint);
}

 现在有个很奇怪的问题,通过上面的信息,看不出是哪里出错才打印出来。

于是我有添加了几个参考打印点:

static void warn_slowpath_common(const char *file, int line, void *caller,
unsigned taint, struct slowpath_args *args)
{
const char *board;

printk(KERN_WARNING "mark0\n");
printk(KERN_WARNING "————[ cut here ]————\n");
printk(KERN_WARNING "mark1\n");
printk(KERN_WARNING "WARNING: at %s:%d %pS()\n", file, line, caller);

board = dmi_get_system_info(DMI_PRODUCT_NAME);

此时有个奇怪的现象,内核在启动信息里只打印出了:

[ 0.000000] NR_IRQS:396
[ 0.000000] IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrupts
[ 0.000000] Total of 128 interrupts on 1 active controller
[ 0.000000] OMAP clockevent source: GPTIMER2 at 24000000 Hz
[ 0.000000] OMAP clocksource: GPTIMER1 at 24000000 Hz
[ 0.000000] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 178956ms
[ 0.000000] Interrupt pipeline (release #4)
[ 0.000000] mark0

然后停止。不在打印出后面其他要打印出来的信息。

然后,我屏蔽点本函数的打印信息,如下:

static void warn_slowpath_common(const char *file, int line, void *caller,
unsigned taint, struct slowpath_args *args)
{
const char *board;
/*
printk(KERN_WARNING "mark0\n");
printk(KERN_WARNING "————[ cut here ]————\n");
printk(KERN_WARNING "mark1\n");
printk(KERN_WARNING "WARNING: at %s:%d %pS()\n", file, line, caller);
*/

board = dmi_get_system_info(DMI_PRODUCT_NAME)

则可以通过内核启动信息看到:

 0.000000] NR_IRQS:396
[ 0.000000] IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrupts
[ 0.000000] Total of 128 interrupts on 1 active controller
[ 0.000000] OMAP clockevent source: GPTIMER2 at 24000000 Hz
[ 0.000000] OMAP clocksource: GPTIMER1 at 24000000 Hz
[ 0.000000] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 178956ms
[ 0.000000] Interrupt pipeline (release #4)
[ 0.000000] 这里出现一句其他函数的  printk信息

然后内核启动停止。

请问这是什么原因。

Steven Liu1:

xenomia双内核机制?这个应该会在很大程度上改变内核调度的机制吧,目前并没有客户这么使用过,xenomia也非TI所有,个人建议你把这个问题post到xenomia的相关支持论坛上。

赞(0)
未经允许不得转载:TI中文支持网 » 对于内核启动的疑问
分享到: 更多 (0)