普通的 x86 或 AMD PC 是直接从 ROM 运行启动/BIOS 代码,还是先将其复制到 RAM?

发布于 2024-10-22 17:30:48 字数 1549 浏览 10 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

月竹挽风 2024-10-29 17:30:48

直接从 ROM 执行并且将内容复制到 RAM 中。

在现代 x86 处理器上,芯片组内存控制器在初始加电时未初始化,因此没有可用的 RAM。

现代 BIOS 通常分为两部分:

  1. 引导块(早期 POST)
  2. 压缩区域(中后期 POST)

当处理器退出复位状态时,它开始在内存中的固定地址(称为“复位向量”)执行指令”。 BIOS闪存芯片被映射到内存中的这个地址。处理器只是从该地址开始执行指令。

“引导块”是指从复位向量(加上一些 JMP)开始的 BIOS 代码。这是直接从 ROM 执行的(内存控制器尚未启动),因此速度非常慢。

BIOS 引导块通常执行以下操作:

  1. 初始化内存控制器。 (如果您从主板上听到“未检测到内存”蜂鸣代码,则此处会发生这种情况。)
  2. 对压缩区域执行校验和,以确保 BIOS 的其余部分没有损坏。
  3. 如果检测到任何损坏,则跳转到恢复模式。
  4. 如果校验和通过,则将 BIOS 的其余部分解压缩到 RAM 中的某个位置(通常低于 1MB 边界)。
  5. 跳转到RAM中解压后的代码并继续启动。

It both directly executes from ROM and copies stuff into RAM.

On a modern x86 processor, the chipset memory controller is uninitialized at initial power-up, so there is no RAM available.

A modern BIOS is usually divided into two parts:

  1. Boot Block (early POST)
  2. Compressed Area (mid-to-late POST)

When the processor comes out of reset, it begins executing instructions at a fixed address in memory, called the "reset vector". The BIOS flash chip is mapped to this address in memory. The processor simply starts executing instructions from this address.

The "Boot Block" refers to the BIOS code starting at the reset vector (plus a few JMPs). This is executed directly from ROM (memory controller isn't up yet), so it is very slow.

The BIOS Boot Block generally does the following:

  1. Initialize the memory controller. (If you get a "memory not detected" beep code from a motherboard, it happens here.)
  2. Perform a checksum on the Compressed Area to make sure the rest of the BIOS is free of corruption.
  3. Jump into a Recovery Mode if any corruption is detected.
  4. If the checksum passes, decompress the rest of the BIOS into RAM somewhere (typically below the 1MB boundary).
  5. Jump to the decompressed code in RAM and continue with boot.
被你宠の有点坏 2024-10-29 17:30:48

如果您完全移除 RAM,电脑在开机时应该会开始不断发出蜂鸣声。

以下是对所发生情况的一个很好的描述:
http://www.pcguide.com/ref/mbsys/bios/boot.htm

Hans-Peter Messmer 的“The Indespensible PC Hardware Book”也描述了这个过程。

If you remove the RAM completely the PC should start to beep incessantly when you turn it on.

Here is a good description of what happens:
http://www.pcguide.com/ref/mbsys/bios/boot.htm

There's also Hans-Peter Messmer's 'The Indespensible PC Hardware Book' that describes the process too.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文