BIOS
BIOS
Overview of BIOS
Basics of BIOS
• What is BIOS ?
• What does it do?
• BIOS in software stack.
• Where does bios present?
What is BIOS ?
• Basic Input Output System
• The system software that initializes processor, Memory, Chipset and
other peripherals including graphics.
What does it do?
• Gets your computer up and running.
• Provides Power Management functionality.
• Loads and hands control over to the OS boot loader.
• Provides standardized routines for the OS to use during runtime.
• Allows the same OS to run on different motherboards.
• Allows the different OSes to run on same motherboard.
• Configure the platform based on the settings maintained in CMOS or
NVRAM memory.
BIOS in software stack
Where is BIOS present?
• BIOS is stored as firmware on a EEPROM/SPI Flash
chip on the motherboard
• ICL boards have 32 MB of flash area.
• BIOS size is 10 MB and remaining part has other components CSME, GbE, EC, strap
settings, etc.
• BIOS settings are stored in separate non-volatile chip.
• Allows users to customize certain settings through the BIOS Setup screen
• CMOS memory is powered by a battery on the motherboard
SPI Layout
NFTP
BPDT2
Offset
BPDT1
Offset
SPI
Size
Region
SPI Image overview
• In the SPI controller, a 4K descriptor at the base of the SPI device
splits the device into regions and defines the access control to each
region.
• CSE region starts from offset 4K.
• The GbE region and any other optional Flash regions will be allocated
as necessary after the CSE Data Region and prior to the BIOS Region.
• BIOS region will be at the end of the flash part.
Shadow Memory
• ROM chips are very slow compared to DRAM
• Copy ROM images into DRAM memory
• Increases performance of system and option ROM services
• System BIOS image is transferred to shadow memory
• Early in the POST cycle
• Compressed BIOS images are decompressed into shadow memory
• Allocations are made by the PnP/PCI configuration managers
• May also be used by PCI, ISA/LPC option ROM’s (Video, LAN, SCSI)
Basic BIOS components
A System BIOS when built as a binary includes the following components as part of it
• Boot Guard ACM
• Legacy Option ROMs
• RAID Option ROM
• Video BIOS Option ROM
• Microcode
• GOP (UEFI) driver
• NVMe (UEFI) driver
• RAID (UEFI) driver
• MEBx (ME BIOS extensions) UEFI driver
• Wi-FI/BT FW
IFWI Space Allocation
FW Ingredient Consumer Corporate
BIOS Image (Including Ref Code, GOP, uCode) 8MB (RVP) 8MB (RVP)
• Actual boot: As the very first step, CPU reads contents of memory 0xfffffff0. That has a jmp
instruction to the BIOS.
1. Initialization of CPU , Memory, Chipset, DMA controller, IRQ controllers, PCI controller, USB
controller, etc.
2. Searches for any other ROMs that might be installed such as Network Cards.
Boot Flow Cont….
• Looks for OS :
1. Searches for boot sector on boot devices such as HDD, CD, USB then
boot sector is loaded into memory.
2. The boot loader starts loading OS and OS takes over the control.
UEFI BIOS Boot flow
We have four different phases of UEFI bios boot flow
• BIOS ACM to authenticate the BIOS image. Signed using Intel key and this is authenticated by CPU
loader.
• DXE Core : The DXE Core produces a set of Boot Services, Runtime Services,
and DXE Services.
• DXE Drivers : The DXE drivers are responsible for initializing the processor,
chipset, and platform components as well as providing software abstractions
for console and boot devices.
BDS (Boot Device Selection)
• Runs after all DXE drivers are loaded.
• Initializes console devices.
• Disk devices, Display Adapters, Serial terminals are enumerated.
• Boot sector is loaded from boot device.
• ExitBootServices() is called to terminate BDS.
• OS takes control over to continue boot process.
BIOS Flow Chart
Power-On/Reset
20
BIOS Flow Chart
check -
sum ok Try recovery
? N
21
BIOS Flow Chart Invoke Setup, save
F2 Pressed ? settings in CMOS
Y RAM and Reboot
22
Other functionalities of BIOS
• Plug and Play
• Power Management
Plug n Play
• BIOS code that configures Plug And Play devices
• PnP manages the following resources
• Memory space
• I/O space
• IRQ resources
• DMA channels
Power Management
• Advanced Power Management (APM)
• BIOS did all of the power management
• Controls the power to devices not actively being used
• Setup fields allow the users to specify power management options
• Obsolete
• Advanced Configuration and Power Interface (ACPI)
• Based on the ACPI specification creates a robust interface for configuring
motherboard devices Power management
ACPI
• Is basically an interface between the OS, BIOS and the hardware for configuring devices
and implementing power management
• Exposes platform power management features and details to the Operating System
• ACPI defines
• Global States (G States)
• System Sleeping States (S States)
• CPU Power States (C States)
• CPU Performance States (P States)
• CPU Throttling States (T States)
• Device States (D States)
Thank You