You are on page 1of 26

Bios and UEFI

IS3313 Systems Software


Vocabulary
BIOS = Basic Input Output System
UEFI = Unified Extensible Firmware Interface
POST= Power On Self Test
BR = Boot Record (aka MBR)
BC = Boot Code (aka MBC)
GUID = Globally Unique Identifier
GPT = GUID Partition Table
BIOS
Instructions used to start the computer from a cold
start. (power off to power on).
The BIOS instructions are written on non-volatile

RAM.
EEP-ROM is the common media choice for the BIOS,
installed on the motherboard.
The BIOS instructions are based on the chip-set
installed on the motherboard
BIOS
The BIOS primary functions are
Issue the instructions for starting the hardware at
boot time.
Load the OS from the boot device.
Hardware Boot Sequence
Turn on the power switch
All memory and cache is empty at startup.
A reset signal is generated by the chipset to the CPU
until the power is ready.
The CPU powers up and reads address xFFFF0 from

the ROM. This contains a jump instruction to the start


of the BIOS instructions.
POST
The POST (Power On Self Test)
Provide power to the motherboard-speaker
This allows error-code signals to be broadcast by the
mobo-speaker when errors are detected
Test if components on the motherboard are receiving
power and functioning as intended.
Hardware Boot Sequence
Video and keyboard are activated early in the boot
sequence. (video start instruction in ROM address is
xC000)
Other devices are activated like the disk drives,

optical drives, sound-card, NIC, USB bus, etc.


BIOS setup becomes available for the user.
BIOS: User Interface
There is a curses based user interface that allows:
a) Selection of a boot device
b) Setting the system clock
c) Configuring hardware (includes enabling or disabling some
devices)
d) Setting passwords for booting, & the UI, etc.
e) Also shows access to some system config information:
memory size, disk size, etc.
BIOS Completion
Memory count
Search for the OS Boot device
Optical drive
USB device
Network device
HDD
HDD Boot Sequence
If the HDD is the boot device then, ...
HDD Boot Sequence
The BR is read from the first cylinder, first track, first
sector.
The BR contains the BC (boot code) and a partition

table.
HDD Boot Sequence
The boot code will do one of two things when
executed:
1. Load a boot loader (GRUB, LILO, MS-BM)
1. Allows one to choose from different OSes or different
versions of the same OS.
2. Load the OS if no boot loader is available.
Partition Table
The PT contains information about 4 primary
partitions.
Only one of the 4 primary partitions is designated as
the active partition
The active partition contains the OS for booting.
One of the 4 primary partitions can be designated as
the extended partition.
The extended partition can be divided into additional
logical partitions.
BIOS/UEFI
In the beginning there was the BIOS
Intel creates the Extensible Firmware Interface in
1998
UEFI now supersedes EFI
UEFI can run on-top-of the traditional BIOS or in place
of the BIOS.
UEFI
BIOS is often used to describe UEFI
Modern OSes allow backward compatibility between
the traditional BIOS boot record and the UEFI GPT.
Unified Extensible Firmware Interface (UEFI)

The interface defined by the EFI specification includes data tables


that contain platform information, and boot and runtime services
that are available to the OS loader and OS. UEFI firmware provides
several technical advantages over a traditional BIOS system
Ability to boot from large disks (over 2 TiB) with a GUID Partition
Table, GPT
CPU-independent architecture
CPU-independent drivers
Flexible pre-OS environment, including network capability
Modular design
GPT
Globally Unique Identifier This is required to allow
a file system to exceed 2TB.
The 2TB limit is a result of limitations of the original
BR partition table
(Each partition has only16 bytes of storage in the
partition table.)
BIOS & UEFI

Compatibility Support Module


BIOS Replacement Drivers
UEFI Boot
UEFI Features

EFI defines two types of services: boot services and runtime services.
Boot services are only available while the firmware owns the
platform (before the ExitBootServices call). Boot services include text
and graphical consoles on various devices, and bus, block and file
services. Runtime services are still accessible while the operating
system is running; they include services such as date, time and
NVRAM access.
UEFI variables provide a way to store data, in particular non-volatile
data, that is shared between platform firmware and operating
systems or UEFI applications. Variable namespaces are identified by
GUIDs, and variables are key/value pairs.
UEFI provides device-independent time services. Time services
include support for timezone and daylight saving fields, which allow
the hardware real-time clock to be set to local time or UTC.
UEFI Features

