10.01.2015 Views

Presentation

Presentation

Presentation

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Bios and UEFI<br />

IS3313 Systems Software


Vocabulary<br />

• BIOS = Basic Input Output System<br />

• UEFI = Unified Extensible Firmware Interface<br />

• POST= Power On Self Test<br />

• BR = Boot Record (aka MBR)<br />

• BC = Boot Code (aka MBC)<br />

• GUID = Globally Unique Identifier<br />

• GPT = GUID Partition Table


BIOS<br />

‣ Instructions used to start the computer from a cold<br />

start. (power off to power on).<br />

‣ The BIOS instructions are written on non-volatile<br />

RAM.<br />

‣ EEP-ROM is the common media choice for the BIOS,<br />

installed on the motherboard.<br />

‣ The BIOS instructions are based on the chip-set<br />

installed on the motherboard


BIOS<br />

<br />

The BIOS primary functions are<br />

<br />

<br />

Issue the instructions for starting the hardware at<br />

boot time.<br />

Load the OS from the boot device.


Hardware Boot Sequence<br />

<br />

<br />

<br />

Turn on the power switch<br />

<br />

All memory and cache is empty at startup.<br />

A reset signal is generated by the chipset to the CPU<br />

until the power is ready.<br />

The CPU powers up and reads address xFFFF0 from<br />

the ROM. This contains a jump instruction to the start<br />

of the BIOS instructions.


POST<br />

<br />

The POST (Power On Self Test)<br />

<br />

<br />

Provide power to the motherboard-speaker<br />

<br />

This allows error-code signals to be broadcast by the<br />

mobo-speaker when errors are detected<br />

Test if components on the motherboard are receiving<br />

power and functioning as intended.


Hardware Boot Sequence<br />

<br />

<br />

<br />

Video and keyboard are activated early in the boot<br />

sequence. (video start instruction in ROM address is<br />

xC000)<br />

Other devices are activated like the disk drives,<br />

optical drives, sound-card, NIC, USB bus, etc.<br />

BIOS setup becomes available for the user.


BIOS: User Interface<br />

• There is a curses based user interface that allows:<br />

a) Selection of a boot device<br />

b) Setting the system clock<br />

c) Configuring hardware (includes enabling or disabling some<br />

devices)<br />

d) Setting passwords for booting, & the UI, etc.<br />

e) Also shows access to some system config information:<br />

memory size, disk size, etc.


BIOS Completion<br />

<br />

<br />

Memory count<br />

Search for the OS Boot device<br />

<br />

<br />

<br />

<br />

Optical drive<br />

USB device<br />

Network device<br />

HDD


HDD Boot Sequence<br />

If the HDD is the boot device then, ...


HDD Boot Sequence<br />

<br />

<br />

The BR is read from the first cylinder, first track, first<br />

sector.<br />

The BR contains the BC (boot code) and a partition<br />

table.


HDD Boot Sequence<br />

<br />

The boot code will do one of two things when<br />

executed:<br />

1. Load a boot loader (GRUB, LILO, MS-BM)<br />

1. Allows one to choose from different OSes or different<br />

versions of the same OS.<br />

2. Load the OS if no boot loader is available.


Partition Table<br />

<br />

The PT contains information about 4 primary<br />

partitions.<br />

<br />

<br />

<br />

<br />

Only one of the 4 primary partitions is designated as<br />

the active partition<br />

The active partition contains the OS for booting.<br />

One of the 4 primary partitions can be designated as<br />

the extended partition.<br />

The extended partition can be divided into additional<br />

logical partitions.


BIOS/UEFI<br />

• In the beginning there was the BIOS<br />

• Intel creates the Extensible Firmware Interface in<br />

1998<br />

• UEFI now supersedes EFI<br />

– UEFI can run on-top-of the traditional BIOS or in place<br />

of the BIOS.


UEFI<br />

• BIOS is often used to describe UEFI<br />

• Modern OSes allow backward compatibility between<br />

the traditional BIOS boot record and the UEFI GPT.


Unified Extensible Firmware Interface (UEFI)<br />

• The interface defined by the EFI specification includes data tables<br />

that contain platform information, and boot and runtime services<br />

that are available to the OS loader and OS. UEFI firmware provides<br />

several technical advantages over a traditional BIOS system<br />

• Ability to boot from large disks (over 2 TiB) with a GUID Partition<br />

Table, GPT<br />

• CPU-independent architecture<br />

• CPU-independent drivers<br />

• Flexible pre-OS environment, including network capability<br />

• Modular design


GPT<br />

• Globally Unique Identifier – This is required to allow<br />

a file system to exceed 2TB.<br />

• The 2TB limit is a result of limitations of the original<br />

BR partition table<br />

• (Each partition has only16 bytes of storage in the<br />

partition table.)


BIOS & UEFI<br />

Compatibility Support Module<br />

BIOS Replacement Drivers


UEFI Boot


UEFI Features<br />

• EFI defines two types of services: boot services and runtime services.<br />

Boot services are only available while the firmware owns the<br />

platform (before the ExitBootServices call). Boot services include text<br />

and graphical consoles on various devices, and bus, block and file<br />

services. Runtime services are still accessible while the operating<br />

system is running; they include services such as date, time and<br />

NVRAM access.<br />

