The Migration from Legacy BIOS to UEFI Firmware

Source: Electronic Design

The transition from legacy BIOS to UEFI firmware is something many embedded developers now need to deal with as new hardware supports UEFI.
To understand the transition from legacy BIOS to UEFI firmware, it’s best to begin with a review of a decades-old system—the 1983 IBM-compatible PC—and continue with a study of its successor technologies. These include USB, hard disks greater than 100 MB, RAM sizes greater than 640k, high-speed Ethernet networking, CD-ROMs, and other unforeseen technologies.
The transition to UEFI firmware from legacy BIOS came at a time when it was long overdue. As the rest of the technological world was developing projects like OpenFirmware, the x86 world still used a technology rooted in the original IBM-compatible PC. Support for new technologies was crammed into an already-crowded memory space. Legacy BIOS executed a majority of its code in real mode. In this execution model, the total amount of memory that could be referenced and used was limited to 1 MB. Any plug-in cards designed as bootable, network, or RAID cards were required to fit into an outdated memory model. The 1-MB limitation resulted in a mere handful of supported external boot media.
In contrast to projects like OpenFirmware, legacy BIOS has no governing body. The original IBM PC BIOS interfaces relied on a set of interrupt routines to complete basic tasks. Interrupts ranged from 0x10 to 0x1F, and were originally planned to handle one device each. Examples include Interrupt 0x10 for video, 0x13 for fixed-disk access, 0x16 for keyboard input, and 0x14 serial -port accesses. As the PC evolved to incorporate new technologies, these interrupts were expanded to provide services for the new hardware. Sometimes these changes fit in cleanly, but often they were clunky additions to the original codebase.
An obvious example of an over-expanded interrupt is interrupt 0x15, which ultimately became a dumping ground of manufacturer-specific features. Having non-standard interrupts led to fragmentation and difficulty for vendors attempting to create operating systems (OSs) for universal booting.
Legacy BIOS: Limitations, Less-Supportive Modern Coding Languages
One significant challenge with legacy BIOS is that it was originally defined by implementation, as opposed to a specification within a modular code base. Legacy BIOS implementations were created with the assumption that the platform hardware would remain constant; however, the introduction of more powerful processor technology required handwritten workarounds to its assembly code.
Related
Bye Bye BIOS. Hello UEFI
Windows 8 Goes Far Beyond The Typical Operating-System Update
Three Pivotal Features Differentiate Bootloading Options
UEFI specifications were developed to standardize the code base and take modularity into account. Using API abstraction layers and C code, UEFI can be fully optimized and maintain compatibility across frameworks.
The Inception of UEFI Technology
When Intel developed a new instruction set for what would eventually become its Itanium product line, a decision was made to develop a new initialization and boot infrastructure. This included a modernized programming language that would allow a compiler to properly optimize the code for a specific processor or architecture. The new framework was dubbed the “Extensible Firmware Interface,” and thus EFI was born.
Even though Itanium never reached the adoption level of x86-based architectures, EFI was seen as a substantial improvement over legacy BIOS and a great way to bring x86 firmware into the modern era. As Intel continued development of EFI, it expanded access of the specification. The Unified Extensible Firmware Interface (UEFI) Forum was created so that hardware vendors, silicon vendors, independent BIOS vendors, and OS vendors could collaborate in the development of the first UEFI specifications.
From the beginning, UEFI was developed with modular architecture in mind. The building blocks were developed with the idea that they would interact with, and build upon, each other’s functionality. The key to creating such an architecture is to look for commonality between very different pieces of hardware.
For example, there are various ways to retrieve data from a Serial ATA (SATA) interface or a Universal Serial Bus (USB) interface. However, a commonality exists in media-device access methods, as both rely on simple block access. These basic abstraction interfaces enable other software to use them as a basic service. It doesn’t matter where the original data resides. Using these common interfaces allows an OS to reside and boot from any type of media and greatly simplifies their standard boot-loader code.
UEFI-Standardized Features Simplify Manufacturing, Software Writing
With the standardization of UEFI, OEMs can create notably useful production-line tools. For example, in the pre-UEFI era, OEMs had to write specialized software to configure each platform they produced before it could be sold. Using UEFI architecture, OEMs are able to write a general piece of software that can be used to initialize a wide range of systems in the factory. It’s also possible to write a general set of diagnostic tools for use in the factory, which allows on-site testing of all hardware and software delivered with a platform. The standardization of interfaces enables the creation of platform-agnostic software.
UEFI architecture is designed to facilitate code reuse, providing an extensible solution that’s portable to multiple architectures. The UEFI specifications have been used in various ARM architectures, allowing OS vendors to make a common boot loader for both x86 and ARM systems. Given that UEFI code is commonly written in C coding language, if the OS vendor properly wrote its boot loader, the only change necessary is to use a different compiler for the target processor architecture.
Expanding UEFI’s Role in Next-Gen Devices
The latest technologies and devices are more easily supported within the UEFI framework than within the legacy BIOS methodology. In the UEFI driver model, there are device drivers and bus drivers. Device drivers use their parent bus driver to be able to interact with the device. This allows a device driver to work on any bus for which a bus driver has been developed. Incorporating the same support in legacy BIOS would require adding bus initialization code and duplicating the device driver code for each new bus. By reducing the complexity in the bus drivers and the core services, many different lightweight drivers can be created in a system with little overhead. The minor overhead allows for expansion of UEFI firmware to support devices like fingerprint readers, USB cameras, touchscreens, and Wi-Fi with limited effort.
Download this article in .PDF format
This file type includes high resolution graphics and schematics when applicable.
Sample implementations of UEFI are available at www.tianocore.org. The UEFI and subsequent specifications are hosted at www.uefi.org. As new technologies emerge, the UEFI Forum’s workgroup members will continue to design for forward compatibility new interfaces. To join the Forum and contribute to future iterations of the UEFI specification, visit UEFI.org/join.

