A short introduction to Open Firmware

OpenFirmware是一种计算机固件系统的标准,定义了固件接口,并允许系统直接从PCI卡加载平台独立的驱动程序,提高兼容性。它最初由Sun Microsystems开发,并被Apple、IBM等公司采用。OpenFirmware基于Forth语言,提供了高效的硬件测试和调试能力。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Open Firmware, or OpenBoot in Sun Microsystems parlance, is a standard defining the interfaces of a computer firmware system, formerly endorsed by the IEEE. It originated at Sun, and is used by Sun, Apple, IBM, and most other non-x86 PCI chipset vendors. Open Firmware allows the system to load platform-independent drivers directly from the PCI card, improving compatibility. The proposed Power Architecture Platform Reference will also be Open Firmware based.

Open Firmware may be accessed through its Forth language shell interface. It achieves essentially the same functionality as the later EFI standard initiated at Intel, with lower overhead.

Open Firmware is described by IEEE standard IEEE 1275-1994, which was not reaffirmed by the Open Firmware Working Group (OFWG) since 1998 and has therefore been officially withdrawn by IEEE.

Several commercial implementations of Open Firmware have been released to the Open Source community in 2006, including Sun OpenBoot, Firmworks OpenFirmware and Codegen SmartFirmware. The source code is available from the OpenBIOS project. Sun's implementation is available under a BSD license.[1]

Advantages

Because the Open Firmware Forth code is compiled into FCode (a bytecode) and not into the machine language of any particular computer architecture, Open Firmware code included in, say, an I/O card can be executed by any system that uses Open Firmware. In this way, an I/O card can provide boot-time diagnostics, configuration code, and device drivers that will be usable on any system running Open Firmware, allowing many of the same I/O cards to be used on Sun systems and Macintoshes.

Being based upon an interactive programming language, Open Firmware can be used to efficiently test and bring up new hardware.

Access

On Sun SPARC systems, the Open Firmware interface is displayed on the console terminal before the bootstrapping of the system software. If a keyboard is connected, the main video display will be used as the console terminal and Open Firmware can be re-entered at any time by pressing Stop-A (L1-A) on the keyboard. If no keyboard is connected, then the first serial line on the system is usually used as the console and Open Firmware is re-entered by sending a "Break" on the serial line. While the system software is running, various Open Firmware settings can be read or written using the eeprom command.

On a PowerPC-based Macintosh, the Open Firmware interface can be accessed by pressing the keys Cmd-Option-O-F at startup.[2] This functionality is generally only used by developers or troubleshooting I.T. personnel; for common users, the Mac OS X operating system provides a high level graphical user interface to change commonly used Open Firmware settings. For instance, it is possible to specify the boot disk or partition without directly using the Open Firmware interface. Other Open Firmware settings can be changed using the nvram command while the system software is running.

On Pegasos, the interface is accessed by pressing Esc at startup.

On IBM POWER systems, Open Firmware ("ok" prompt) can be accessed through the SMS Boot Menu. SMS Boot Menu can be accessed by pressing "1" or "F1" during the boot sequence, after hardware checking, and just before the OS boot.

On the OLPC XO-1 laptop, first get a developer key, which allows full access to the firmware. The key is readily accessible via the home page of the web browser. After you install the key, upon each power-on, you can interrupt the boot countdown with Esc (the upper left key) to get to the Forth ok prompt.

See also


