QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1311|回复: 0

skyeye,跑第一个printk()就进了wake_up?

[复制链接]
发表于 2006-5-8 17:03:30 | 显示全部楼层 |阅读模式
skyeye 0.9.8
uclinux2.4
44b0

是不是skyeye不能进行内核调试而一定要kgdb才能?????
望前辈多多赐教分析!!!

能顺利进入start_kernel, 进入printk(linux_banner)就跳到sched.c中的wake_up函数!!!  

printk()原码中也找不出进入wake_up的语句。
调试发现每次都在printk.c 的for中进入 wake_up。

for (p = printk_buf; *p; p++) {
                if (log_level_unknown) {
                        if (p[0] != '<' || p[1] < '0' || p[1] > '7' || p[2] != '>') {
                                emit_log_char('<');
                                emit_log_char(default_message_loglevel + '0');
                                emit_log_char('>');
                        }
                        log_level_unknown = 0;
                }
                emit_log_char(*p);
                if (*p == '\n')
                        log_level_unknown = 1;
}



这个时候sched_init()没有被执行也就是说sched没有初始化怎么回跳进去呢!
!!!!!

如果把printk()函数禁掉就可以跑下去了,不会进入wake_up

下面是调试信息

[root@FC4 uClinux-dist]# skyeye  linux-2.4.x/linux
***********************************************************************
****                                                               ****
****   SkyEye  Simulator Ver 0.9.8 with  GDB/Insight 5.3 Interface ****
****                                                               ****
***********************************************************************
GNU gdb 5.3
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This SkyEye was configured as "--host=i686-pc-linux-gnu --target=arm-elf"...
(SkyEye) tar sim
cpu info: armv3, arm7tdmi, 41007700, fff8ff00, 0
mach info: name s3c44b0, mach_init addr 0x81698c0
log_info: log is on.
log_info:log file is ./skyeyeuclinux44b0.log, fd is 0x9382cc0
log_info: log start clock 0
log_info: log end clock 20000
SKYEYE: use arm7100 mmu ops
Connected to the simulator.
(SkyEye) load
Loading section .init, size 0xa000 vma 0xc008000
Loading section .text, size 0x1a4780 vma 0xc012000
Loading section .data, size 0x7964 vma 0xc1b8000
Start address 0xc008000
Transfer rate: 14354208 bits in <1 sec.
(SkyEye) b main.c:406
Breakpoint 1 at 0xc008594: file init/main.c, line 406.
(SkyEye) run
Starting program: /uclinux/uClinux-dist/linux-2.4.x/linux

Breakpoint 1, start_kernel () at init/main.c:407
407             printk(linux_banner);
(SkyEye) b printk.c:459
Breakpoint 2 at 0xc01d5b4: file printk.c, line 459.
(SkyEye) c
Continuing.

Breakpoint 2, printk (fmt=0x0) at printk.c:459
warning: Source file is more recent than executable.

459             for (p = printk_buf; *p; p++) {
(SkyEye) step
467                     }
(SkyEye) c
Continuing.

Breakpoint 2, printk (fmt=0x0) at printk.c:459
459             for (p = printk_buf; *p; p++) {
(SkyEye) del 2
(SkyEye) c
Continuing.
sim_info called

Program received signal SIGINT, Interrupt.
__wake_up (q=0x0, mode=3, nr=0) at sched.c:359
359             if (task_on_runqueue(p))
(SkyEye) c
Continuing.
sim_info called

Program received signal SIGINT, Interrupt.
__wake_up (q=0x0, mode=3, nr=3) at sched.c:740
740                     state = p->state;
(SkyEye)
您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-11-23 11:14 , Processed in 0.037865 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表