Trusted for What’s Critical

AMI is your low-risk partner for high-stakes innovation. Our firmware solutions drive performance, reliability and time to market when it matters most.

When you work with AMI, you get deep expertise, proven stability and hands-on support throughout your development journey. Contact us to learn how AMI firmware solutions can help you reduce risk, simplify complexity and scale with confidence.

DOWNLOAD LICENSE AGREEMENT

NOTICE SPECIFIC TO SOFTWARE AVAILABLE ON THIS WEBSITE (ami.com) OR ANY OTHER AMI OWNED, OPERATED, LICENSED OR CONTROLLED SITE

 Any software that is made available to download from this server ("Software") is the copyrighted work of AMI and/or its suppliers. Use of the Software is governed by the terms of the end user license agreement, if any, which accompanies or is included with the Software ("License Agreement"). An end user will be unable to install any Software that is accompanied by or includes a License Agreement, unless he or she first agrees to the License Agreement terms.

 The Software is made available for downloading solely for use by end users according to the License Agreement. Any reproduction or redistribution of the Software not in accordance with the License Agreement is expressly prohibited by law and may result in severe civil and criminal penalties. Violators will be prosecuted to the maximum extent possible.

 WITHOUT LIMITING THE FOREGOING, COPYING OR REPRODUCTION OF THE SOFTWARE TO ANY OTHER SERVER OR LOCATION FOR FURTHER REPRODUCTION OR REDISTRIBUTION IS EXPRESSLY PROHIBITED, UNLESS SUCH REPRODUCTION OR REDISTRIBUTION IS EXPRESSLY PERMITTED BY THE LICENSE AGREEMENT ACCOMPANYING SUCH SOFTWARE.

 THE SOFTWARE IS WARRANTED, IF AT ALL, ONLY ACCORDING TO THE TERMS OF THE LICENSE AGREEMENT. EXCEPT AS WARRANTED IN THE LICENSE AGREEMENT, AMI HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS WITH REGARD TO THE SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT.

 FOR YOUR CONVENIENCE, AMI MAY MAKE AVAILABLE ON THIS SERVICE OR IN ITS SOFTWARE PRODUCTS, TOOLS AND UTILITIES FOR USE AND/OR DOWNLOAD. AMI DOES NOT MAKE ANY ASSURANCES WITH REGARD TO THE ACCURACY OF THE RESULTS OR OUTPUT THAT DERIVES FROM SUCH USE OF ANY SUCH TOOLS AND UTILITIES. PLEASE RESPECT THE INTELLECTUAL PROPERTY RIGHTS OF OTHERS WHEN USING THE TOOLS AND UTILITIES MADE AVAILABLE ON THIS SERVICE OR IN AMI SOFTWARE PRODUCTS.

 RESTRICTED RIGHTS LEGEND. Any Software which is downloaded from this Server (ami.com) any other AMI owned, operated, licensed or controlled site for or on behalf of the United States of America, its agencies and/or instrumentalities ("U.S. Government"), is provided with Restricted Rights. Use, duplication, or disclosure by the U.S. Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software clause at DFARS 252.227-7013 or subparagraphs (c)(1) and (2) of the Commercial Computer Software - Restricted Rights at 48 CFR 52.227-19, as applicable. Manufacturer is AMI 3095 Satellite Boulevard, Building 800, Suite 425, Duluth, GA 30096.