• UEFI variables provide a way to store data, in particular non-volatile<br />

data, that is shared between platform firmware and operating<br />

systems or UEFI applications. Variable namespaces are identified by<br />

GUIDs, and variables are key/value pairs.<br />

• UEFI provides device-independent time services. Time services<br />

include support for timezone and daylight saving fields, which allow<br />

the hardware real-time clock to be set to local time or UTC.


UEFI Features<br />

• Protocols<br />

• EFI defines protocols as set of software interfaces used for communication between<br />

two binary modules. All EFI drivers must provide services to others via protocols.<br />

• Device drivers<br />

• In addition to standard architecture-specific device drivers, the EFI specification<br />

provides for a processor-independent device driver environment, called EFI Byte<br />

Code or EBC.<br />

• OS can rely on EFI for basic graphics and network functions until OS specific drivers<br />

are loaded.<br />

• Graphics features<br />

• The EFI specification defined a UGA (Universal Graphic Adapter) protocol as a way to<br />

support device-independent graphics.<br />

• UEFI 2.1 defined a "Human Interface Infrastructure" (HII) to manage user input,<br />

localized strings, fonts, and forms (in the HTML sense). These enable OEMs or IBVs to<br />

design graphical interfaces for pre-boot configuration. UEFI itself does not define a<br />

user interface.<br />

• Most early UEFI implementations were console-based, but as early as 2007 some<br />

implementations featured a graphical user interface


UEFI Booting<br />

• CSM booting<br />

• For backwards compatibility, most of the UEFI implementations on PC-class machines<br />

also support booting in legacy BIOS mode from MBR-partitioned disks, through the<br />

Compatibility Support Module (CSM)<br />

• Network booting<br />

• UEFI specification includes support for booting over network through the Preboot<br />

eXecution Environment (PXE). Underlying network protocols include Internet<br />

Protocol (IPv4 and IPv6), User Datagram Protocol (UDP), Dynamic Host Configuration<br />

Protocol (DHCP) and Trivial File Transfer Protocol (TFTP).<br />

• Included is also support for boot images remotely stored on storage area networks<br />

(SANs), with Internet Small Computer System Interface (iSCSI) and Fibre Channel over<br />

Ethernet (FCoE)<br />

• Secure boot<br />

• The UEFI 2.2 specification adds a protocol known as Secure boot, which can secure<br />

the boot process by preventing the loading of drivers or OS loaders that are not<br />

signed with an acceptable digital signature. Secure boot is supported by Windows 8,<br />

Windows Server 2012, and selected Linux distributions.


CSM and Shell<br />

• The Compatibility Support Module (CSM) is a component of the UEFI<br />

firmware that provides legacy BIOS compatibility by emulating a BIOS<br />

environment, allowing legacy operating systems and some option<br />

ROMs that do not support UEFI to still be used.<br />

• The UEFI shell<br />

• UEFI provides a shell environment, which can be used to execute other UEFI<br />

applications, including UEFI boot loaders.<br />

• Apart from that, commands available in the UEFI shell can be used for<br />

obtaining various other information about the system or the firmware — like<br />

getting the memory map (memmap), modifying boot manager variables<br />

(bcfg), running partitioning programs (diskpart), loading UEFI drivers, editing<br />

text files (edit) etc.<br />

• Methods used for launching UEFI shell depend on the manufacturer and<br />

model of the system motherboard.


UEFI booting<br />

• The UEFI specification defines a "boot manager", a firmware policy engine<br />

that is in charge of loading the operating system loader and all necessary<br />

drivers.<br />

• The boot configuration is controlled by a set of global NVRAM variables,<br />

including boot variables that indicate the paths to the loaders.<br />

• Operating system loaders are a class of the UEFI applications. As such, they<br />

are stored as files on a file system that can be accessed by the firmware,<br />

called EFI System partition (ESP).<br />

• UEFI does not rely on a boot sector, although ESP provides space for it as<br />

part of the backwards compatibility.[28]<br />

• UEFI booting from GPT disks is commonly called UEFI-GPT.<br />

• Boot loaders can also be automatically detected by the UEFI firmwares, to<br />

enable booting from removable devices.]<br />

• It is common for UEFI firmware to include a user interface to the boot<br />

manager, to allow the user to select and load the operating system among<br />

the possible options.


UEFI and Windows 8<br />

POST<br />

OS Initialization<br />

Service & App<br />

Initialization<br />

POST<br />

Service &<br />

App Init<br />

Looks and feels like a regular shutdown / boot<br />

Uses hibernate technology to cache the core system<br />

Enabled by default<br />

Delivering considerable improvements<br />

Boots more than twice-as-fast on SSD based netbooks, including POST<br />

Need partners to continue work to reduce POST times


Advantages of UEFI vs. BIOS<br />

Interface Legacy BIOS UEFI<br />

Architecture x86 / X64 only Agnostic<br />

Mode 16 bit (real mode) 32/64 bit<br />

Boot Partition MBR (2.2 TB limit) GPT (9.4 ZB* limit)<br />

Runtime Services No Yes<br />

Driver model No Yes<br />

POST Graphics VGA Graphical Output Protocol<br />

(GOP)<br />

* A zettabyte is equal to 1B terabytes. The total amount of global data was expected to pass 1.2 ZB sometime during 2010.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!