免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2013 | 回复: 7
打印 上一主题 下一主题

关于u-boot的一个问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-12-24 17:16 |只看该作者 |倒序浏览
我看u-boot中u-boot-1.1.6\u-boot-1.1.6\cpu\arm920t\start.S有这样几句:
ldr        pc, _undefined_instruction
_undefined_instruction:        .word undefined_instruction
我看了些帖子是这样说的:把_undefined_instruction里面的内容载入PC
而_undefined_instruction:        .word undefined_instruction这个是定义了PC的地址
但是undefined_instruction这不是一个地址啊我找了下:
undefined_instruction:
        get_bad_stack
        bad_save_user_regs
        bl         do_undefined_instruction
如果这是个地址那么这个地址不就是不确定的了?
望指点一下 我看了没有嵌入式板块所以来这里发帖 不知道发的地方对不对

论坛徽章:
0
2 [报告]
发表于 2008-12-24 20:27 |只看该作者
为什么没人回答呢?别的帖子都有人回答 是不是这个问题太简单了不屑于回答??

论坛徽章:
0
3 [报告]
发表于 2008-12-24 20:28 |只看该作者

回复 #1 liuyiye 的帖子

哦 我知道了 我本来没看到这个板块 在别的板块发的帖子 人家告诉我来这里发帖的 直接复制 没注意看 不好意思

论坛徽章:
0
4 [报告]
发表于 2008-12-24 22:32 |只看该作者

回复 #1 liuyiye 的帖子

你描述的方式好像不对吧,具体是要烧录到arm上的

论坛徽章:
0
5 [报告]
发表于 2008-12-24 22:38 |只看该作者
get_bad_stack 这个是不是什么符号?或者地址入口?

论坛徽章:
5
6 [报告]
发表于 2008-12-24 23:11 |只看该作者
但是undefined_instruction这不是一个地址


你是怎么理解地址的?这里的undefined_instruction就是一个label.

论坛徽章:
0
7 [报告]
发表于 2008-12-25 11:44 |只看该作者

回复 #1 liuyiye 的帖子

一个symbol, 也就有一个地址与之对应, 这段实际上是中断向量表的一部分

论坛徽章:
0
8 [报告]
发表于 2008-12-26 19:29 |只看该作者

回复 #1 liuyiye 的帖子

先弄清楚ldr指令你就清楚了。
ldr        pc, _undefined_instruction
//把_undefined_instruction标号里面的内容赋给pc
_undefined_instruction:        .word undefined_instruction
//这个标号的内容为undefined_instruction这个标号,也就是实际未定义中断处理程序的地址。
undefined_instruction: //标号其实就是地址
        get_bad_stack //这个是宏定义
        bad_save_user_regs//这个是宏定义
        bl         do_undefined_instruction//跳转到真正的处理程序

评分

参与人数 1可用积分 +15 收起 理由
yidou + 15 分析详细

查看全部评分

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP