Bootrom与Bootloader在ARM系统上的区别是什么 [英] What is the difference between a Bootrom vs bootloader on ARM systems

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

问题描述

我主要来自x86系统背景,BIOS(固件)负责从PowerON加载引导加载程序(如GRUB),而该加载程序又会加载OS.现在,我一直在阅读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,首先执行bootrom(通常是刷新在处理器内部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与bootloader进行比较吗?另外,我想知道一个通​​常在ARM系统中使用的流行bootrom的名称.

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.

推荐答案

这是我对术语的理解.

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系列Boot 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负责查找并加载应该在芯片上运行的最终OS或固件.与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功能不足(或缺少),或者因为需要额外的灵活性,因此使用了单独的bootloader.它可以非常简单(从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.

引导加载程序通常在具有或多或少复杂的OS(可能需要先进行一些设置才能启动)的情况下使用.较小的微控制器(例如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).

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

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