- 论坛徽章:
- 0
|
每次都是执行到init/main.c中的start_kernel()函数中的sti()函数后就死掉,
start_kernel()函数如下:
asmlinkage void __init start_kernel(void)
{
char * command_line;
extern char saved_command_line[];
unsigned int ch;
char a[]="hello!";
puts(a);
printk("\n put debug:arrive at start_kernel \n");
printk("\n debug:arrive at start_kernel \n");
#ifdef WANGBO_DEBUG
printk(KERN_INFO "Debug: start_kernel called.\n");
#endif
/*
* Interrupts are still disabled. Do necessary setups, then
* enable them
*/
lock_kernel();
printk("\n put debug:lock_kernel is over!\n");
printk(linux_banner);
setup_arch(&command_line);
// puts("\n kernel command line:\n");
printk("Kernel command line: %s\n", saved_command_line);
//puts(saved_command_line);
parse_options(command_line);
printk("\n put debug:parse_options is over!\n");
trap_init();
printk("\n put debug:trap_init is over!\n");
init_IRQ();
printk("\n put debug:init_IRQ is over!\n");
sched_init();
printk("\n put debug:sched_init is over!\n");
softirq_init();
printk("\n put debug:softirq_init is over!\n");
time_init();
printk("\n put debug:time_init is over!\n");
/*
* HACK ALERT! This is early. We're enabling the console before
* we've done PCI setups etc, and console_init() must be aware of
* this. But we do want output early, in case something goes wrong.
*/
//sti();
// puts("\n sti debug:sti is over!\n");
console_init();
printk("\n put debug:console_init is over!\n");
#ifdef CONFIG_MODULES
init_modules();
#endif
printk("\n put debug:init_modules is over!\n");
if (prof_shift) {
unsigned int size;
/* only text is profiled */
prof_len = (unsigned long) &_etext - (unsigned long) &_stext;
prof_len >>= prof_shift;
prof_len = (unsigned long) &_etext - (unsigned long) &_stext;
prof_len >>= prof_shift;
size = prof_len * sizeof(unsigned int) + PAGE_SIZE-1;
prof_buffer = (unsigned int *) alloc_bootmem(size);
}
kmem_cache_init();
sti();
printk("\n put debug:sti is over!\n");
calibrate_delay();
puts("\n put debug:calibrate_delay is over!\n");
#ifdef CONFIG_BLK_DEV_INITRD
if (initrd_start && !initrd_below_start_ok &&
initrd_start < min_low_pfn << PAGE_SHIFT) {
printk(KERN_CRIT "initrd overwritten (0x%08lx < 0x%08lx) - "
"disabling it.\n",initrd_start,min_low_pfn << PAGE_SHIFT);
initrd_start = 0;
}
#endif
puts("\nput debug:later mem_init.\n");
mem_init();
kmem_cache_sizes_init();
puts("\nput debug:kmem_cache_sizes_init is over.\n");
pgtable_cache_init();
puts("\nput debug:pgtable_cache_init is over.\n");
if (num_mappedpages == 0)
num_mappedpages = num_physpages;
fork_init(num_mappedpages);
puts("\nput debug:fork_init is over.\n");
proc_caches_init();
puts("\nput debug:proc_caches_init is over.\n");
vfs_caches_init(num_physpages);
puts("\nput debug:vfs_caches_init is over.\n");
buffer_init(num_physpages);
puts("\nput debug:buffer_init is over.\n");
page_cache_init(num_physpages);
puts("\nput debug:page_cache_init is over.\n");
#if defined(CONFIG_ARCH_S390)
ccwcache_init();
#endif
signals_init();
#ifdef CONFIG_PROC_FS
proc_root_init();
#endif
puts("put debug:later check_bugs.\n");
check_bugs();
printk("POSIX conformance testing by UNIFIX\n");
puts("POSIX conformance testing by UNIFIX\n");
/*
* We count on the initial thread going ok
* Like idlers init is an unlocked kernel thread, which will
* make syscalls (and thus be locked).
*/
smp_init();
#if defined(CONFIG_SYSVIPC)
ipc_init();
#endif
rest_init();
}
输出的结果如下:
Nand Flash : ID: 0xEC76, Size: 64MByte
Nandflash没有被格式化,运行NFormat工具可对其进行格式化。
Load image.rom...
Start uClinux
Uncompressing Linux.......
.....
.....
......
.....
.....
......
.. done, booting the kernel.
hello!
put debug:arrive at start_kernel
debug:arrive at start_kernel
put debug:lock_kernel is over!
Linux version 2.4.24-uc0 (root@ubuntu) (gcc version 2.95.3 20010315 (release)(ColdFire patches - 20010318 from http://fiddes.net/coldfire/)(uClinux XIP and shared lib patches from http://www.snapgear.com/)) #960 Tue Aug 17 19:23:13 CST 2010
Processor: Samsung S3C44B0X revision 0
Architecture: S3C44B0X
On node 0 totalpages: 2048
zone(0): 0 pages.
zone(1): 2048 pages.
zone(2): 0 pages.
Kernel command line: root=/dev/rom0 init=/linuxrc
put debug:parse_options is over!
put debug:trap_init is over!
put debug:init_IRQ is over!
put debug:sched_init is over!
put debug:softirq_init is over!
put debug:time_init is over!
put debug:console_init is over!
put debug:init_modules is over!
put debug:kmen_cache_init is over!
有时会出现以下错误信息:(前面重复的省略)
put debug:kmen_cache_init is over!
Bad mode in data abort handler detected: mode IRQ_32
Vectors:
Stubs:
Internal error: Oops: 0
CPU: 0
pc : [<01d5f250>] lr : [<0c012050>] Not tainted
sp : 0c129f98 ip : 0c129fbc fp : 00000000
r10: 00000000 r9 : 00111800 r8 : 00111a00
r7 : 0c151a00 r6 : 0c131d9c r5 : 00000042 r4 : 00000000
r3 : 00000000 r2 : 60000053 r1 : 00000200 r0 : 4054f162
Flags: nZCv IRQs off FIQs off Mode IRQ_32 Segment user
Control: 0
Process swapper (pid: 0, stackpage=0c129000)
Stack:
0c129fc0: 0c012050 01d5f250 600000d2 ffffff
ff
0c129fe0: 0c12ab38 6c6c6568 0000216f 07ff0000 00000000 0c12a000 0c2ce864 0c0085
58
Backtrace: no frame pointer
Code: 00004e20 00002873 (00000200) 00000200 00000200
Kernel panic: Attempted to kill the idle task!
In idle task - not syncing |
|