主题 : 关于u-boot源码中的汇编程序的问题 复制链接 | 浏览器收藏 | 打印
苍鹰
级别: 新手上路
UID: 23827
精华: 0
发帖: 22
金钱: 110 两
威望: 22 点
综合积分: 44 分
注册时间: 2010-06-27
最后登录: 2015-08-31
楼主  发表于: 2010-07-07 10:11

 关于u-boot源码中的汇编程序的问题

请教各路大虾:u-boot源码中的汇编程序是用什么工具开发的,有相关的学习资料吗
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
1楼  发表于: 2010-07-07 10:41
对于S3C2440来说,汇编就是ARM汇编,准确的说是ARMv4汇编指令集。
至于工具,u-boot的编译用的是GNU cross compile toolchain for ARM。
"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."
苍鹰
级别: 新手上路
UID: 23827
精华: 0
发帖: 22
金钱: 110 两
威望: 22 点
综合积分: 44 分
注册时间: 2010-06-27
最后登录: 2015-08-31
2楼  发表于: 2010-07-07 11:12

 u-boot-1.1.6的start.S中的一些语法看不懂,版主有这方面的资料吗

不懂的地方如下所示:
.globl _start
_start:    b       reset    /*复位向量:无条件跳转到标号*/
    ldr    pc, _undefined_instruction
    ldr    pc, _software_interrupt
    ldr    pc, _prefetch_abort
    ldr    pc, _data_abort
    ldr    pc, _not_used
    ldr    pc, _irq
    ldr    pc, _fiq

_undefined_instruction:    .word undefined_instruction
_software_interrupt:    .word software_interrupt
_prefetch_abort:    .word prefetch_abort
_data_abort:        .word data_abort
_not_used:        .word not_used
_irq:            .word irq
_fiq:            .word fiq

    .balignl 16,0xdeadbeef
TEXT_BASE:
    .word    TEXT_BASE

.globl _armboot_start
_armboot_start:
    .word _start

/*
* These are defined in the board-specific linker script.
*/
.globl _bss_start
_bss_start:
    .word __bss_start

看了ARM的汇编指令,里面也没有这些语法,麻烦斑竹在百忙之中解惑,不且感激
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
3楼  发表于: 2010-07-07 12:23
像.global, .word之类的标识,是GNU Assembler的定义,可以参考http://sourceware.org/binutils/docs-2.20/as/
ldr是ARM的指令,参考ARM System Architecture里的指令集相关部分
"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."
苍鹰
级别: 新手上路
UID: 23827
精华: 0
发帖: 22
金钱: 110 两
威望: 22 点
综合积分: 44 分
注册时间: 2010-06-27
最后登录: 2015-08-31
4楼  发表于: 2010-07-07 12:37

 谢谢

茅塞顿开,豁然开朗