Search code examples
multithreadingbiosuefi

Multi threaded BIOS


I would like to know why the BIOS is single-threaded even we have 4 cores/8 cores. Latest UEFI technology allows GUI utilities. Is there any specific reason for not implementing Multi-threaded BIOS.


Solution

  • The simple answer is: Diminishing Returns

    On most PCs, the boot sequence of BIOS/UEFI only takes ~5 seconds to work (Not counting HDD spinup latency). To most people, that is fast enough. (If you want faster, put your PC to sleep instead of turning it off.)

    Keep in mind that many of the tasks done in the BIOS cannot be parallelized. The memory controller has to be initialized first. The PCI/PCIe busses must be enumerated before you can check any of the subsequent devices (USB, SATA, Video, etc). You can't boot until you disks have spun up.

    There are a few initialization items that are time-consuming, and could be done in parallel.

    • IDE/SATA - Usually takes a while due to mechanical disk latencies.
    • USB - Some USB devices need 100s of msec after power is applied to come to life.
    • Video (any any other third-party BIOS extensions) - It takes a while to communicate with the displays and sync up.

    Those tasks could be done in parallel, which might speed up your PC's boot time. Keep in mind that to get there, you need to write a kernel and task scheduler. In legacy BIOS (pure x86 assembler), this would not be pretty. In UEFI (which is mostly C source), this is a little more feasible. However, it still requires a non-trivial engineering effort for a minor gain (maybe 1-2 second of boot time.)

    Phoenix has tried to introduce a multi-threaded BIOS initialization before. As far as I know, it never took off.