<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>UEFI on Kang&#39;s Blog</title>
        <link>https://blog.coderkang.top/en/tags/uefi/</link>
        <description>Recent content in UEFI on Kang&#39;s Blog</description>
        <generator>Hugo -- gohugo.io</generator>
        <language>en</language>
        <lastBuildDate>Wed, 23 Apr 2025 00:00:00 +0000</lastBuildDate><atom:link href="https://blog.coderkang.top/en/tags/uefi/index.xml" rel="self" type="application/rss+xml" /><item>
            <title>BIOS and UEFI: The Boot Journey from History to Modern Era</title>
            <link>https://blog.coderkang.top/en/p/bios_and_uefi/</link>
            <pubDate>Wed, 23 Apr 2025 00:00:00 +0000</pubDate>
            <guid>https://blog.coderkang.top/en/p/bios_and_uefi/</guid>
            <description>&lt;img src=&#34;https://blog.coderkang.top/&#34; alt=&#34;Featured image of post BIOS and UEFI: The Boot Journey from History to Modern Era&#34; /&gt;&lt;p&gt;In the long history of computer development, boot firmware plays a crucial role. From the early BIOS to today&amp;rsquo;s powerful UEFI, it has continuously evolved to meet the growing performance, security, and management needs of hardware.&lt;/p&gt;&#xA;&lt;h2 id=&#34;origin-the-golden-age-of-bios&#34;&gt;Origin: The Golden Age of BIOS&#xD;&#xA;&lt;/h2&gt;&lt;p&gt;In the 1980s, IBM PC introduced BIOS (Basic Input/Output System), which was etched into the motherboard ROM and took on three major responsibilities for computer startup:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;Power-On Self-Test (POST)&lt;/strong&gt;: Detecting whether CPU, memory, graphics cards, keyboards, and other hardware are available.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;MBR Loading and Hardware Interrupt Interface&lt;/strong&gt;: Reading the primary bootloader from the first sector of the hard disk (Master Boot Record, 512 bytes), and providing unified hardware access capabilities through interrupt calls such as INT 13h/INT 10h.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Although the BIOS architecture was simple and highly compatible, it encountered bottlenecks in the following aspects:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Disk Capacity Limitations&lt;/strong&gt;: MBR supports a maximum of 2 TB and up to 4 primary partitions.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Difficult Firmware Updates&lt;/strong&gt;: Driver code is hardcoded in ROM, making it inflexible for extension or patching.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Lack of Graphics and Network Capabilities&lt;/strong&gt;: Only providing the most basic text interface and simple PXE network microcode loading.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;disruption-the-emergence-of-uefi&#34;&gt;Disruption: The Emergence of UEFI&#xD;&#xA;&lt;/h2&gt;&lt;p&gt;Entering the 21st century, Intel initiated the UEFI (Unified Extensible Firmware Interface) alliance, aiming to create a more flexible, extensible, and secure boot environment.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;GPT Partition Support&lt;/strong&gt;: Breaking through TB-level storage limitations, capable of managing hundreds of partitions.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Modular Drivers&lt;/strong&gt;: Extending hardware support through loadable &lt;code&gt;.efi&lt;/code&gt; drivers without flashing ROM.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Modern Graphical Interface&lt;/strong&gt;: Supporting GUI, mouse, and multiple languages for more user-friendly interactions.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Security and Remote Management&lt;/strong&gt;:&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Verifying signatures of boot programs and operating systems at each stage to prevent tampering and rootkits (Secure Boot).&lt;/li&gt;&#xA;&lt;li&gt;Built-in HTTP/FTP clients and UEFI Shell for remote updates or script execution.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;brief-uefi-boot-process&#34;&gt;Brief UEFI Boot Process&#xD;&#xA;&lt;/h3&gt;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;Parallel Firmware Initialization&lt;/strong&gt;: Multi-threaded loading of hardware drivers and firmware components.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Scanning ESP&lt;/strong&gt;: Reading the EFI System Partition (FAT32 format), looking for &lt;code&gt;.efi&lt;/code&gt; files under the &lt;code&gt;\EFI\&lt;/code&gt; path.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Running Boot Manager&lt;/strong&gt;: Executing EFI applications according to the boot option order stored in NVRAM.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Loading Kernel&lt;/strong&gt;: EFI applications (such as &lt;code&gt;bootx64.efi&lt;/code&gt;) boot the operating system kernel and transfer control to it.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h2 id=&#34;comparative-summary&#34;&gt;Comparative Summary&#xD;&#xA;&lt;/h2&gt;&lt;table&gt;&#xA;  &lt;thead&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;th&gt;Feature&lt;/th&gt;&#xA;          &lt;th&gt;BIOS + MBR&lt;/th&gt;&#xA;          &lt;th&gt;UEFI + GPT&lt;/th&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/thead&gt;&#xA;  &lt;tbody&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;Disk Support&lt;/td&gt;&#xA;          &lt;td&gt;≤ 2 TB; max 4 partitions&lt;/td&gt;&#xA;          &lt;td&gt;Theoretically ≥ 9.4 ZB; max 128 partitions&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;Drivers &amp;amp; Extensions&lt;/td&gt;&#xA;          &lt;td&gt;ROM fixed, difficult to update&lt;/td&gt;&#xA;          &lt;td&gt;Dynamic loading of .efi modules, easy to upgrade&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;Boot Interface&lt;/td&gt;&#xA;          &lt;td&gt;Text or minimal graphics&lt;/td&gt;&#xA;          &lt;td&gt;Rich GUI, mouse, multi-language support&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;Secure Boot&lt;/td&gt;&#xA;          &lt;td&gt;Not supported&lt;/td&gt;&#xA;          &lt;td&gt;Supports signature verification, anti-tampering&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;Network Functionality&lt;/td&gt;&#xA;          &lt;td&gt;Only simple PXE boot&lt;/td&gt;&#xA;          &lt;td&gt;Supports HTTP/FTP, remote management&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/tbody&gt;&#xA;&lt;/table&gt;&#xA;&lt;h2 id=&#34;real-world-choices-and-migration&#34;&gt;Real-World Choices and Migration&#xD;&#xA;&lt;/h2&gt;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Legacy Devices &amp;amp; Embedded Systems&lt;/strong&gt;: BIOS+MBR remains effective due to small size and strong compatibility.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Modern PCs &amp;amp; Servers&lt;/strong&gt;: UEFI+GPT is standard, improving boot speed, security, and large disk support.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Dual/Multi-Boot Systems&lt;/strong&gt;: Recommended to standardize on UEFI mode, using BCD for Windows and shim+GRUB EFI for Linux to reduce boot conflicts.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;strong&gt;Migration Key Points&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;BIOS → UEFI&lt;/strong&gt;: Back up data, use Windows &lt;code&gt;mbr2gpt&lt;/code&gt; or Linux &lt;code&gt;gdisk&lt;/code&gt; to convert to GPT, create an ESP ≥100 MB, switch firmware mode, and rebuild the boot.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;UEFI → BIOS&lt;/strong&gt;: Convert GPT to MBR (note the loss of GPT information), rewrite traditional MBR boot code, and adjust firmware to Legacy mode.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;common-boot-issues-and-troubleshooting-techniques&#34;&gt;Common Boot Issues and Troubleshooting Techniques&#xD;&#xA;&lt;/h2&gt;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;Unable to Recognize ESP&lt;/strong&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Check partition type: ESP must be set to &lt;code&gt;EF00&lt;/code&gt; (GPT) or &lt;code&gt;FAT32&lt;/code&gt; (MBR).&lt;/li&gt;&#xA;&lt;li&gt;Verify files: Confirm that &lt;code&gt;\EFI\BOOT\BOOTX64.EFI&lt;/code&gt; (or corresponding platform) exists.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Secure Boot Errors&lt;/strong&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Disable or configure: Enter firmware settings, temporarily disable Secure Boot, or import the correct public keys (PK/KEK).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Missing Boot Options&lt;/strong&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Use &lt;code&gt;efibootmgr&lt;/code&gt; (Linux) or &lt;code&gt;bcdedit&lt;/code&gt; (Windows) to recreate boot entries.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Unable to Boot After Switching Disk Mode&lt;/strong&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Check controller mode: After switching IDE/RAID/AHCI, kernel modules and driver signatures need to be updated synchronously.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h2 id=&#34;advanced-customization-and-extensions&#34;&gt;Advanced Customization and Extensions&#xD;&#xA;&lt;/h2&gt;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;UEFI Shell Automation&lt;/strong&gt;: Write &lt;code&gt;.nsh&lt;/code&gt; scripts to automatically mount partitions, perform self-tests, or remotely download firmware updates.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Driver Injection&lt;/strong&gt;: Place vendor &lt;code&gt;.efi&lt;/code&gt; drivers in ESP to extend native support for NVMe, RAID controllers, etc.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Variable Management&lt;/strong&gt;: Use &lt;code&gt;dmpstore&lt;/code&gt; (Shell) or &lt;code&gt;efivar&lt;/code&gt; tools to read and write firmware variables, enabling automated startup or log collection.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Open Firmware Alternatives&lt;/strong&gt;: Such as TianoCore (OVMF), Coreboot, can be customized for size and functionality as needed.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;</description>
        </item></channel>
</rss>
