7

What piece of hardware executes firmware during POST?

BIOS microcontroller or CPU? BIOS microcontroller is executing the firmware on ROM which has some configuration on CMOS (like a RAM). But during POST who is executing the firmware that is checking himself?

After POST, BIOS must "tell" CPU to assign instruction pointer to some address on memory right? that's how it jumps on startup?

int3
  • 658
  • 1
  • 5
  • 21
  • "BIOS microcontroller"? – Ignacio Vazquez-Abrams May 05 '16 at 16:11
  • 1
    yes. someone must execute code somewhere. what piece of hardware is executing? CPU or BIOS have a microcontroller? – int3 May 05 '16 at 16:20
  • BIOS is not hardware, and I'm not sure what you mean by *BIOS microcontroller*. Also, this question is off-topic here, as it is a general computer question and not a programming question as described in the [help] guidelines. This site is for programming (code) and programmers tools related questions. – Ken White May 06 '16 at 02:06

1 Answers1

14

There is no "BIOS microcontroller". The BIOS chip is just flash memory. All execution is done by the CPU.

When the processor comes out of reset, it begins executing from a fixed address (called the reset vector). That fixed address is mapped to the BIOS flash chip.

Once the BIOS has completed its boot time tasks (hardware initialization, POST), it begins enumerating boot devices in the order specified in the BIOS setup. The first boot device it finds with a valid boot sector, it begins executing it, and thus control of the computer is handed over to the Operating System.

One other comment, based on your comments: CMOS is just a set of registers inside the chipset that are backed by the RTC battery. They were traditionally used to store BIOS settings, but in a modern UEFI BIOS your settings are stored in flash.

myron-semack
  • 6,259
  • 1
  • 26
  • 38
  • I have a follow-up question: I have a BIOS flashback button, which allows updating bios from a USB stick without even turning on the system. You turn off the PC (MB remains powered), press the button, and MB starts reading from the USB flash stick and updating. I checked that this function doesn't work when the CPU is not inserted. But I'm not sure if this is the CPU who is executing this update process, because the CPU power is turned off, no fans are rotating etc. Any thoughts? – sich Oct 11 '18 at 07:39
  • 1
    It’s the CPU executing this. It happens during the boot block phase of the BIOS (very early in the boot sequence, probably before the fan controller chip is initialized). Most BIOSes have a way to reprogram themselves if they detect corruption. They probably just short circuit that detection when the button is pressed. – myron-semack Oct 11 '18 at 10:43
  • Thank you for the explanation. How do you think BIOS knows the CPU won't overheat without fan working? This BIOS update process takes 1-2 minutes. – sich Oct 11 '18 at 10:57
  • 1
    The answer is probably “it doesn’t”. Most CPUs have thermal throttling built into them, so even if the fan doesn’t kick on, they won’t melt. The CPU won’t be running at full performance, but during BIOS reprogramming you should be fine. Typically only one Core is active during BIOS programming so the thermal load is low. You also get a bit of passive cooling from the metal heatsink. Now if it gets too hot and the CPU does an emergency shutdown mid BIOS programming that would be bad. – myron-semack Oct 11 '18 at 11:03
  • Thanks! The reason I'm asking all this is I'm trying to troubleshoot my new motherboard and processor don't start and don't do POST, but MB is able to update the BIOS from flash. At least now I know the processor is not dead :) You helped me a lot! – sich Oct 11 '18 at 11:14