当前位置:网站首页>启动嵌入式间:资源有限的系统启动
启动嵌入式间:资源有限的系统启动
2022-07-06 12:55:00 【全栈程序员站长】
大家好,又见面了,我是全栈君。
启动一个程序,它是在芯片上电复位,以执行,块独立于操作系统而在。由于操作系统须要通过启动这个模块来载入和引导的。所以启动的英文术语是boot loader。我对boot loader的定义包含两部分:1.载入os 2. 为了让os可以正常执行所要做的硬件和软件初始化工作。
我们经常看到boot loader这个词语用于arm引导linux,X86引导windows等等。可见一般意义上。能用上boot loader都是一些计算能力强并外挂SDRAM的SOC方案。
那我们咱们去理解内存资源有限型的嵌入式系统的启动呢?就以51为例。
51体系SOC一般都是内置K字节级别的nor flash用于执行代码,并内置一块K级别较小的ram用于数据读写。
非常明显这样的系统跑不了linux这样的高大上的系统,那51的启动都干嘛呢?我们从程序开发流程说起:
1)编敲代码。编译。链接成可运行文件。
一般在keil集成环境中。
2)keil的二进制工具(类似gcc的objcopy)解释1)中的可执行文件。抽取code和data数据,生成带有载入地址的.HEX格式文件。记住是载入地址,而不是执行地址。
3)烧写.HEX文件数据到nor flash。其依据的是文件里的载入地址。一般来说。代码段的载入地址和执行地址是一样的。这样才干在nor flash中跑起来。但是data是要放在内置ram区域才干可读写的。但是ram掉电会消失啊。所以data是先载入到nor flash的。即data的执行地址在ram区域。而载入地址在flash区域。
4)上电复位后。启动代码会进行硬件初始化,比如时钟,看门狗,串口等等
5)准备好栈。然后把data从载入的地方copy到ram的执行区域(链接地址)
6)初始化好bss,然后就jump到主程序開始跑啦。
简单的嵌入式系统一般没有os。就是上面的流程。
这样的系统的代码量一般比較小,所有放到内置的nor flash中。没有外挂的nand flash或者card。
它能够支持读写卡。可是代码仅仅放到内置的nor flash,而没有放到外置的卡中。
其实51也能够像arm那样引导操作系统的,当然操作系统不仅对内存有要求,对CPU计算能力也有要求,所以51是不能胜任跑linux的。
可是51也能引导并跑简单的操作系统的。比如UCOS等等。仅仅有ram足够大就能够。
所以基于51的SOC系统也能够长得像S5PV210这样的SOC的系统,代码是放在外置的nand flash或者card中,那启动就要成为一个独立的模块和U启动COS、应用程序放在外置的nand中。上电的时候先通过irom来载入启动的代码到iram中,然后跑启动代码。并在启动代码中引导os。详细待见下一篇博文。
版权声明:本文博主原创文章,博客,未经同意不得转载。
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/117098.html原文链接:https://javaforall.cn
边栏推荐
- 数据湖(八):Iceberg数据存储格式
- R語言可視化兩個以上的分類(類別)變量之間的關系、使用vcd包中的Mosaic函數創建馬賽克圖( Mosaic plots)、分別可視化兩個、三個、四個分類變量的關系的馬賽克圖
- Introduction to the use of SAP Fiori application index tool and SAP Fiori tools
- 【论文解读】用于白内障分级/分类的机器学习技术
- Pycharm remote execution
- 7. Data permission annotation
- Deployment of external server area and dual machine hot standby of firewall Foundation
- Manifest of SAP ui5 framework json
- 966 minimum path sum
- use. Net drives the OLED display of Jetson nano
猜你喜欢

None of the strongest kings in the monitoring industry!

KDD 2022 | 通过知识增强的提示学习实现统一的对话式推荐

OneNote in-depth evaluation: using resources, plug-ins, templates

全网最全的知识库管理工具综合评测和推荐:FlowUs、Baklib、简道云、ONES Wiki 、PingCode、Seed、MeBox、亿方云、智米云、搜阅云、天翎

基于深度学习的参考帧生成

After working for 5 years, this experience is left when you reach P7. You have helped your friends get 10 offers

性能测试过程和计划
![[asp.net core] set the format of Web API response data -- formatfilter feature](/img/6b/e3d513f63b244f9f32555d3b3bec8c.jpg)
[asp.net core] set the format of Web API response data -- formatfilter feature

3D人脸重建:从基础知识到识别/重建方法!

2017 8th Blue Bridge Cup group a provincial tournament
随机推荐
防火墙基础之外网服务器区部署和双机热备
OneNote 深度评测:使用资源、插件、模版
Reflection operation exercise
强化学习-学习笔记5 | AlphaGo
20220211 failure - maximum amount of data supported by mongodb
Leetcode hot topic Hot 100 day 32: "minimum coverage substring"
Spark SQL chasing Wife Series (initial understanding)
OneNote in-depth evaluation: using resources, plug-ins, templates
正则表达式收集
What is the problem with the SQL group by statement
[MySQL] trigger
Can novices speculate in stocks for 200 yuan? Is the securities account given by qiniu safe?
R language visualizes the relationship between more than two classification (category) variables, uses mosaic function in VCD package to create mosaic plots, and visualizes the relationship between tw
Thinking about agile development
C language operators
After working for 5 years, this experience is left when you reach P7. You have helped your friends get 10 offers
document.write()的用法-写入文本——修改样式、位置控制
'class file has wrong version 52.0, should be 50.0' - class file has wrong version 52.0, should be 50.0
968 edit distance
R語言可視化兩個以上的分類(類別)變量之間的關系、使用vcd包中的Mosaic函數創建馬賽克圖( Mosaic plots)、分別可視化兩個、三個、四個分類變量的關系的馬賽克圖