UEFI规范导读

本来应该昨天晚上就更新博客的,结果博客写到一半机器竟然死机了!我是在Chrome浏览器里写的,并没有保存。这下可把我的信心打击了大半,于是在无心情继续下去。今天早上睡不着,爬起来想想还是要对得起自己,继续写~~不过打算换个话题吧,本来打算写EDK的入门介绍,可害怕写那个话题是不是在出个什么事情。改写一个吧,还是为初学者写,今天的话题是“UEFI规范导读”。


UEFI规范

 

UEFI开发的兄弟们很定要看这个文档,这是UEFIlegacy最大的不同。UEFI规范讲述了系统固件应该怎么做,都应该包含哪些部分,有那些软件接口,固件必须实现的驱动接口等。UEFI规范可以说是一个大的集合,把一些分属不同范畴的东西整合在一起。看得懂UEFI规范,能够使用UEFI规范对日后的工作有很大的帮助。

UEFI规范是由UEFI组织负责制定的。最新的经过UEFI组织批准的规范可以从http://www.uefi.org/specs/ 下载,目前最新的公布的规范版本是2.2。但是我不建议大家直接使用2.2版本的规范,因为目前流行的版本还是2.0以及2.1。如果以兼容性为目的开发,那么还是使用版本2.0作为参考的应用来源好一些。

阅读UEFI规范,首先要知道它都包括那些内容,其次才能有针对性的去学习。否则看着那上千页的文本,一定会觉得无从下手。做一件事情,一定首先要有计划。读规范亦如此。

 

UEFI规范第一章 Introduction

 

这一章是整个UEFI的设计思想进行概要性介绍,提到UEFI规范的设计目标。对规范本身的一些名词术语的用法,文本的编排等做了一些说明。并且还简单讲了讲对legacy系统的兼容性问题。这一章属于总体性的说明,我强力建议大家首先通读这一章。

 

UEFI规范第二章 Overview

 

这一章是对UEFI BIOS的一些基本组件的介绍,以及一些基本概念(如HandleProtocol)的介绍。还明确规定了一个UEFI系统固件应该至少具备什么条件。这些都是基本性的知识,必须掌握。这一章必须仔细学习,不得跳过。否则底下谈的很多概念根本无法知晓。

 

UEFI规范第三章 Boot Manager

 

这一章也比较重要,UEFI是一个系统固件标准,首先就要详细规定如何启动OS的细节问题。同时还定义了一种新的启动方法,也就是我们说的UEFI boot是怎么做的。并对实现方法做了规定。并对一些用于启动过程的参数的存储方法做了规定。这一章我们应该通读并尽可能的了解其信息。

 

UEFI规范第四章 System Table

 

这一章对UEFI系统内最重要的一个数据结构System Table做了详尽的定义。并且仔细规定了每一个数据项的含义。因为System Table会作为参数传递每一个driver的入口函数,换句话说,这一章的内容和我们写代码息息相关。所以这一章的内容必须烂熟于胸。

 

UEFI规范第五章 GPT Partition

 

这一章对于做BIOS Porting的兄弟们可以忽略。但是对于做OS Loader以及firmware kernel的兄弟则必须阅读。这一章主要规定了一种新的分区格式,因为UEFI boot是基于文件系统的启动方法,而UEFI固件又只支持FAT32分区,所以必须要求硬盘上存在一个分区是FAT32,以便存放OS Loader。当然可以在这个分区安装整个OS。同时这个分区还做了一些技术上的革新,如使用64位的LBA等,这些都是一些有用的信息。

 

UEFI规范第六章&第七章 Boot Services & Runtime Services

 

这两章内容比较类似,我一并说明。这两章是写代码最为重要的内容。详细规定固件要提供的基本软件接口。分为两类,一类是Boot Services,只能在启动阶段使用。另一类则是Runtime的,可以在启动阶段以及UEFI native OS下使用。这两章都必须完全通读,彻底了解!

 

UEFI规范看到这里就可以了!底下的所有章节都是利用上面讲述的知识来具体定义PROTOCOL。换句话说,底下是作为参考出现的,我们在写代码的时候,需要某个PROTOCOL的时候,我们可以查阅相关的定义,了解这个PROTOCOL可以提供什么接口。

 

但是如果你是一个固件实现者,那么底下的内容你还是应该仔细看看你要实现的接口。如果你做BIOS Porting,某些接口,按照规定是必须要实现的。那也得看情况去查阅相应的章节。


  • 0
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 5
    评论
This Unified Extensible Firmware Interface (hereafter known as UEFI) Specification describes an interface between the operating system (OS) and the platform firmware. UEFI was preceded by the Extensible Firmware Interface Specification 1.10 (EFI). As a result, some code and certain protocol names retain the EFI designation. Unless otherwise noted, EFI designations in this specification may be assumed to be part of UEFI. The interface is in the form of data tables that contain platform-related information, and boot and runtime service calls that are available to the OS loader and the OS. Together, these provide a standard environment for booting an OS. This specification is designed as a pure interface specification. As such, the specification defines the set of interfaces and structures that platform firmware must implement. Similarly, the specification defines the set of interfaces and structures that the OS may use in booting. How either the firmware developer chooses to implement the required elements or the OS developer chooses to make use of those interfaces and structures is an implementation decision left for the developer. The intent of this specification is to define a way for the OS and platform firmware to communicate only information necessary to support the OS boot process. This is accomplished through a formal and complete abstract specification of the software-visible interface presented to the OS by the platform and firmware. Using this formal definition, a shrink-wrap OS intended to run on platforms compatible with supported processor specifications will be able to boot on a variety of system designs without further platform or OS customization. The definition will also allow for platform innovation to introduce new features and functionality that enhance platform capability without requiring new code to be written in the OS boot sequence. Furthermore, an abstract specification opens a route to replace legacy devices and firmware code over time. New device types and associated code can provide equivalent functionality through the same defined abstract interface, again without impact on the OS boot support code. The specification is applicable to a full range of hardware platforms from mobile systems to servers. The specification provides a core set of services along with a selection of protocol interfaces. The selection of protocol interfaces can evolve over time to be optimized for various platform market segments. At the same time, the specification allows maximum extensibility and customization abilities for OEMs to allow differentiation. In this, the purpose of UEFI is to define an evolutionary path from the traditional “PC-AT”- style boot world into a legacy-API free environment.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值