Mastering Ebedded Linux Programming-读书笔记

All about Bootloaders

准备工作:

  • Linux主机需要安装 device-tree-compiler, git, make, patch, and u-boot-tools
  • 第二章利用 Crostool-NG 编译的工具链,由于个人使用的是 BeagleBone-AI,所以使用的工具链为 arm-cortex_a15-gnueabihf
  • 一个SD卡和读卡器
  • BeagleBone Black 开发板,本人使用的是BeagleBone AI 开发板
  • 5V1A直流电源

Bootloader 作用

最基本的初始化系统,并加载 Linux 内核,在开始上电之初,DRAM、NAND flash、MMC 都无法使用,唯一可以操作的是 CPU 的一个核,以及片上 RAMboot ROM


boot 顺序

Bootloader 存储在 NOR flash(线性存储,支持随机访问),根据处理器的复位向量(将处理器指向第一条指定的地址,也就是处理器开始运行的位置),来决定 Bootloader 存储在 Flash 的顶端或者底端,即 Bootloader 的入口位于处理器上电第一条指令的位置。BootloaderNOR flash 中运行后先初始化 DRAM 控制器,初始化成功后,Bootloader 将内核从 NOR flash 加载到 DRAM 中。
若不是使用 NOR flash, 则一般需要三个阶段

1. 芯片上电或复位后,最开始运行的程序称作 ROM code,保存在片上 ROM 中,ROM code 可以从 NAND falshMMC 设备(EMMCSD 卡)等加载一小段代码到 SRAMSRAM 不需要内存控制)中,如果从这些 flash 设备上读取失败,则会通过以太网,USBUART 接口读取一个字节流。而 SRAM 太小无法加载完整的 Bootloader 程序,因此需要辅助加载程序(SPL)。也就是 ROM codeSPL 加载到 SRAM 当中,当 ROM

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Linux has been the mainstay of embedded computing for many years. And yet, there are remarkably few books that cover the topic as a whole: this book is intended to fill that gap. The term embedded Linux is not well-defined, and can be applied to the operating system inside a wide range of devices ranging from thermostats to Wi-Fi routers to industrial control units. However, they are all built on the same basic open source software. Those are the technologies that I describe in this book, based on my experience as an engineer and the materials I have developed for my training courses. Technology does not stand still. The industry based around embedded computing is just as susceptible to Moore's law as mainstream computing. The exponential growth that this implies has meant that a surprisingly large number of things have changed since the first edition of this book was published. This second edition is fully revised to use the latest versions of the major open source components, which include Linux 4.9, Yocto Project 2.2 Morty, and Buildroot 2017.02. Since it is clear that embedded Linux will play an important part in the Internet of Things, there is a new chapter on the updating of devices in the field, including Over the Air updates. Another trend is the quest to reduce power consumption, both to extend the battery life of mobile devices and to reduce energy costs. The chapter on power management shows how this is done. Mastering Embedded Linux Programming covers the topics in roughly the order that you will encounter them in a real-life project. The first 6 chapters are concerned with the early stages of the project, covering basics such as selecting the toolchain, the bootloader, and the kernel. At the conclusion of this this section, I introduce the idea of using an embedded build tool, using Buildroot and the Yocto Project as examples. The middle part of the book, chapters 7 through to 13, will help you in the implementation phase of the project. It covers the topics of filesystems, the init program, multithreaded programming, software update, and power management. The third section, chapters 14 and 15, show you how to make effective use of the many debug and profiling tools that Linux has to offer in order to detect problems and identify bottlenecks. The final chapter brings together several threads to explain how Linux can be used in real-time applications. Each chapter introduces a major area of embedded Linux. It describes the background so that you can learn the general principles, but it also includes detailed worked examples that illustrate each of these areas. You can treat this as a book of theory, or a book of examples. It works best if you do both: understand the theory and try it out in real life.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值