Protocols
EFI defines protocols as set of software interfaces used for communication between
two binary modules. All EFI drivers must provide services to others via protocols.
Device drivers
In addition to standard architecture-specific device drivers, the EFI specification
provides for a processor-independent device driver environment, called EFI Byte
Code or EBC.
OS can rely on EFI for basic graphics and network functions until OS specific drivers
are loaded.
Graphics features
The EFI specification defined a UGA (Universal Graphic Adapter) protocol as a way to
support device-independent graphics.
UEFI 2.1 defined a "Human Interface Infrastructure" (HII) to manage user input,
localized strings, fonts, and forms (in the HTML sense). These enable OEMs or IBVs to
design graphical interfaces for pre-boot configuration. UEFI itself does not define a
user interface.
Most early UEFI implementations were console-based, but as early as 2007 some
implementations featured a graphical user interface
UEFI Booting

CSM booting
For backwards compatibility, most of the UEFI implementations on PC-class machines
also support booting in legacy BIOS mode from MBR-partitioned disks, through the
Compatibility Support Module (CSM)
Network booting
UEFI specification includes support for booting over network through the Preboot
eXecution Environment (PXE). Underlying network protocols include Internet
Protocol (IPv4 and IPv6), User Datagram Protocol (UDP), Dynamic Host Configuration
Protocol (DHCP) and Trivial File Transfer Protocol (TFTP).
Included is also support for boot images remotely stored on storage area networks
(SANs), with Internet Small Computer System Interface (iSCSI) and Fibre Channel over
Ethernet (FCoE)
Secure boot
The UEFI 2.2 specification adds a protocol known as Secure boot, which can secure
the boot process by preventing the loading of drivers or OS loaders that are not
signed with an acceptable digital signature. Secure boot is supported by Windows 8,
Windows Server 2012, and selected Linux distributions.
CSM and Shell

The Compatibility Support Module (CSM) is a component of the UEFI


firmware that provides legacy BIOS compatibility by emulating a BIOS
environment, allowing legacy operating systems and some option
ROMs that do not support UEFI to still be used.
The UEFI shell
UEFI provides a shell environment, which can be used to execute other UEFI
applications, including UEFI boot loaders.
Apart from that, commands available in the UEFI shell can be used for
obtaining various other information about the system or the firmware like
getting the memory map (memmap), modifying boot manager variables
(bcfg), running partitioning programs (diskpart), loading UEFI drivers, editing
text files (edit) etc.
Methods used for launching UEFI shell depend on the manufacturer and
model of the system motherboard.
UEFI booting

The UEFI specification defines a "boot manager", a firmware policy engine


that is in charge of loading the operating system loader and all necessary
drivers.
The boot configuration is controlled by a set of global NVRAM variables,
including boot variables that indicate the paths to the loaders.
Operating system loaders are a class of the UEFI applications. As such, they
are stored as files on a file system that can be accessed by the firmware,
called EFI System partition (ESP).
UEFI does not rely on a boot sector, although ESP provides space for it as
part of the backwards compatibility.[28]
UEFI booting from GPT disks is commonly called UEFI-GPT.
Boot loaders can also be automatically detected by the UEFI firmwares, to
enable booting from removable devices.]
It is common for UEFI firmware to include a user interface to the boot
manager, to allow the user to select and load the operating system among
the possible options.
UEFI and Windows 8
Service & App
POST OS Initialization
Initialization

Service &
POST
App Init

Looks and feels like a regular shutdown / boot


Uses hibernate technology to cache the core system
Enabled by default
Delivering considerable improvements
Boots more than twice-as-fast on SSD based netbooks, including POST
Need partners to continue work to reduce POST times
Advantages of UEFI vs. BIOS

Interface Legacy BIOS UEFI


Architecture x86 / X64 only Agnostic
Mode 16 bit (real mode) 32/64 bit
Boot Partition MBR (2.2 TB limit) GPT (9.4 ZB* limit)
Runtime Services No Yes

Driver model No Yes


POST Graphics VGA Graphical Output Protocol
(GOP)
* A zettabyte is equal to 1B terabytes. The total amount of global data was expected to pass 1.2 ZB sometime during 2010.

You might also like