文档详情

U-BOOT裁减移植(一)----汇编启动代码start.S分析.doc

发布:2017-06-20约1.03万字共10页下载文档
文本预览下载声明
U-BOOT裁减移植(一)----汇编启动代码start.S分析 2010-07-05 23:31 stage1 阶段的启动代码,主要就在 start.s 文件里。 此 start.s 也是系统上电后执行的第一个代码。它全部由汇编编写。 下面的代码已经针对我自己开发板S3C2440裁减移植好了 红色字体表示针对开发板新添加的 蓝色字体表示注释 灰色底表示原本u-boot有的函数然后被删除了 1 2 #include common.h 3 #include config.h 4 5 .globl _start 6 _start: 7???????? b?????? start_code 8???????? ldr???? pc, _undefined_instruction 9???????? ldr???? pc, _software_interrupt 10???????? ldr???? pc, _prefetch_abort 11???????? ldr???? pc, _data_abort 12???????? ldr???? pc, _not_used 13???????? ldr???? pc, _irq 14???????? ldr???? pc, _fiq 15 16 _undefined_instruction: .word undefined_instruction 17 _software_interrupt:??? .word software_interrupt 18 _prefetch_abort:??????? .word prefetch_abort 19 _data_abort:??????????? .word data_abort 20 _not_used:????????????? .word not_used 21 _irq:?????????????????? .word irq 22 _fiq:?????????????????? .word fiq 23 24???????? .balignl 16,0xdeadbeef 25 26 _TEXT_BASE: 27???????? .word?? TEXT_BASE 28 29 .globl _armboot_start 30 _armboot_start: 31???????? .word _start 32 33 .globl _bss_start 34 _bss_start: 35???????? .word __bss_start 36 37 .globl _bss_end 38 _bss_end: 39???????? .word _end 43 #ifdef CONFIG_USE_IRQ 44 /* IRQ stack memory (calculated at run-time) */ 45 .globl IRQ_STACK_START 46 IRQ_STACK_START: 47???????? .word?? 0x0badc0de 48 49 /* IRQ stack memory (calculated at run-time) */ 50 .globl FIQ_STACK_START 51 FIQ_STACK_START: 52???????? .word 0x0badc0de 53 #endif 54 55 56 /* 57 * the actual start code 58 */ 40 41???????? //复位启动子程序,设置为管理模式 42 start_code: 43???????? /* 44????????? * set the cpu to SVC32 mode 45????????? */ 46???????? mrs???? r0, cpsr 47???????? bic???? r0, r0, #0x1f 48???????? orr???? r0, r0, #0xd3 49???????? msr???? cpsr, r0 50 69???????? bl????? coloured_LED_init 70???????? bl????? red_LED_on 71 72 #if???? defined(CONFIG_AT91RM9200DK) || defined(CONFIG_AT91RM9200EK) 73???????? /* 74????????? * relocate exception table 75????????? */ 76???????? ldr???? r0, =_start 77???????? ldr???? r1, =0x
显示全部
相似文档