ARM 系统上的 Bootrom 与引导加载程序之间有什么区别 [英] What is the difference between a Bootrom vs bootloader on ARM systems

查看:125
本文介绍了ARM 系统上的 Bootrom 与引导加载程序之间有什么区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我主要来自 x86 系统背景,其中 BIOS(固件)负责从 PowerON 加载引导加载程序(如 GRUB),然后加载操作系统.我现在一直在阅读 ARM 系统上的等效引导序列,似乎网络上有文章引用了两个术语:bootrom 和 bootloader.

I primarily come from an x86 system background where BIOS (Firmware) is responsible for loading a bootloader (like GRUB) from PowerON which in turn loads the OS. I now have been reading the equivalent boot sequence on ARM systems and it seems there are articles on the web making references to two terms: bootrom and bootloader.

有些文章提到从 PowerON 开始,引导加载程序(如 u-boot)是第一个被执行的东西,而有些文章说从 PowerON 开始,一个引导程序(通常在处理器的内部 ROM 上闪烁)首先被执行,然后依次加载引导加载程序(如 uboot)然后加载操作系统.

Some articles mention that from PowerON the bootloader (like u-boot) is the first thing that gets executed whereas some articles say that from PowerON, a bootrom (usually flashed on processor's internal ROM) gets executed first which in turn loads the bootloader (like uboot) which then loads the OS.

有人可以就 bootrom 与引导加载程序提供一些说明吗?另外,我想知道ARM系统中通常使用的流行引导程序的名称.

Can anybody provide some clarification on bootrom vs bootloader? Also, I would like to know a name of a popular bootrom that is typically used in ARM systems.

推荐答案

以下是我对术语的理解.

Here's how I understand the terms.

Bootrom(或 Boot ROM)是嵌入在处理器芯片内部的一小块掩膜 ROM 或写保护闪存.它包含处理器在开机或复位时执行的第一个代码.根据一些带引脚或内部熔断器的配置,它可能决定从哪里加载要执行的下一部分代码以及如何或是否验证它的正确性或有效性.有时它可能包含额外的功能,可能在引导期间或之后由用户代码使用.一些例子:

Bootrom (or Boot ROM) is a small piece of mask ROM or write-protected flash embedded inside the processor chip. It contains the very first code which is executed by the processor on power-on or reset. Depending on the configuration of some strap pins or internal fuses it may decide from where to load the next part of the code to be executed and how or whether to verify it for correctness or validity. Sometimes it may contain additional functionality, possibly usable by user code during or after booting. Some examples:

  • iPhone 启动 ROM.嵌入掩膜 ROM 中,无法修改.从闪存或 USB(在 DFU 模式下)加载下一阶段的引导加载程序,并使用内置 RSA 实现验证其签名.还为下一阶段的引导加载程序提供加速解密功能.​​

  • iPhone boot ROM. Embedded in the mask ROM and can't be modified. Loads the next stage boot loader from flash or USB (in DFU mode) and verifies its signature using built-in RSA implementation. Also provides accelerated decryption functions for the next stage bootloader.

TI 的 OMAP4 启动 ROM.可以从闪存(NOR、NAND、OneNAND)、外部存储器、SD/MMC、USB 或 UART 加载用户代码.引导顺序和选项由带 (SYSBOOT) 引脚设置.为后期阶段提供一些功能(缓存/TLB 管理等)

TI's OMAP4 boot ROM. Can load user code from flash (NOR, NAND, OneNAND), external memory, SD/MMC, USB or UART. Boot order and options are set by strap (SYSBOOT) pins. Provides some functionality for later stages (cache/TLB management etc.)

NXP 的 LPCxxxx 系列引导 ROM.放置在内部闪存的隐藏部分,开机时映射为 0.实施 CRP(代码读取保护)、ISP(系统内编程),允许通过 UART 上传和刷新新代码.如果有效的用户代码在闪存中(需要有正确的校验和),则将其映射到 0 并跳转到它.bootrom 的一部分仍然映射以提​​供 IAP(应用程序内编程)和一些其他服务.

NXP's LPCxxxx series Boot ROM. Placed in a hidden portion of the internal flash which is mapped at 0 on power-on. Implements CRP (code read protection), ISP (In-System Programming) which allows to upload and flash new code over UART. If a valid user code is in flash (needs to have proper checksum), maps it to 0 and jumps to it. A part of bootrom remains mapped to provide IAP (In-Application Programming) and some other services.

Bootloader 负责查找和加载应该在芯片上运行的最终操作系统或固件.与 bootrom 的主要区别之一是它通常在可写闪存中,可以更换或升级.

Bootloader is responsible for finding and loading the final OS or firmware which is supposed to run on the chip. One main difference from bootrom is that it's usually in writable flash and can be replaced or upgraded.

有时 bootrom 可以执行引导加载程序的工作.例如,OMAP 的 bootrom 足够复杂(它可以解析 FAT32!),您可能可以直接加载并启动 Linux 内核.

Sometimes bootrom can perform the job of the bootloader. For example, OMAP's bootrom is complex enough (it can parse FAT32!) that you can probably have it load and start a Linux kernel directly.

然而,在许多情况下,会使用单独的引导加载程序,要么是因为 bootrom 不够强大(或没有),要么是因为需要额外的灵活性.它可以非常简单(从 RAM 中的固定闪存位置加载内核并跳转到该位置),也可以更复杂.例如,U-Boot 本身就像一个迷你操作系统——它有一个控制台,一些命令,允许您中断启动过程,例如修改内核命令行参数,甚至从不同的位置(SD/MMC 或 USB)加载内核,运行一些测试等等.

However, in many cases a separate bootloader is used, either because the bootrom is not capable enough (or absent), or because extra flexibility is needed. It can be very simple (load kernel from a fixed flash location in RAM and jump to it), or can be much more complicated. For example, U-Boot is a like a mini-OS by itself - it has a console, some commands, allows you break the boot process and e.g. modify the kernel command line arguments or even load the kernel from a different location (SD/MMC or USB), run some tests and so on.

引导加载程序通常在您拥有或多或少复杂的操作系统时使用,在启动之前可能需要进行一些设置.像 NXP 的 LPC 系列这样的小型微控制器通常使用单片固件,所以他们可以不用它(但是,可能有 自定义引导加载程序.

Bootloaders are usually used when you have a more or less complex OS which may need some set up before it can be started. Smaller microcontrollers like NXP's LPC series usually use a monolithic firmware so they can get by without it (however, there may be custom bootloaders for them too).

在最简单的芯片上,可能根本没有引导 ROM 或引导加载程序——它们只是尝试从固定的启动地址获取和执行指令.事实上,今天大多数 x86 芯片都是这样工作的——它们只是从 FFFFFFF0 开始执行代码,期望芯片组已经将 BIOS 闪存芯片映射到那里.在这里,您可以说 BIOS 是引导加载程序(尽管它也为操作系统提供服务,类似于 bootrom).

On the very simplest chips there may be no boot ROM or boot loader at all - they just try to fetch and execute instructions from a fixed startup address. In fact, most x86 chips to this day work like this - they just start executing code at FFFFFFF0 with the expectation that the chipset has mapped the BIOS flash chip there. Here, you can say that BIOS is the bootloader (though it also provides services to the OS, similar to bootrom).

这篇关于ARM 系统上的 Bootrom 与引导加载程序之间有什么区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