External links

 
一、综合实战—使用极轴追踪方式绘制信号灯 实战目标:利用对象捕捉追踪和极轴追踪功能创建信号灯图形 技术要点:结合两种追踪方式实现精确绘图,适用于工程制图中需要精确定位的场景 1. 切换至AutoCAD 操作步骤: 启动AutoCAD 2016软件 打开随书光盘中的素材文件 确认工作空间为"草图与注释"模式 2. 绘图设置 1)草图设置对话框 打开方式:通过"工具→绘图设置"菜单命令 功能定位:该对话框包含捕捉、追踪等核心绘图辅助功能设置 2)对象捕捉设置 关键配置: 启用对象捕捉(F3快捷键) 启用对象捕捉追踪(F11快捷键) 勾选端点、中心、圆心、象限点等常用捕捉模式 追踪原理:命令执行时悬停光标可显示追踪矢量,再次悬停可停止追踪 3)极轴追踪设置 参数设置: 启用极轴追踪功能 设置角度增量为45度 确认后退出对话框 3. 绘制信号灯 1)绘制圆形 执行命令:"绘图→圆→圆心、半径"命令 绘制过程: 使用对象捕捉追踪定位矩形中心作为圆心 输入半径值30并按Enter确认 通过象限点捕捉确保圆形位置准确 2)绘制直线 操作要点: 选择"绘图→直线"命令 捕捉矩形上边中点作为起点 捕捉圆的上象限点作为终点 按Enter结束当前直线命令 重复技巧: 按Enter可重复最近使用的直线命令 通过圆心捕捉和极轴追踪绘制放射状直线 最终形成完整的信号灯指示图案 3)完成绘制 验证要点: 检查所有直线是否准确连接圆心和象限点 确认极轴追踪的45度增量是否体现 保存绘图文件(快捷键Ctrl+S)
<think>好的,我现在需要详细介绍一下Open Firmware。首先,用户之前询问了Linux设备树的发展史,其中提到Open Firmware是设备树的技术原型。现在用户想更深入了解Open Firmware,可能希望了解它的起源、设计理念、核心技术以及它对后续技术的影响。 首先,我应该从Open Firmware的基本概念开始。它是什么时候出现的?由谁开发的?主要为了解决什么问题?然后,它的核心设计有哪些特点,比如设备树结构、Forth语言的使用,跨平台支持等。接下来,需要介绍它的架构,包括设备树、FCode、用户接口等方面。然后,可以谈谈它在不同平台上的应用,比如PowerPC、Sun的SPARC,以及苹果的旧版Mac。此外,Open Firmware对后续技术的影响,比如对Linux设备树的启发,以及与其他固件接口如UEFI和ACPI的比较。最后,总结它的优缺点和现状。 需要注意用户可能对技术细节感兴趣,比如Forth语言在Open Firmware中的作用,设备树的结构如何描述硬件,以及具体的启动流程。同时,要避免过于深入复杂的技术术语,保持解释清晰易懂。另外,用户可能希望了解Open Firmware的实际应用案例,比如在哪些设备中被广泛使用,或者有哪些著名的系统采用了它。 需要确认Open Firmware的历史时间线是否准确,例如IEEE 1275标准的制定时间,以及各个公司采用的时间点。还要确保技术术语的正确性,比如FCode是什么,如何与设备树结合使用。可能还需要提到Open Firmware的优缺点,比如灵活性高但学习曲线陡峭,以及为什么后来在某些领域被替代。 在结构上,可以分为几个部分:概述、历史背景、核心技术、架构解析、应用实例、对后续技术的影响以及现状。这样逻辑清晰,便于用户理解。同时,加入一些示例代码或结构图可能会更有帮助,但需要注意使用中文描述,并符合Markdown格式的要求。 需要检查是否有遗漏的关键点,比如Open Firmware的启动过程、交互式调试功能、跨平台的具体实现方式等。另外,比较它与其他固件接口的异同,可以帮助用户更好地理解其独特之处。最后,确保所有信息准确无误,尤其是技术细节和年份数据。</think>Open Firmware 是一种**跨平台的固件接口标准**,主要用于初始化硬件、加载操作系统,并提供运行时设备管理。其核心思想是**通过设备树(Device Tree)动态描述硬件**,实现硬件与操作系统的解耦。以下从技术背景、设计特点、架构实现及影响等方面详细解析: --- ### 一、历史背景与标准化 1. **起源**: - 由 **Mitchell Berger** 和 **Sun Microsystems** 在1980年代末开发,最初用于Sun SPARC工作站。 - 1994年成为 **IEEE 1275** 标准,正式命名“Open Firmware”。 2. **目标**: - **硬件抽象**:统一不同架构(SPARC、PowerPC、x86)的固件接口。 - **操作系统无关性**:允许同一固件支持多种OS(如Solaris、Linux、Mac OS)。 --- ### 二、核心技术设计 #### 1. **设备树(Device Tree)** - **树形数据结构**:以父子节点层次化描述硬件(CPU、内存、外设等)。 - **动态探测**:支持即插即用(Plug and Play),无需静态配置。 - **示例**: ```forth /pci@1f,4000 // PCI控制器节点 ethernet@3 // 网卡子节点 reg = <0x3> // 寄存器地址 ``` #### 2. **Forth语言解释器** - **交互式接口**:用户通过Forth命令直接操作硬件(如查看设备、修改配置)。 - **FCode驱动**:设备驱动以Forth字节码(FCode)形式存储,可动态加载。 - 优势:无需重新编译固件即可更新驱动。 #### 3. **跨平台启动** - **统一启动流程**: 1. 固件初始化硬件并构建设备树。 2. 加载操作系统引导程序(如GRUB)或直接启动内核。 3. 向操作系统传递设备树信息。 --- ### 三、架构解析 #### 1. **核心组件** - **设备树(DT)**:硬件信息的结构化表示。 - **客户端接口(Client Interface)**:供操作系统调用固件功能的API。 - **用户界面**:基于Forth的交互式命令行(OK提示符)。 #### 2. **启动流程** ```plaintext 加电 → 固件初始化 → 构建设备树 → 加载OS引导程序 → 移交控制权 ``` #### 3. **设备驱动模型** - **方法包(Method Packages)**:每个设备节点包含一组Forth方法(如`open`、`read`)。 - **示例:访问PCI设备** ```forth " /pci@1f,4000/ethernet@3" find-device open-device // 打开设备 read-block // 读取数据 ``` --- ### 四、应用与影响 #### 1. **主要应用场景** - **Sun SPARC工作站**:早期广泛用于Solaris系统。 - **PowerPC架构**:Apple Power Macintosh(1994-2006)、IBM服务器。 - **嵌入式系统**:部分PowerPC嵌入式设备仍在使用。 #### 2. **对Linux设备树的影响** - **直接继承**:Linux设备树(DTS)语法与Open Firmware设备树高度相似。 - **设计理念延续**:硬件描述与内核解耦,支持动态配置。 #### 3. **对比其他固件标准** | 特性 | Open Firmware | UEFI | BIOS | |---------------------|---------------------|---------------------|----------------| | **硬件描述** | 动态设备树 | ACPI表 | 静态CMOS配置 | | **驱动模型** | FCode动态加载 | DXE驱动程序 | 无 | | **跨平台支持** | 强(SPARC/PPC/x86)| 主要x86/ARM | 仅x86 | | **交互性** | 强(Forth命令行) | 弱(有限Shell) | 无 | --- ### 五、现状与局限性 1. **现状**: - **遗留系统维护**:部分旧款PowerPC和SPARC设备仍依赖Open Firmware。 - **技术替代**:x86转向UEFI,ARM采用简化设备树(Flattened Device Tree, FDT)。 2. **局限性**: - **学习门槛高**:Forth语言晦涩,开发者生态有限。 - **性能开销**:解释执行FCode效率低于原生代码。 --- ### 六、代码示例:Open Firmware交互 ```forth ok dev /pci@1f,4000 \ 切换到PCI设备节点 ok .properties \ 查看设备属性 compatible: "pci108e,1000" reg: 00000001 ok 1 encode-int " interrupt" property \ 设置中断号 ``` --- ### 七、总结 Open Firmware通过**设备树抽象**和**Forth交互性**,实现了硬件管理的灵活性与跨平台能力。尽管其市场地位已被UEFI/ACPI取代,但其设计理念深刻影响了Linux设备树等现代技术。理解Open Firmware有助于掌握**硬件-固件-操作系统**的协作本质。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值