UEFI Spec 学习笔记---33 - Human Interface Infrastructure Overview(1)

33 - Human Interface Infrastructure Overview

本章节主要用于介绍Human Interface Infrastructure(HII)架构介绍,描述如何通过 HII 来管理用户的输入,以及描述在 UEFI spec 中涉及 HII 相关的 Protocol、function 和类型定义。

33.1 Goals

简单来说,就是要生成一个简单方便地可视化界面,让使用者可以在不同阶段来进行配置 FW.

33.2 Design Discussion

Human Interface Infrastructure 架构如下:

Driver 以及 application 会将 HII source 安装到 Hii Database,而 HII Database 就是一个数据中心,中间保存的就是(字体、字符、图片以及表单).Form Browser 通过 Display Device 来呈现界面用于给客户浏览数据,然后用户通过 HID device (Human Interface Device 这类设备通常包括键盘、鼠标、游戏手柄、触摸板等用于人与计算机进行交互的输入或输出设备。)来输入数据给 Form Browser.在交互完成后,用户提交了修改给 Form Browser,然后 Form browser 通过 Variable Store 来修改保存到 NVRAM 中。

33.2.1 Drivers And Applications

以 package 列表形式的使用者接口是由 driver 和 application 动态创建的,接口可以预编译或者作为 resource 包含在 driver 和 application 中。若是以资源的形式包在 driver 或者 application 中,则可以对资源进行修改,而不需要重新编译,比如若是在 UNI 文件中定义,需要修改的话就需要重新编译,若是动态 C 里面去修改的话就不需要重新编译,比如硬件信息。

用户数据是以文本的格式进行保存,然后 resource 会被编译成一个 RES 文件然后链接到主程序。(PE/COFF resource 区域----PE/COFF(Portable Executable/Common Object File Format)是微软公司定义的一种文件格式,用于可执行文件、动态链接库(DLLs)、资源文件等在Windows操作系统中的存储。)

RES 文件中的资源数据在 PE/COFF 文件中通常位于 .rsrc 节,并以层次化的目录结构进行组织。

33.2.1.10 O/S-Present Forms Browser/Processor

在某些时候,OS 也是需要访问 HIIDATABASE 表单数据,所以定义了一个 O/S agent 用于封装数据并通过标准方式导出。

数据一般是保存 NVRAM 中,可以通过 HII 接口导出 HIIDatabase 数据。

33.2.7 Fonts

UEFI描述了一种标准字体,这是所有支持位图输出设备上文本显示的系统所必需的。标准字体(system 字体)是一种固定间距字体,其中所有字符要么窄(8x19 像素),要么宽(16x19 像素)。UEFI还允许显示其他字体,包括固定间距和可变间距。平台对这些字体的支持是可选的。UEFI字体描述使用简化字体包(简化字体包)或正常字体。

33.2.7.1 Font Attributes

字体属性有三种:

  • Font Name:也就是我们常见的字体样式,比如Arial、Times New Roman 等,标准字体也就是"sysdefault"
  • Font Size:字体大小描述的就是单个字符单元(Cell)的最大高度,标准的都是 19.
  • Font Style:字体样式描述了对字体基本视觉样式的标准视觉修改。支持的字体样式包括:粗体,斜体,下划线,双下划线,压花,轮廓和阴影。一些字体样式也可以由字体呈现引擎模拟。标准字体总是没有附加的字体样式。
33.2.7.2 Limiting Glyphs

主要显示字符的因素是存储空间的问题,在进 OS 之前,若是需要显示所有没有预料到的字符串,则需要保存所有在 Unicode 字体的字形数据。

所以我们可以提前收集需要显示的字符串,从而减小需要保存的字形数据。

UEFI 默认支持基本的拉丁字符,若是 UEFI application 或者 Driver 需要显示其他的字符,他们可以添加新的字符数据到现有的 HII Database.在现有的字符字形定义在已经存在的 Unicode 字符库中没有则添加。

33.2.7.3 Fixed Font Description

字体可以在宽度、样式、基线、高度、大小等方面有所不同。固定字体定义包括空白和字形数据,以及字形数据的位置。这可以防止在运行时调整不同固定字体的字符以美观地配合在一起。为了向UEFI驱动程序提供如何设计固定字体字符的基本描述,下面定义了行业标准字体术语:

baseline-从单元格的左上角到上限(A, B, C,…)的距离

cap_height :从大写字母底部到大写字母顶部的距离

x_height :从基线到小写字母‘ x ’顶部的距离-

descender:从基线(g, j, p, q, y)下方延伸的距离-

ascender:从小写字母‘ x ’顶部到高小写字母(b, d, f, h, k, l)的距离

同时也支持双字节存储的,但是就不像 8*16 那样一行一行存储,而是先存储左边半边,然后再存储右边半边,

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.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值