当前位置:网站首页>Start of u-boot S analysis (IV)
Start of u-boot S analysis (IV)
2022-06-12 23:44:00 【Cheap sword】
- Next next to u-boot And start.S analysis ( 3、 ... and ) The final code analysis
Set the stack again
skip_hw_init:
/* Set up the stack */
stack_setup:
#if defined(CONFIG_MEMORY_UPPER_CODE)
ldr sp, =(CFG_UBOOT_BASE + CFG_UBOOT_SIZE - 0x1000)
#else
ldr r0, _TEXT_BASE /* upper 128 KiB: relocated uboot */
sub r0, r0, #CFG_MALLOC_LEN /* malloc area */
sub r0, r0, #CFG_GBL_DATA_SIZE /* bdinfo */
#if defined(CONFIG_USE_IRQ)
sub r0, r0, #(CONFIG_STACKSIZE_IRQ+CONFIG_STACKSIZE_FIQ)
#endif
sub sp, r0, #12 /* leave 3 words for abort-stack */
#endif
- Through query, we can know , We have defined
CONFIG_MEMORY_UPPER_CODE
Of , So the stack pointer sp Set toCFG_UBOOT_BASE + CFG_UBOOT_SIZE - 0x1000
, That is to say 0xc3e00000+2x1024x1024-0x1000=0xC3FFF000
, The corresponding real address is0x33fff000
- It means in the uboot Add 2M Re reduction 4K The place of , because ARM It's full minus stack , So from this position down about 2M Is the use space of the stack
clear BSS paragraph
clear_bss:
ldr r0, _bss_start /* find start of bss segment */
ldr r1, _bss_end /* stop here */
mov r2, #0x00000000 /* clear */
_bss_start
and_bss_end
From linker script ( Omit a layer of definition in the middle )
. = ALIGN(4);
__bss_start = .;
.bss : {
*(.bss) }
_end = .;
start-up start_armboot
clbss_l:
str r2, [r0] /* clear loop... */
add r0, r0, #4
cmp r0, r1
ble clbss_l
ldr pc, _start_armboot
_start_armboot:
.word start_armboot
- thus , The first stage analysis is completed
start_armboot
Function inuboot/lib_arm/board.c
in , It's a C Language functions- Finally through
lpr
The far jump instruction executes the functionstart_armboot
- Far jump means that the loaded address has nothing to do with the current running address , And he
Link address
of
- stay u-boot And start.S analysis ( One ) in , Set the stack to the internal SRAM in , Perhaps only 8K size ,uboot Execute part of the code here
- stay u-boot And start.S analysis ( 3、 ... and ) in , Reset the stack to the one that has been initialized DDR in
- Finally, re plan DDR Use , Reset stack , Jump to... When setup is complete DDR Execute the second stage in .
边栏推荐
- Mgr and greatsql resource summary
- [kubernetes guide ④] pod quick start
- Redis realizes SMS verification code login
- Message queue directory
- Zhengzhou University of light industry -- development and sharing of harmonyos pet health system
- QT actual combat case (38) -- using qpprocess class to realize the function of starting process
- Start blogging
- Leetcode 890 finding and replacing patterns [map] the leetcode path of heroding
- RT thread quick start - experience RT thread
- 2202-简历制作
猜你喜欢
M_ 8: Design a MySQL table for message queue to store message data
2202 - production de CV
Redis实现短信验证码登录
NCF 的Dapr应用实例的运行
2022年R2移动式压力容器充装考试题及在线模拟考试
Preparing for the Blue Bridge Cup Day11__ Basic operation of serial port communication
Develop a web office suite from scratch (5): mouse hover over text
Redis realizes SMS verification code login
Leetcode 2164. 对奇偶下标分别排序(可以,一次过)
Operation of simulation test platform for G3 boiler water treatment test questions in 2022
随机推荐
2022年R2移动式压力容器充装考试题及在线模拟考试
C # graphic tutorial (Fourth Edition) chapter7-7.6.1 virtual and override
Mgr and greatsql resource summary
Pytorch common parameter initialization methods: [uniform distribution, normal (Gaussian) distribution, Xavier, Kaiming, orthogonal matrix, sparse matrix, constant, identity matrix, zero filling]
[redis sentinel] failed listening on port 26379 (TCP) & sentinel mode no response problem solved
你真的会用PostGIS中的buffer缓冲吗?
How to use Huawei cloud disaster tolerance solution to replace disaster recovery all-in-one machine
array
Summary of individual NLP internship experience
Industry reshuffle, a large number of programmers are going to lose their jobs? How can we break the current workplace dilemma
[literature translation - Part] revealing the structure of clinical EEG signals by self supervised learning (SSL and RP principles / data / preprocessing)
Teach you how to grab ZigBee packets through cc2531 and parse encrypted ZigBee packets
[Yugong series] wechat applet in February 2022 - Reference
2202-簡曆制作
Buuctf-[ciscn 2019 preliminary]love math
Redis realizes SMS verification code login
支持Canvas的Leaflet.Path.DashFlow动态流向线
The Milvus graphical management tool Attu is coming!
基于Three.js海上风电数字孪生三维效果
如何让矢量瓦片配图神器maputnik支持 geoserver