简体   繁体   中英

How does UEFI boot mode boot flows?

The expression of this question is same as What is UEFI's boot sequence? , but it doesn't seem what I want. I'd like to know UEFI sequence in instruction perspective.

For example, in case of BIOS boot mode, in simplified fashion,

  • Computer power is on.
  • Content of BIOS chip attached to motherboard performs the POST(Power On Self Test) process.
  • BIOS searches for MBR(Master Boot Record)s, which has boot signature in preset boot device order.
  • If MBR with boot signature is found, load the first sector (512 bytes) of the device to DRAM, address 0x7C00. This loaded sector (512 bytes) becomes the "first stage bootloader".
  • BIOS transfers control to this first stage bootloader. In other words, opcode located at physical memory address 0x7C00 in DRAM is executed.

图片

Related article: https://neosmart.net/wiki/mbr-boot-process/

But,

in case of UEFI, I'm having trouble grasping this sequence.

I've already glanced UEFI spec documentation and OS Dev UEFI part.

UEFI: https://uefi.org/sites/default/files/resources/UEFI_Spec_2_8_final.pdf

OS Dev: https://wiki.osdev.org/UEFI

It seems this efi_main() function works as the point equivalent to 0x7C00 in BIOS mode. But how?

Is UEFI firmware doing something like

jmp efi_main

after performing a series of jobs?

Q1. How is UEFI boot mode flows?

Q2. Is there a good UEFI example or tutorial like brokenthorn that of BIOS based?

PS

I've seen the news (which years have passed already) that Intel removes BIOS support by 2020.

https://www.anandtech.com/show/12068/intel-to-remove-bios-support-from-uefi-by-2020

It says

Once CSM is removed, the new platforms will be unable to run 32-bit operating systems, unable to use related software (at least natively), and unable to use older hardware, such as RAID HBAs (and therefore older hard drives that are connected to those HBAs), network cards, and even graphics cards that lack UEFI-compatible vBIOS (launched before 2012 – 2013)

Q3. Doesn't it mean that everything related to BIOS booting (first stage bootloader at 0x7C00 and BIOS interrupts and etc) becomes deprecated?

Q1:

The UEFI boot sequence is devided in multiple "phases", you can find some basic information about each phase here .

To load the SEC phase, the SecCore is located at memory address 0xFFFFFFF0 (this address is mapped to the UEFI Flash Memory) and therefore is the target of the reset vector.

After the dxe phase multiple UEFI Applications can be called before the operating system is loaded.

Q2:

If you want to get a basic understanding of how UEFI works i would recommend the book "Beyond BIOS".

If you want to learn how to write UEFI Drivers/Applications i would recommend to have a look at some of the sample applications in the EDK2 repository ( and how to build Applications with it ), more details can be found in the specification.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM