1. Technical Field
The present invention relates generally to an improved data processing system and in particular to a method and apparatus for processing data. Still more particularly, the present invention relates to a method, apparatus, and computer instructions for hardware discovery in a data processing system.
2. Description of Related Art
When a computer is powered on, a boot program is used to boot or start the computer executing instructions. The boot program is employed to prepare the system for the operating system, load the operating system and then pass control of the computer to the operating system. Typically, the boot program is a boot firmware found on the data processing system. In some cases, the boot program may be distributed by a server on a network. The boot program probes and initializes the hardware in the system before finding and loading the operating system. When control is passed to the operating system, the boot process has been completed, but the full system initialization is not.
In probing and initializing the data processing system, the boot program typically probes or interrogates busses in the data processing system to find and initialize hardware components. These hardware components include, for example, an I/O bridge, a small computer system interface (SCSI) adapter, a network adapter, a monitor, a disc drive, a keyboard, or a tape drive. The boot program sends out requests for identification from various hardware components. In turn, the hardware components may return information, such as identifiers, which are used by the group program to identify and initialize the hardware components. In other words, the boot program interrogates the bus to identify components that may be connected to the bus.
After the boot program has identified the hardware components in the data processing system, the boot program then loads the operating system and passes control of the data processing system to the operating system. At that point, the operating system runs and controls the different aspects of the data processing system.
With large data processing systems, a planned or unplanned shutdown or restart of a data processing system may take a large amount of time. The amount of time needed to restart the operating system changes depending on the number of busses and components attached to those busses. Adding additional components to a data processing system increases the time needed to restart the data processing system because additional time is required to identify and initialize those components during the boot process.
The time needed to reboot a large data processing system, such as a server data processing system, is often inconvenient for users. Therefore, it would be advantageous to have an improved method, apparatus, and computer instructions for restarting or booting a data processing system as this represents time the data processing system is not available to perform its intended task.
The present invention provides a method, apparatus and computer instructions for discovering hardware nodes having a hierarchical organization. A subset of the hardware nodes in the data processing system is initialized prior to loading an operating system supporting parallel threads. In response to loading the operating system, a thread for each hardware node discovered below a known hardware node is created to form a set of threads.
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:
With reference now to the figures and in particular with reference to
Referring to
Peripheral component interconnect (PCI) bus bridge 214 connected to I/O bus 212 provides an interface to PCI local bus 216. A number of modems may be connected to PCI local bus 216. Typical PCI bus implementations will support four PCI expansion slots or add-in connectors. Communication links may be provided through modem 218 and network adapter 220 connected to PCI local bus 216 through add-in connectors.
Additional PCI bus bridges 222 and 224 provide interfaces for additional PCI local buses 226 and 228, from which additional modems or network adapters may be supported. In this manner, data processing system 200 allows connections to multiple network computers. A memory-mapped graphics adapter 230 and hard disk 232 may also be connected to I/O bus 212 as depicted, either directly or indirectly.
Those of ordinary skill in the art will appreciate that the hardware depicted in
The data processing system depicted in
The present invention provides a method, apparatus, and computer instructions for reducing boot times. Specifically, the mechanism of the present invention reduces the amount of time needed to perform the discovery of devices during the boot process prior to loading of the operating system. Only a subset of the hardware components are identified or discovered during the initial boot process. The hardware devices, also referred to as hardware nodes, in this subset are ones that are necessary for operation of a data processing system in the illustrative examples. Additional components known not to be needed to load and control the operating system are not discovered. Instead, the hardware discovery for these nodes are deferred until a operating system is loaded and a multi-threaded environment is present. Only a portion of the hardware nodes are identified because operating systems typically will perform their own discovery of the whole hardware system before looking for other resources, such as the main file system. As a result, performing discovery of all of the hardware nodes in the data processing system prior to loading of the operating system is redundant and unnecessary.
Preferably additional boot-time reduction is obtained by the deferral of the discovery of the whole data processing system until the user-space environment is operational. The mechanism of the present invention also takes advantage of a multi-threaded environment after the operating system has been loaded to speed up the boot process. Each time a hardware node is located, the mechanism of the present invention creates a new thread to identify additional nodes.
A thread is one transaction or method in a multi-threaded system. A thread is a basic unit of processor utilization in these examples and typically includes a program counter, a register set, and a stack space. A multi-threaded system allows for multi-tasking. Multiple streams of execution may take place concurrently within the same program with each thread or stream processing a different transaction or message.
The hardware nodes in a data processing system are arranged in a hierarchical manner. For example, an I/O bridge, such as I/O bridge 210 has daughter or child nodes, such as PCI bridge 214, PCI bridge 222, PCI bridge 224, graphics adapter 230, and hard disc 232. PCI bridge 214 in
Turning now to
The discovery of the additional hardware nodes does not occur until after user space 302 becomes operational. User space 302 provides space for processes, such as application 310 and control process 312. Control process 312 may be used to control operating system 300.
In this example, discovery process 308 is located in both user space 302 and kernel 304. Depending on the particular implementation, discovery process 308 may be located entirely within kernel 304 or within user space 302. Discovery process 308 provides for the discovery and initialization of hardware after operating system 300 has taken control of the data processing system.
Discovery process 308 creates a thread for each node discovered within hardware nodes 306. More specifically, a thread is created for each hardware node that is connected to a bus on a level below the hardware node. In this manner, the mechanism of the present invention allows for parallel discovery and initiation of hardware within hardware nodes 306. As a result, the amount of time needed to discover and initialize hardware is reduced.
After the limited subset of nodes is discovered, this discovered process is suspended until user space is active. At that time, the discovery process is resumed through discovery process 308. The resumption of the discovery process using discovery process 308 may be initiated through control process 312.
Hardware discovery takes additional time because some hardware nodes may take more time to respond than others. For example, a disk drive requires time to spin up before responding to requests during the boot up process. Thus, if parallel discovery does not occur, the discovery and initialization of the next hardware node must wait until the disk drive has spun up and responded. With the mechanism of the present invention, this wait time is unnecessary because another thread may perform discovery processes separate from the thread waiting on the disk drive to respond.
Turning next to
In this example I/O bridge 420 has a connection to I/O bridge 422 and I/O bridge 424. I/O bridge 422 is connected to display adapter 426. I/O bridge 424 has a connection to I/O bridge 428. I/O bridge 428 is connected to SCSI controller 430, and network adapter 432, and SCSI controller 434. SCSI controller 430 is connected to disk 436. SCSI controller 434 is connected to disk 438 and disk 440.
Disk 412 and disk 414 are connected to SCSI controller 404 through a SCSI bus. As depicted, the components are connected to each other in a hierarchical fashion. I/O bridge 400 is a hardware node in which I/O bridge 402 is a child node on a level below I/O 400. I/O bridge 400 is connected to I/O bridge 402 via a bus, such as an I/O bus. This bus may be, for example, I/O bus 212 in
In accordance with an illustrative embodiment of the present invention, a boot process does not discover and initialize all of the hardware nodes illustrated in
The particular components that are to be identified and initialized during the boot up process may be stored in a configuration file or some other data structure. This data structure is accessed by the boot process to determine which components to discover and initialize during the initial boot process prior to loading the operating system. In these depicted examples, these components are selected as a minimum subset that is required for the operating system to be loaded and take control of the data processing system in these illustrative examples. An example of minimal requirements for an initial boot include storage of base file system, console (graphics adapter, serial port, keyboard, etc.), and optionally control and administration network adapters.
After the operating system has been loaded and has taken control and preferably after it has preformed initialization of minimal hardware subset and user-space environment is operational, the remainder of the hardware nodes are then discovered and initialized in accordance with illustrative embodiments of the present invention. This process may be implemented in a discovery process, such as discovery process 308 in
Discovery process 308 creates a thread for each hardware node. A thread created for a hardware node is used to discover and initialize components connected to that hardware node on a level below the hardware node in the hierarchical structure of hardware components. In particular, the thread interrogates a bus for hardware nodes on the level below the hardware node associated with the thread. Interrogation of the bus leading back to an upper level is not performed by this thread. In these examples, the threads are for probing ports and/or possible connection points for additional hardware connected to a given node.
For example, thread 442 is generated by a discovery process for bridge 420. Thread 442 interrogates busses attached to I/O bridge 420 to locate other hardware nodes. For example, thread 442 may discover I/O bridge 422 and I/O bridge 424. In response to these two hardware nodes being discovered, thread 444 and thread 446 are created.
Thread 444 searches for hardware nodes on a level below I/O bridge 422. Thread 444 does not interrogate the bus connecting I/O bridge 422 to I/O bridge 420. Thread 446 searches for hardware nodes on a level below I/O bridge 424. Thread 444 discovers display adapter 426. Thread 446 discovers I/O bridge 428.
In discovering I/O bridge 428, thread 448 is created. This thread discovers SCSI controller 430, network adapter 432, and SCSI controller 434. In discovering each of these hardware nodes, threads (not illustrated) are created to perform further discovery of hardware nodes. Specifically, threads 450, 452, and 454 are created for SCSI controller 430, network adapter 432 and SCSI controller 434, respectively. These threads proceed to perform discovery processes for any hardware nodes that may be connected to these nodes.
In this manner, parallel threads may execute concurrently to discover and initialize components for the operating system. These threads take advantage of the multi-tasks and multi-threaded environment that is provided by the operating system. Thus, faster discovery of hardware nodes occurs.
As a result, the time for the process of restarting or booting the data processing system is reduced by only discovering a subset of the hardware nodes prior to control being passed through the operating system. This reduced discovery and initialization of components reduces the amount of time to boot or restart a data processing system because fewer components are discovered by both the boot and operating system code. Additional reduction in time is achieved through starting the user space and then finishing probing of the data processing system for the remaining hardware.
Further, by using a parallel discovery process, through employing multiple threads in a multi-threaded environment, the process of discovery hardware nodes is sped up as compared to a serial discovery process in which hardware nodes are discovered one at a time, rather than in parallel.
Turning now to
The process begins by running boot code to load the operating system, (step 500). Thereafter, an initial subset of devices is identified (step 502). The mechanism of the present invention introduces the use of identifying only a subset of devices. Thereafter, the root file system is identified (step 504). User control processes are started (step 506). Steps 504 and 506 are normal steps taken during the booting or starting of a data processing system. Step 506 provides an ability to administer and control an operating system as well as initiate a fail over protocol.
Next, discovery of the remaining hardware is initiated (step 508). This step also is a new concept introduced by the mechanism of the present invention in which the discovery of the remaining hardware occurs after the use of space is operational. This mechanism may employ new features similar to existing hot plug or plug-in-play technology. Plug-in-play is an ability of a data processing system to have new devices, such as peripherals, added to the data processing system without having to restart the computer. Plug-in-play is also referred to as PnP and hot swapping.
Thereafter, a determination is made as to whether all application required hardware has been found (step 510). If all of the application required hardware has been found, then the user application is started (step 512) with the process terminating thereafter.
With reference again to step 510, if all of the hardware required for the applications have not been, an error is generated (step 514) with the process terminating thereafter. Steps 510, 512, 514 are steps currently found in operating system environments.
With reference now to
The process begins by identifying an initial set of hardware nodes (step 600). This initial set of hardware nodes is a subset of the hardware nodes in a data processing system. The set of hardware nodes is identified in these illustrative examples in a data structure, such as a configuration file based on this set of hardware.
The hardware nodes in this initial set is discovered and initialized (step 602). Thereafter, the operating system is loaded (step 604) and control is passed to the operating system (step 606) with the process terminating thereafter.
Turning now to
The process begins by finishing initialization of the current node (step 700). Thereafter, a first possible connection is probed (step 702). A determination is as to whether a hardware node is found on the first connection (step 704). If a hardware node is found, resources are assigned to the hardware node and addressing is established for the hardware node (step 706).
Then, a new thread is created for the found hardware node (step 708). A determination is then made as to whether additional possible connections are present (step 710). If additional possible connections are present, the process probes the next connection (step 712) with the process then proceeding to step 704 as described above.
With reference again to step 710, if additional possible connections are not present, the process terminates. Turning back to step 704, if a hardware node is not found, the process proceeds to step 710 as described above.
Thus, the present invention provides an improved method, apparatus, and computer instructions for discovering hardware nodes in a data processing system. The mechanism of the present invention only looks for a subset of the hardware nodes in a data processing system during the initial boot up process prior to the operating system being loaded. Only those hardware nodes needed for the operating system to execute are discovered by the boot process and initial operating system discovery in these illustrative examples. Of course, more components than those minimally needed to run the operating system may be discovered during the initial boot process depending on the implementation.
The discovery of the rest of the hardware nodes is deferred until after the operating system has loaded and a multi-threaded environment is present and the base operating system is initialized. At that time, the discovery process that uses multiple threads to discover hardware nodes in parallel is employed. This parallel discovery reduces the amount of time needed to discover and initialize hardware nodes in a data processing system.
Further, by only discovering a subset of the hardware nodes during the initial boot up process, repetition of discovering hardware nodes is eliminated for many new nodes. In this manner, the mechanism of the present invention reduces the amount of time needed to boot a data processing system.
The mechanisms used for discovery and initialization of components after the operating system has been loaded may be implemented in different ways. For example, the mechanism used for adding hardware through “hot-plugging” hardware may be employed. In addition, some busses may allow the rediscovery of resources through the assistance of bios callbacks. Other mechanisms that may be used include device naming by identification and labeling, rather than probing devices in assignment order. This naming feature is often present to support buses that have a highly pluggable nature. In these examples, the threads are dynamically created as new nodes are discovered. These threads are created upon the discovery of a node that is connected to a bus.
The mechanism of the present invention also allows for a faster explicit service handoff in a clustered environment as opposed to requiring a timeout for a missing host. This is because we probe the required hand-off resources in the initial set and wait to probe the remaining resource required for the applications until after the handoff. It is important to note that while the present invention has been described in the context of a fully functioning data processing system, those of ordinary skill in the art will appreciate that the processes of the present invention are capable of being distributed in the form of a computer readable medium of instructions and a variety of forms and that the present invention applies equally regardless of the particular type of signal bearing media actually used to carry out the distribution. Examples of computer readable media include recordable-type media, such as a floppy disk, a hard disk drive, a RAM, CD-ROMs, DVD-ROMs, and transmission-type media, such as digital and analog communications links, wired or wireless communications links using transmission forms, such as, for example, radio frequency and light wave transmissions. The computer readable media may take the form of coded formats that are decoded for actual use in a particular data processing system.
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.