当前位置:网站首页>启动嵌入式间:资源有限的系统启动
启动嵌入式间:资源有限的系统启动
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
边栏推荐
- Mtcnn face detection
- for循环中break与continue的区别——break-完全结束循环 & continue-终止本次循环
- Swagger UI教程 API 文档神器
- SAP UI5 框架的 manifest.json
- Aiko ai Frontier promotion (7.6)
- HMS core machine learning service creates a new "sound" state of simultaneous interpreting translation, and AI makes international exchanges smoother
- 爱可可AI前沿推介(7.6)
- 数据湖(八):Iceberg数据存储格式
- Math symbols in lists
- Can novices speculate in stocks for 200 yuan? Is the securities account given by qiniu safe?
猜你喜欢

HMS core machine learning service creates a new "sound" state of simultaneous interpreting translation, and AI makes international exchanges smoother
![[200 opencv routines] 220 Mosaic the image](/img/75/0293e10ad6de7ed86df4cacbd79b54.png)
[200 opencv routines] 220 Mosaic the image

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

Chris LATTNER, the father of llvm: why should we rebuild AI infrastructure software

【论文解读】用于白内障分级/分类的机器学习技术

Study notes of grain Mall - phase I: Project Introduction

3D face reconstruction: from basic knowledge to recognition / reconstruction methods!

Laravel notes - add the function of locking accounts after 5 login failures in user-defined login (improve system security)

Aiko ai Frontier promotion (7.6)

爱可可AI前沿推介(7.6)
随机推荐
OAI 5G NR+USRP B210安装搭建
None of the strongest kings in the monitoring industry!
#yyds干货盘点#重新梳理箭头函数的this
Comprehensive evaluation and recommendation of the most comprehensive knowledge base management tools in the whole network: flowus, baklib, jiandaoyun, ones wiki, pingcode, seed, mebox, Yifang cloud,
20220211 failure - maximum amount of data supported by mongodb
How do I remove duplicates from the list- How to remove duplicates from a list?
Laravel笔记-自定义登录中新增登录5次失败锁账户功能(提高系统安全性)
Xcode6 error: "no matching provisioning profiles found for application"
##无yum源安装spug监控
【微信小程序】運行機制和更新機制
3D face reconstruction: from basic knowledge to recognition / reconstruction methods!
Spiral square PTA
Laravel notes - add the function of locking accounts after 5 login failures in user-defined login (improve system security)
js 根据汉字首字母排序(省份排序) 或 根据英文首字母排序——za排序 & az排序
Is this the feeling of being spoiled by bytes?
Ravendb starts -- document metadata
PG basics -- Logical Structure Management (transaction)
OSPF多区域配置
Infrared thermometer based on STM32 single chip microcomputer (with face detection)
3D人脸重建:从基础知识到识别/重建方法!