NOTICE SPECIFIC TO DOCUMENTS AVAILABLE ON THIS WEBSITE

 Permission to use Documents (such as white papers, press releases, datasheets and FAQs) from this server (ami.com) any other AMI owned, operated, licensed or controlled site ("Server") is granted, provided that (1) the below copyright notice appears in all copies and that both the copyright notice and this permission notice appear, (2) use of such Documents from this Server is for informational and non-commercial or personal use only and will not be copied or posted on any network computer or broadcast in any media and (3) no modifications of any Documents are made. Educational institutions ( specifically K-12, universities and state community colleges) may download and reproduce the Documents for distribution in the classroom. Distribution outside the classroom requires express written permission. Use for any other purpose is expressly prohibited by law and may result in severe civil and criminal penalties. Violators will be prosecuted to the maximum extent possible.

 Documents specified above do not include the design or layout of the ami.com website or any other AMI owned, operated, licensed or controlled site. Elements of AMI websites are protected by trade dress, trademark, unfair competition and other laws and may not be copied or imitated in whole or in part. No logo, graphic, sound or image from any AMI website may be copied or retransmitted unless expressly permitted by AMI.

 AMI AND/OR ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THE INFORMATION CONTAINED IN THE DOCUMENTS AND RELATED GRAPHICS PUBLISHED ON THIS SERVER FOR ANY PURPOSE. ALL SUCH DOCUMENTS AND RELATED GRAPHICS ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. AMI AND/OR ITS RESPECTIVE SUPPLIERS HEREBY DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THIS INFORMATION, INCLUDING ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL AMI AND/OR ITS RESPECTIVE SUPPLIERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF INFORMATION AVAILABLE FROM THIS SERVER.

 THE DOCUMENTS AND RELATED GRAPHICS PUBLISHED ON THIS SERVER COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION HEREIN. AMI AND/OR ITS RESPECTIVE SUPPLIERS MAY MAKE IMPROVEMENTS AND/OR CHANGES IN THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED HEREIN AT ANY TIME.

NOTICES AND PROCEDURE FOR MAKING CLAIMS OF COPYRIGHT INFRINGEMENT

 Pursuant to Title 17, United States Code, Section 512(c)(2), notifications of claimed copyright infringement should be sent to Service Provider's Designated Agent. ALL INQUIRIES NOT RELEVANT TO THE FOLLOWING PROCEDURE WILL NOT RECEIVE A RESPONSE.

 See Notice and Procedure for Making Claims of Copyright Infringement.

LINKS TO THIRD PARTY SITES

 THE LINKS IN THIS AREA WILL LET YOU LEAVE AMI'S SITE. THE LINKED SITES ARE NOT UNDER THE CONTROL OF AMI AND AMI IS NOT RESPONSIBLE FOR THE CONTENTS OF ANY LINKED SITE OR ANY LINK CONTAINED IN A LINKED SITE, OR ANY CHANGES OR UPDATES TO SUCH SITES. AMI IS NOT RESPONSIBLE FOR WEBCASTING OR ANY OTHER FORM OF TRANSMISSION RECEIVED FROM ANY LINKED SITE. AMI IS PROVIDING THESE LINKS TO YOU ONLY AS A CONVENIENCE, AND THE INCLUSION OF ANY LINK DOES NOT IMPLY ENDORSEMENT BY AMI OF THE SITE.

UNSOLICITED IDEA SUBMISSION POLICY

 Neither AMI, nor its employees, agents and/or subsidiaries, shall accept or consider unsolicited ideas, including but not limited to ideas for new advertising campaigns, new promotions, new products or technologies, processes, materials, marketing plans or new product names. Submission of any original creative artwork, samples, demos, or other works to AMI is expressly prohibited. In the event a submission including unsolicited materials of any nature is received by AMI, said submission shall be destroyed and AMI shall not be liable for any direct or consequential damages suffered by the sender, nor shall AMI be under any obligation to treat such material as confidential or proprietary. It is expressly understood that the rationale for AMI's policy on unsolicited idea submission is to prevent a third party from making a claim of infringement against AMI on the basis of an idea, product, or other material that is developed by AMI, that may be similar to or the same as an idea, product, or other material contained in an unsolicited submission that may have been submitted to and/or received by AMI.

FEEDBACK AND INFORMATION

 ANY FEEDBACK YOU PROVIDE AT THIS SITE SHALL BE DEEMED TO BE NON-CONFIDENTIAL. AMI IS FREE TO USE SUCH INFORMATION ON AN UNRESTRICTED BASIS.

Terms & Conditions