uclinux很久前笔记11

来源:互联网 发布:二手软件app软件哪个好 编辑:程序博客网 时间:2024/06/05 19:56

实现reboot命令

在不修改时执行reboot的效果为:

/> reboot

Restarting system.

mm-armv.c 315

Reboot failed --System halted

 

在sourceinsight中搜索Reboot failed -- System halted得出的结果为:

---- Rebootfailed -- System halted Matches (1 in 1 files) ----

Process.c(linux-2.4.x\arch\armnommu\kernel):   printk("Rebootfailed -- System halted\n");

void machine_restart(char* __unused){       /*Cleanand disable cache, and turn off interrupts*/       cpu_proc_fin();       /*Tellthe mm system that we are going to reboot -        * we may need it to insert some 1:1 mappingsso that        * soft boot works.*/       setup_mm_for_reboot(reboot_mode);       /*Now call the architecture specific reboot code.*/       arch_reset(reboot_mode);       /*Whoops- the architecture was unable to reboot.        * Tell the user!*/       mdelay(1000);       printk("Reboot failed -- System halted\n");       while(1);}

搜索arch_reset:

System.h (linux-2.4.x\include\asm-armnommu\arch-s3c44b0x):extern inline void arch_reset(charmode)

extern inline void arch_reset(char mode){       /*@todo: reset the hardware in some way */}

改为:

extern inline void arch_reset(char mode){       /*@todo: reset the hardware in some way */       void (*jump)(void);       jump=(void (*)(void))0x0;       jump();}

这样一来在开发调试过程中要更新linux内核是就不用手动去按复位按键了。
0 0
原创粉丝点击