主题 : uboot中4k代码的验证问题 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 31462
精华: 0
发帖: 5
金钱: 25 两
威望: 5 点
贡献值: 0 点
综合积分: 10 分
注册时间: 2010-10-31
最后登录: 2012-05-31
楼主  发表于: 2012-05-21 10:22

 uboot中4k代码的验证问题

各位大虾:
        在uboot搬运4k的代码后,在start.s代码里面会对这4k的代码进行验证,以下是所有人移植的代码:
        ok_nand_read:
        @ verify
        mov    r0, #0
        ldr    r1, =TEXT_BASE
        mov    r2, #0x400    @ 4 bytes * 1024 = 4K-bytes
       go_next:
       ldr    r3, [r0], #4
       ldr    r4, [r1], #4
       teq    r3, r4
       bne    notmatch
       subs    r2, r2, #4
       beq    stack_setup
       bne    go_next
       这其中对r2进行赋值为0x400,不是1024么?而且在后面subs    r2, r2, #4,也就是说循环了256次,这不是只进行了1k代码的验证么?为什么会是对4k代码进行验证呢?
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
贡献值: 71 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
1楼  发表于: 2012-05-21 12:29
引用第2楼zhutoo006于2012-05-21 11:54发表的  :
恩,那就是说其实大家在移植的过程中这段代码都是错误的?

看起来错误就是这么来的
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."