logo资料库

IEEE 1275-1994.pdf

第1页 / 共266页
第2页 / 共266页
第3页 / 共266页
第4页 / 共266页
第5页 / 共266页
第6页 / 共266页
第7页 / 共266页
第8页 / 共266页
资料共266页,剩余部分请下载后查看
IEEE Standard for Boot (Initialization Configuration) Firmware: Core Requirements and Practices 1. Overview 1.1 Purpose and scope This document describes a software architecture for the firmware that controls a computer before the operating system has begun execution. Typically, firmware is stored in read-only memory (ROM) or programmable read-only memory (PROM), so that it may be executed immediately after the computer is turned on. The main jobs of the firmware are to test the machine hardware and to boot the operating system, usually from a mass storage device or a network. The operating system may also require other services from the firmware. Finally, firmware often provides some support for interactive hardware and software debugging. In addition to the main op- erating system, other programs, such as diagnostic operating systems, may utilize firmware services. This standard uses OpenBoot PROM Architecture Specification [B6]1 as a starting point, and is bus, vendor, operating system (OS), and instruction-set-architecture (ISA)-independent. Supplements (numbered 1275. x) include specifications for this standard’s application to particular ISAs and buses. This document specifies firmware that controls the operation of a computer system before the primary operating system has taken control of the machine. The material specified includes facilities for determining the hardware configuration; testing, identification, and use of plug-in devices prior to primary OS control; reporting the hardware configuration to the operating system; the user interface for controlling these operations; and debugging facilities for hardware and system software. Additional introductory material can be found in annex F. 1.2 Firmware problems In an open-systems environment, the job of loading the operating system is greatly complicated by the possibility of user-installed I/O devices. If the firmware developer knows in advance the complete list of I/O devices from which the operating system may be loaded, then the software drivers for those devices may easily be included in the firmware. If, however, new bootable devices (devices from which the operating system may be loaded) may be added to the system later, then the firmware must have a way to acquire boot drivers for those devices. The obvious solution of shipping a complete set of system firmware with each new device quickly becomes impractical as the number of devices and systems grows. A similar situation applies to the devices used for displaying messages showing the progress of the testing and booting processes. The firmware must have a driver for each device on which it wishes to display messages. One solution is to require every display device to emulate some baseline device. This solution works, but the constraints that it imposes on hardware can increase costs and stifle innovation. Hardware innovation can proceed more rapidly when a single generic version of the operating system can work on several different computers within the same family. If the different computers look exactly the same to the software, then this is easy, but it is rare to find two different computers that look exactly the same at the operating system level. However, since the firmware can be considered in some sense to be part of the hardware, then the firmware can sometimes make the operating system’s task of autoconfiguration (adapting to minor hardware 1 The numbers in brackets preceded by the letter B correspond to those of the bibliography in annex J. 1
IEEE Std 1275-1994 IEEE STANDARD FOR BOOT (INITIALIZATION CONFIGURATION) FIRMWARE: differences) easier, either by hiding the differences or by reporting the hardware characteristics so the operating system does not have to guess. 1.3 Solutions The Open Firmware architecture solves those problems, and in addition, provides extensive interactive features for hardware and software debugging. The design of Open Firmware is processor-independent, and every effort was made to eliminate knowledge of ma- chine details from the specification of its interfaces. The following Open Firmware features are notable: — Plug-in device drivers. New devices may be added to an Open Firmware system and used for booting or mes- sage display without modification to the main Open Firmware system ROM. Each such device has its own plug-in driver, usually located in a ROM on the device itself. Thus, the set of I/O devices supported by a particular system may evolve without requiring changes or upgrades to the system ROM. — FCode. Plug-in drivers are written in a byte-coded machine-independent interpreted language called FCode. FCode is based on Forth semantics. Since FCode is machine-independent, the same device and driver can be used on machines with different CPU instruction sets. Each Open Firmware system ROM contains an FCode interpreter. — Device tree. The set of devices attached to the system, including permanently installed devices and plug-in de- vices, is described by an Open Firmware data structure known as the device tree. The operating system may in- spect the device tree to determine the hardware configuration of the system. Each device in the device tree is described by a property list. The set of properties describing a device is arbitrarily extensible so that any type of device and any kind of information that needs to be reported about the device can be accommodated. — Modularity. Some Open Firmware features (such as booting) are required, and others are optional. The set of Open Firmware features supported on a particular system may be chosen to meet the goals and constraints of that system. — Programmable user interface. The Open Firmware user interface is based on the industry-standard interactive programming language Forth so that sequences of user commands can be combined to form complete programs. This provides a powerful capability for debugging hardware and software; Open Firmware is a very good tool for the initial “bring-up” of new hardware and software. In addition, the Open Firmware programming features can often be used to implement “work-arounds” for many kinds of system bugs. — FCode debugging. The Open Firmware user interface language (Forth) and the FCode language share a com- mon interpretation mechanism, so it is easy to develop and debug FCode programs with built-in Open Firmware tools. — Operating system debugging. Open Firmware has commands for debugging operating system code, often making the use of a kernel debugger unnecessary. 1.4 Document organization In this document, Open Firmware is described in terms of its external interfaces and the internal structures and procedures on which those interfaces depend. See figure 1. The content of the clauses and annexes is as follows: — Clause 1 provides the background for understanding the goals and objectives of this document. — Clause 2 provides a list of documents used as references, defines the terminology used, and describes the as- sumptions made by this standard. — Clauses 3 and 4 define the internal structures and procedures upon which the Open Firmware model is based. — Clause 5 defines the device interface for identification and use of plug-in devices. — Clause 6 defines the client interface, which provides services to booted programs. 2
CORE REQUIREMENTS AND PRACTICES IEEE Std 1275-1994 — Clause 7 defines the user interface, a command interpreter for human use. — Annex A gives detailed definitions of all the individual commands, methods, properties, configuration variables, and strings mentioned in this document. — Annex B defines the escape sequences of the terminal emulator package. — Informative annexes C through I give additional useful information, including device driver source code exam- ples, suggested behavior of development tools, historical and compatibility notes, and an index of glossary terms. Open Firmware User Interface Open Firmware Client Interface Client Program (Operating System) Device Tree Open Firmware Open Firmware Device Interface Expansion Bus Expansion Bus Network Figure 1—Typical Open Firmware system diagram 1.5 Compliance In order to comply with this standard, a system shall implement at least one of the following interfaces: Interface Clause Requirements given in subclause Device interface Client interface User interface 5 6 7 5.1.2 6.1.2 7.1.2 A system claiming compliance with this standard shall clearly specify which of the above interfaces are claimed to be compliant. 3
IEEE Std 1275-1994 IEEE STANDARD FOR BOOT (INITIALIZATION CONFIGURATION) FIRMWARE: 2. References, definitions, and assumptions 2.1 References This standard shall be used in conjunction with the following publications. When they are superseded by an approved revision, the revision shall apply: ANSI X3.64-1979 (Reaff 1990), Additional Controls for Use with the American National Standard Code for Information Interchange.2 ANSI X3.215-1994, American National Standard for Information Systems—Programming Languages—Forth. IEEE Std 100-1992, The New IEEE Standard Dictionary of Electrical and Electronics Terms (ANSI).3 IEEE Std 1275.1-1994, IEEE Standard for Boot (Initialization Configuration) Firmware: Supplement for IEEE 1754 ISA. IEEE Std 1275.2-1994, IEEE Standard for Boot (Initialization Configuration) Firmware: Supplement for IEEE 1496 Bus (SBus). IEEE P1275.3, Standard for Boot (Initialization Configuration) Firmware—Supplement for VMEbus, D1, August 1994.4 IEEE P1275.4, Standard for Boot (Initialization Configuration) Firmware—Supplement for IEEE 896 (Futurebus+) Bus, D13, August 1994. ISO 8859-1 : 1987, Information processing—8-bit single-byte coded graph character sets—Part 1: Latin alphabet No. 1.5 RFC783, Trivial File Transfer Protocol (TFTP) Protocol Definition, NIC, June 1981.6 RFC906 Bootstrap Loading using TFTP, NIC, June 1984. 2.2 Special word usage The following words have very specific meanings and are used in this standard to differentiate between required and optional features of the Open Firmware specification: — The word shall is used to indicate mandatory requirements. — The word should is used to indicate advisory requirements (that which is strongly recommended). — The word may is used to indicate optional requirements. 2 ANSI publications are available from the Sales Department, American National Standards Institute, 11 West 42nd Street, 13th Floor, New York, NY 10036, USA. 3 IEEE publications are available from the Institute of Electrical and Electronics Engineers, Inc., 445 Hoes Lane, P.O. Box 1331, Piscataway, NJ 08855-1331. 4 Numbers preceded by the letter P are authorized standards projects that were not approved by the IEEE Standards Board at the time of this document’s publication. For information about obtaining drafts, contact the IEEE. 5 ISO publications are available from the ISO Central Secretariat, Case Postale 56, 1, rue de Varembé, CH-1211, Genève 20, Switzerland/Suisse. ISO publications are also available in the United States from the Sales Department, American National Standards Institute, 11 West 42nd Street, 13th Floor, New York, NY 10036, USA. 6 Internet RFCs are retrievable by FTP at ds.internic.net /rfcnnn.txt (where nnn is a standard’s publication number, such as 783 or 906), or call InterNIC at 1-800-444-4345 for information about receiving copies through the mail. 4
CORE REQUIREMENTS AND PRACTICES 2.3 Definitions of terms IEEE Std 1275-1994 The following definitions give the meanings of the technical terms as they are used in this standard. Terms defined herein are italicized upon their first occurrence in each subclause throughout the rest of the document. Terms related to the Forth programming language are defined in ANSI X3.215-1994.7 2.3.1 active package: The package, if any, whose methods are accessible by name to the command interpreter, and to which newly created methods andproperties are added. 2.3.2 alignment: The suitability of particular addresses for accessing particular types of data. For example, some processors require even addresses for accessing 16-bit data items. 2.3.3 big endian: A representation of multibyte numerical values in which bytes with greater numerical significance appear at lower memory addresses. 2.3.4 boot: To load and execute a client program. 2.3.5 built-in device: A device that is either permanently attached to the computer system, not easily removable, or present in all system configurations (i.e., not optional). 2.3.6 byte: A unit of computer data consisting of 8 bits. 2.3.7 cell: The primary unit of information in the architecture of a Forth System. See 2.3.2. 2.3.8 child node: A node that “descends” from another node, i.e., all nodes except the root node. See also: parent node. 2.3.9 client execution environment: The machine state that exists when a client program begins execution. 2.3.10 client interface: A set of data and procedures giving a client program access to client interface services. 2.3.11 client interface handler: A mechanism by which control and data are transferred from a client program to the firmware, and subsequently returned, for the purpose of providing client interface services. 2.3.12 client interface services: Those services that Open Firmware provides to client programs, including device tree access, memory allocation, mapping, console I/O, mass storage, and network I/O. 2.3.13 client program: A software program that is loaded and executed by Open Firmware (or a secondary boot program). (The client program may use services provided by the Open Firmware client interface.) 2.3.14 close: To destroy a package instance. 2.3.15 colon definition: A command defined as a sequence of previously existing commands. 2.3.16 command: As applied to this standard, a procedure in the Forth programming language. The execution of a command performs some operation, usually affecting the state of one or more system resources in a predefined way. (New commands may be defined as sequences of previously defined commands. Most commands have human-readable names expressed as a sequence of textual characters. See also: Forth word; word name.) 2.3.17 command group: A set of commands with defined behaviors, the group as a whole providing some particular capability (for example, one command group is concerned with client program debugging). 7Information on references can be found in 2.1. 5
IEEE Std 1275-1994 IEEE STANDARD FOR BOOT (INITIALIZATION CONFIGURATION) FIRMWARE: 2.3.18 command interpreter: The portion of a Forth system that processes user input and Forth language source code by accepting a sequency of textual characters representing Forth word names and executing the corresponding Forth words. 2.3.19 configuration variable: A named parameter, whose value is stored in nonvolatile memory, that controls some aspect of the firmware’s behavior. 2.3.20 console: A device used as the primary means of communication with a human being, consisting of an input device, used for receiving information supplied by the human, and an output device, used for sending information to the human. (Typically, a console is either an ASCII terminal connected to a serial port or the combination of a text/graphics display device and a keyboard.) 2.3.21 current instance: The package instance whose private data is currently accessible. 2.3.22 data stack: A stack that may be used for passing parameters between Forth definitions. 2.3.23 decompiler: A software component that takes one or more compiled Forth commands and generates the equivalent text representation for those commands. 2.3.24 defer word: A Forth word whose name has been entered into the dictionary (by the defining word defer), but whose action was left unresolved and may be resolved at a later time. 2.3.25 device: A hardware unit that is capable of performing some specific function. 2.3.26 device alias: A shorthand representation for a device path. 2.3.27 device arguments: The component of a node name that is provided to a package’s open method to provide addtional device-specific information. 2.3.28 device driver: The software responsible for managing low-level I/O operations for a particular hardware device or set of devices. Contains all the device-specific code necessary to communicate with a device and provides a standard interface to the rest of the system. See also: firmware device driver; operating system device driver. 2.3.29 device interface: One of the interfaces specified in this standard that allows devices to be identified, characterized, and used to assist other Open Firmware functions such as booting. 2.3.30 device node: A particular entry in the device tree, usually describing a single device or bus, consisting of properties, methods, and private data. (A device node may have multiple child nodes and has exactly one parent node. The root node has no parent node.) 2.3.31 device path: A textual name identifying a device node by showing its position in the device tree. 2.3.32 device specifier: Either a device path, a device alias, or a hybrid path that begins with a device alias and ends with a device path. 2.3.33 device tree: A hierarchical data structure representing the physical configuration of the system. (The device tree describes the properties of the system’s devices and the devices’ relationships to one another. Most Open Firmware elements [devices, buses, libraries of software procedures, etc.] are named and located by the device tree.) 2.3.34 device type: Identifies the set of properties and package classes that a node is expected to implement. Specified by the “device_type” property. 6
CORE REQUIREMENTS AND PRACTICES IEEE Std 1275-1994 2.3.35 disassembler: A program that translates machine code into an equivalent human-readable assembly- language representation. 2.3.36 disk label: Contains descriptive information, usually in a well-known location such as physical block zero, about the device and the media and may include logical partitioning information. 2.3.37 doublet: A unit of computer data consisting of 16 bits. 2.3.38 driver name: The component of a node name that corresponds to the value of the device’s “name” property. 2.3.39 FCode: A computer programming language defined by this standard, which is semantically similar to the Forth programming language but is encoded as a sequence of binary byte codes representing a defined set of Forth definitions. 2.3.40 FCode driver: A device driver, written in FCode, intended for use by Open Firmware and its client pro- grams. 2.3.41 FCode function: A self-contained procedural unit of the FCode programming language to which an FCode number may be assigned. 2.3.42 FCode evaluator: The portion of Open Firmware that processes FCode programs by reading a sequence of bytes representing FCode numbers and executing or compiling the associated FCode functions. 2.3.43 FCode number: A number from 0 to 4095 (conventionally written in hexadecimal as 0x00 to 0x0FFF) that denotes a particular FCode function. 2.3.44 FCode probing: The process of locating and evaluating an FCode program. 2.3.45 FCode program: A program encoded as a sequence of byte codes according to the rules of the FCode programming language. 2.3.46 FCode source: An FCode program in text form. See also: tokenizer. 2.3.47 firmware: A program, typically stored in read-only memory, that controls a computer from the time that it is turned on until the time that the primary operating system assumes control of the computer. 2.3.48 firmware device driver: A device driver intended for use by firmware. Contrast with: operating system device driver. See also: device driver. 2.3.49 Forth word: See: command. 2.3.50 frame buffer: A hardware device that is used as an interface between a computer and a video monitor, generally containing an array of memory that is written by the computing system (software) and is read by special hardware for the purpose of display. 2.3.51 ihandle: A cell-sized datum identifying a particular package instance. 2.3.52 instance: See: package instance. 2.3.53 leaf node: A device node that has no children. 2.3.54 least significant: Within a group of data items (e.g., bits or bytes) that, taken as a whole, represents a numerical value, the item within the group with the smallest numerical weighting. 7
IEEE Std 1275-1994 IEEE STANDARD FOR BOOT (INITIALIZATION CONFIGURATION) FIRMWARE: 2.3.55 little endian: A representation of multibyte numerical values in which bytes with lesser numerical signifi- cance appear at lower memory addresses. 2.3.56 load: To move the image of a client program from a long-term storage medium (such as a disk) into memory where it may be executed. 2.3.57 memory management unit (MMU): A device that performs address translation between a CPU’s virtual addresses and the physical addresses of some bus; typically, the bus represented by the root node. 2.3.58 method: A software procedure associated with a package. 2.3.59 MMU: See: memory management unit. 2.3.60 most significant: Within a group of data items (e.g., bits or bytes) that, taken as a whole, represents a numerical value, the item within the group with the greatest numerical weighting. 2.3.61 node: In the context of Open Firmware, node is a synonym for device node. See also: device node. 2.3.62 node name: A text string of the form “driver-name@unit-address:device-arguments”, which identifies a device node within the address space of its parent. 2.3.63 nonvolatile memory: Computer memory whose contents are preserved when the system power is off. 2.3.64 open: To create a package instance. 2.3.65 Open Firmware: Firmware conforming to IEEE Std 1275-1994, IEEE Standard for Boot (Initialization Configuration) Firmware: Core Requirements and Practices. 2.3.66 operating system device driver: A device driver intended for use by a primary operating system. Contrast with: firmware device driver. See also: device driver. 2.3.67 package: The combination of a node’s properties, methods, and private data. 2.3.68 package instance: A data structure resulting from the opening of a particular package, consisting of a set of values for the package’s private data. 2.3.69 parent node: The node to which a device node is attached. Each device node has exactly one parent node, except the root node, which has none. (A device node descends from its parent node. Traveling “up” the device tree takes one through parent nodes to the root node. Traveling “down” the device tree takes one through child nodes to the leaf nodes.) 2.3.70 phandle: A cell-sized datum identifying a particular package. 2.3.71 physical address: A unique identifier that selects a particular device from the set of all devices connected to a particular bus. 2.3.72 physical address space: The set of possible physical addresses for a particular bus. 2.3.73 plug-in device: A device that may be installed and removed at will, especially a device that is attached to a bus intended for system expansion. 2.3.74 plug-in driver: A package, usually associated with a plug-in device and serving as the interface to that device, that is created by evaluating an FCode program resident on that device. 8
分享到:
收藏