1. Field of the Invention
The invention disclosed and claimed herein generally pertains to an improved method for loading device drivers, in connection with implementation of Open Firmware in a computer system. More particularly, the invention pertains to a method of the above type wherein stub device drivers are created for use in implementing Open Firmware, rather than the currently used complete drivers. Even more particularly, the invention pertains to a method of the above type that is characterized by a two-phase procedure, in order to optimize boot time and the amount of memory required.
2. Description of the Related Art
It is common for a computer system to be provided with firmware of a type that controls the computer before a computer operating system has begun execution. The main tasks of such firmware are to test the computer hardware, and to start up or boot the operating system. However, in an open-systems environment, the task of loading the operating system can be significantly complicated by the presence of user installed I/O devices. If new I/O devices can be added to the system at any time, for use in loading the operating system, then the firmware must have a way to acquire boot drivers for such devices.
In order to meet this need, a hardware-independent firmware known as Open Firmware has been developed. Open Firmware uses a code that is compiled into Fcode, rather than the machine language of any particular computer architecture. As a result, Open Firmware code included in an I/O card or other device can be executed by any computer system that uses Open Firmware. Moreover, the drivers for such devices are usable on any system that runs Open Firmware. Accordingly, new devices may be added to an Open Firmware system and used for booting or message display, without modification to the Open Firmware retained in the system ROM.
The standard IEEE 1275 provides specifications for use of Open Firmware to boot an operating system or other client program in a computer system. This standard requires that in order to proceed with a booting procedure, the device driver codes from all devices that have valid boot ROMs must be loaded into the system. The system can then evaluate the boot codes, in order to (1) initialize the devices, (2) create device tree properties, and (3) make each of the devices usable for the Open Firmware, and also for the operating system or other client program that is to be started up by the booting procedure.
Previously, the evaluation of boot code on a large number of devices or adapters has had the undesirable side effect of increasing the firmware memory footprint, as well as considerably extending the time required to boot the system. These effects occur even when the Open Firmware does not need to use all the devices being evaluated. They can also occur when a device or adapter does not provide a considerable amount of function. Accordingly, the Open Firmware architecture allows for driver instancing, wherein the code is loaded once, and only the data associated with each device or adapter is created for each driver instance. This practice reduces the memory footprint, or amount of memory that is needed, and provides the required device initialization referred to above. However, such practice does not resolve the boot time issues, nor is it useful for situations in which devices use different versions of boot ROM driver code. Moreover, it is still necessary to create device tree properties for devices attached to a system, whenever Open Firmware is implemented to boot the system.
The invention generally pertains to a method and apparatus wherein a set of stub device drivers are created, one for each device attached to a computer system that is affected by implementation of Open Firmware to boot the system. A stub driver comprises a shortened or reduced form of the complete driver for its corresponding device or adapter. However, the stub driver retains the capability to create device tree properties for its corresponding device, as required for Open Firmware implementation and by client programs loaded by the implementation. Moreover, a stub driver is able to trigger the loading of the complete driver of its corresponding device, in order to make such device fully functional for use with the Firmware or the client program, if necessary. One useful embodiment of the invention is directed to a method for loading device drivers in a computer system having a set of devices, wherein each device has a driver located in a ROM on the device itself, and the system is configured to run Open Firmware. The method comprises the step of initially generating a stub device driver for each of the devices, wherein each stub driver is capable of providing device tree properties of its corresponding device. The method further comprises loading each of the stub drivers into the system, to respectively create device tree properties for the devices in response to a specified implementation of the Open Firmware. The loaded stub driver of a particular device is used to trigger loading of the complete driver for the particular device, only when the particular device is required for use by the specified Firmware implementation.
The novel features believed characteristic of the invention are set forth in the appended claims. The invention itself, however, as well as a preferred mode of use, further objectives and advantages thereof, will best be understood by reference to the following detailed description of an illustrative embodiment when read in conjunction with the accompanying drawings, wherein:
Referring to
Open Firmware component 102 is a hardware-independent firmware that is accessed by a user by means of a Forth-based shell interface.
Referring further to
As a first phase of an embodiment of the invention, a stub device driver is created for each I/O device or adapter attached to computer system 100. A stub driver for a particular device is substantially limited to the portion of the complete driver that furnishes the device tree properties for the particular device.
In order to use any device of system 100 for a Firmware implementation or for a loaded client program, an Open method defined by IEEE 1275 must be called for the device. Accordingly, each stub driver is further provided with the capability to respond to an Open method call that is directed to its corresponding device. Upon recognizing such call, the stub driver will trigger the loading of the complete driver from the ROM of its corresponding device. The complete driver will thereby be loaded into the device tree node for such corresponding device. The Open method will then be called, thus triggering activation of a second phase driver contained in the device ROM, to make the device fully functional for Open Firmware use. This procedure is described further in connection with
After a set of stub drivers having the above characteristics has been created for all of the devices, the stub drivers are placed in a suitable stub driver repository, such as an accessible storage device.
A firmware implementation for computer system 100 will contain a list of devices keyed off the device/vendor and/or subsystem identifiers, as specified by the PCI architecture. This list will be used during a PCI probing process that constructs the device tree from the loaded device drivers, as described above. In accordance with the embodiment of the invention, the precedence of device driver loading is set to search the stub driver repository first, and then the adapter and lastly the generic driver for the adapter class.
The procedure of the embodiment described above enables a device tree to be created for a Firmware implementation that contains all the properties specified by IEEE 1275, while at the same time reduces memory footprint and boot time cost. The cost of loading a complete driver for a device is incurred only when the device is actually required for firmware implementation or a loaded client program. Since a device node is compliant with the architecture, the stub driver corresponding to the device is transparent to the firmware and to the client. The embodiment only requires the existence of stub drivers and a minor modification to the precedence of adapter driver loading. For areas of the device tree in which no Open method is issued on any of the devices, and which are merely navigated to search for properties, no change is required since the stub drivers provide sufficient information to maintain architectural compliance and code compatibility.
Referring to
Referring further to
An operating system runs on processor 202 and is used to coordinate and provide control of various components within data processing system 200 shown in
From the above description, it will be understood that each stub driver has an associated package, from which a device tree node can be created that has all the properties of the corresponding device. In addition, the stub driver package contains logic that can be used to load the complete driver code of the corresponding device. A procedure or sequence carried out by this logic, shown in
Referring to
Referring further to
After loading is completed, all device properties specified by IEEE 1275 are created during post-processing. In the associated PCI probe logic, a search is added of the internal driver library for the check for a valid IEEE 1275 booted ROM.
The invention can take the form of an entirely software embodiment or an embodiment containing both hardware and software elements. In a preferred embodiment, the invention is implemented in software, which includes but is not limited to Firmware, resident software, microcode, etc.
Furthermore, the invention can take the form of a computer program product accessible from a computer-usable or computer-readable medium providing program code for use by or in connection with a computer or any instruction execution system. For the purposes of this description, a computer-usable or computer readable medium can be any tangible apparatus that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
The medium can be an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system (or apparatus or device) or a propagation medium. Examples of a computer-readable medium include a semiconductor or solid state memory, magnetic tape, a removable computer diskette, a random access memory (RAM), a read-only memory (ROM), a rigid magnetic disk and an optical disk. Current examples of optical disks include compact disk-read only memory (CD-ROM), compact disk-read/write (CD-R/W) and DVD.
A data processing system suitable for storing and/or executing program code will include at least one processor coupled directly or indirectly to memory elements through a system bus. The memory elements can include local memory employed during actual execution of the program code, bulk storage, and cache memories which provide temporary storage of at least some program code in order to reduce the number of times code must be retrieved from bulk storage during execution.
Input/output or I/O devices (including but not limited to keyboards, displays, pointing devices, etc.) can be coupled to the system either directly or through intervening I/O controllers.
Network adapters may also be coupled to the system to enable the data processing system to become coupled to other data processing systems or remote printers or storage devices through intervening private or public networks. Modems, cable modem and Ethernet cards are just a few of the currently available types of network adapters.
The description of the present invention has been presented for purposes of illustration and description, and is not intended to be exhaustive or limited to the invention in the form disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art. The embodiment was chosen and described in order to best explain the principles of the invention, the practical application, and to enable others of ordinary skill in the art to understand the invention for various embodiments with various modifications as are suited to the particular use contemplated.