Welcome 微信登录

首页 / 操作系统 / Linux / u-boot-2011.06在基于S3C2440开发板的移植之解决raise: Signal # 8 caught

在这篇文章中提到,在开发板上电后,会出现“raise: Signal # 8 caught”。这虽然不影响系统的正常运行,但也是一个不小的bug,也许会影响以后u-boot-2011.06的移植,因此我们有必要把这个bug去除掉。相关阅读:U-Boot源代码下载地址 http://www.linuxidc.com/Linux/2011-07/38897.htmU-Boot-2011.06启动流程分析 http://www.linuxidc.com/Linux/2011-07/39310.htmu-boot-2011.06在基于s3c2440开发板的移植之编译配置 http://www.linuxidc.com/Linux/2011-10/45455.htmu-boot-2011.06在基于s3c2440开发板的移植之NorFlash启动 http://www.linuxidc.com/Linux/2011-10/45456.htmu-boot-2011.06在基于S3C2440开发板的移植之解决raise: Signal # 8 caught http://www.linuxidc.com/Linux/2011-10/454554.htmu-boot-2011.06在基于s3c2440开发板的移植之支持NandFlash读写 http://www.linuxidc.com/Linux/2011-10/45457.htmu-boot-2011.06在基于s3c2440开发板的移植之硬件ECC http://www.linuxidc.com/Linux/2011-10/454558.htm其实把这个bug去掉也很简单,就是把time.c(在arch/arm/arm920t/s3c24x0目录下)这个文件中的四个全局变量用gd这个数据结构中的4个相关成员代替就可以了,具体的就是:timer_load_val用gd->timer_rate_hz替代;timer_clk用gd->tbl替代;timestamp用gd->timer_reset_value替代;lastdec用gd->lastinc替代。下面我们就列出time.c这个文件具体需要修改的地方:去掉第38行和第39行关于timer_load_val和timer_clk这两个变量的声明,并加上下面代码:38:DECLARE_GLOBAL_DATA_PTR;去掉第49行和第50行关于timestamp和lastdec这两个变量的声明;去掉第60行至第68行语句(if (timer_load_val == 0)的判断内容),改为:60:gd->timer_rate_hz = get_PCLK() /(2*16*100);61:gd->tbl = get_PCLK() / (2 * 16);剩下需要修改的内容就是具体的变量替换,其中每条语句前面的行号为源文件的行号:70:gd->lastinc = gd->timer_rate_hz;71:writel(gd->timer_rate_hz,&timers->tcntb4);78:gd->timer_reset_value = 0;99:gd->timer_reset_value = t;108:tmo *= (gd->timer_rate_hz * 100);118:gd->lastinc = READ_TIMER();119:gd->timer_reset_value = 0;126:return tmr / (gd->tbl / CONFIG_SYS_HZ);137:tmo *= (gd->timer_rate_hz * 100);140:tmo = usec * (gd->timer_rate_hz * 100);160:if (gd->lastinc >= now) {162:gd->timer_reset_value += gd->lastinc -now;165:gd->timer_reset_value += gd->lastinc + gd->timer_rate_hz- now;167:gd->lastinc = now;169:return gd->timer_reset_value;181:tbclk = gd->timer_rate_hz * 100; 通过上述的修改,我们再上电启动后,就不会再有raise: Signal # 8 caught了。