Description
METHOD FOR LOADING DEVICE DRIVERS
Technical Field
The present invention is directed toward a method for loading device drivers and, more particularly, a method for loading device drivers without changing the underlying drivers, without using a disc memory, and with minimum overhead.
Background of the Invention
Personal computers are becoming more and more commonplace in today's society. Personal computers typically include a central processing unit (CPU) that is controlled by basic instructions referred to as the operating system of the computer. Generally, the personal computer requires one or more peripheral devices to extend its capabilities. Typical peripheral devices include keyboards, display screens, printers, disc drives, modems, etc. Typically, a device driver is required to interface the operating system of the personal computer with the peripheral devices. Device drivers are small computer programs that receive instructions and data from the operating system that are independent of the peripheral device for which the instructions and data are intended. The device driver responds to the device independent instructions and data from the operating system to provide instructions and data to the peripheral device that are dependent upon the nature and construction of the particular peripheral device. Accordingly, device drivers will typically provide additional information to the peripheral device to enable the peripheral device to perform the functions requested by the operating system. By providing different device, drivers with different peripheral devices, the operating system of the computer can interface with peripheral devices made from different manufacturers.
So that the personal computer can interface with all of its peripheral devices, the device drivers must be loaded into the computer memory and initialized prior to operation of the personal computer. Typically, loading the device drivers usually occurs when the personal computer is turned on. When the personal computer is turned on, the operating system performs functions necessary prior to operation. As mentioned above, one of these
functions is to load the device drivers from a permanent storage location into the computer memory.
Presently, two methods exist for loading and initializing device drivers into the computer memory when the computer is turned on. The first method relies upon configuration data, a file typically called CONFIG.SYS., being stored in the computer's memory to determine which device drivers are stored in permanent memory and to load and initialize these device drivers. When a new device, and device driver, are added to the personal computer, the CONFIG.SYS file is updated to include information identifying the new driver, its location on the disk, and the location of its initialization program. Accordingly, when the CONFIG.SYS file is accessed, it includes all necessary information to locate each device driver and the routine for loading and initializing the device driver. The CONFIG.SYS file then executes these routines so that each device driver is loaded and initialized. The other presently available method for loading and initializing device drivers is referred to as ROMDOS. The ROMDOS method enables the device drivers to be stored in read only memory (ROM). To load the device drivers, however, the ROMDOS method relies on the CONFIG.SYS file. Accordingly, the ROMDOS method must provide instructions and data to simulate a hard disk so that the device drivers stored in read only memory (ROM) can be accessed using the CONFIG.SYS file. Further, the ROMDOS method relies upon a subprogram, typically referred to as CONFPROC.SYS, to interface with the CONFIG.SYS file thereby enabling the CONFIG.SYS file to identify and load the device driver stored in read only memory. Although effective, this method requires unnecessary memory for storing the CONFPROC.SYS subprogram. Further, this method creates additional inefficiencies in operating the computer and in storing the device drivers.
Accordingly, it is desirable to provide a method for storing device drivers in read only memory so that the device drivers can be loaded with minimum storage overhead and without changing the underlying device drivers.
Summary of the Invention
The present invention is a method for storing a plurality of device drivers in the adapter region of an address space of a computer so that the device drivers can be loaded into a computer memory of the computer. The method includes the steps of providing a header for each device driver wherein each header includes instructions and data for loading its respective device
driver and wherein each header includes a driver size identifier. The method further includes the step of storing the plurality of device drivers and headers in a portion of the adapter region so that each header occupies an address space with addresses that are in sequence with the addresses of the address space occupied by its respective device driver. The plurality of device drivers and headers are further stored so that they occupy an address space having addresses that are sequential. The driver size identifier of each header is provided to identify the number of addresses of the address space occupied by the header and its respective device driver. The plurality of device drivers and headers are further stored so that the first address of a subject header and its driver size identifier can be combined to provide the first address of another header next following the subject header.
In operation, the method includes the steps of identifying a current driver scan address. The method also includes the step of accessing the current driver scan address and determining whether the information stored at the current driver scan address is associated with a header and, if so, performing the remaining steps, and, if not, determining that all drivers have been loaded. After the current driver scan address has been accessed, the instruction of the header associated with the current driver scan address are executed to load the device driver associated with the header. Thereafter, a driver size identifier of the header is accessed and combined with the current driver scan address to identify the new current driver scan address. The method is repeated until the determination is made that all drivers have been loaded.
Brief Description of the Drawings
Figure 1 is a diagram illustrating the data structure for storing device drivers in the adapter region of a computer's address space;
Figure 2 is a diagram illustrating the data structure for a header to. be associated with a device driver as shown in Figure 1; and Figure 3 is a decision flow diagram illustrating the method for loading device drivers from the adapter region of a computer's address space.
Detailed Description of the Invention
The present invention is a method for storing device drivers in the adapter region of a computer's address space. Further, the subject invention includes the method for loading the device driver into the computer's memory from the adapter region.
As is known in the art, personal computers are typically provided with a central processing unit (CPU) that defines an address space of the computer. The address space is typically divided into an adapter region, sometimes referred to as an upper memory region, and computer memory. Commonly, the computer memory refers to random access memory (RAM) that is used by the computer for storing programs, instructions, data, and other information with which the central processing unit is currently working. The adapter region is commonly used for positioning memory and other devices to be accessed by the central processing unit at times when it is not accessing its computer memory.
A particularly unique feature of the present invention is the ability to store device drivers in the adapter region of the computer's address space. The device drivers are stored in a manner so that the amount of memory necessary to store additional information for loading and initializing the device driver is minimized. A data structure 100 illustrating the manner in which the device drivers are stored in the adapter region is shown in Figure 1.
The data structure 100 includes an operating system portion 102, referred to in Figure 1 as DOS Base. The operating system portion 102 is a portion of the operating system of the computer that is stored in the adapter region for facilitating the identification, loading, and initialization of the device drivers, as will be described more fully below. The operating system portion 102 is preferably stored at a predetermined address of the adapter region so that it can be readily identified by the remaining portion of the computer's operating system. However, it will be apparent to those skilled in the art that many techniques can be employed to identify the operating system portion 102.
Generally, the operating system portion 102 is provided to identify the location of the device drivers to be loaded into the computer's memory. For this reason, the operating system portion 102 illustrated in Figure 1 includes an , operating system size identifier for identifying the size of the operating system portion. Preferably, the plurality of device drivers will immediately follow the operating system portion 102, as will be discussed below. Therefore, by identifying the size of the operating system portion 102, i.e., the number of addresses associated with the address space occupied by the operating system portion, then the first address of* the operating system portion can be mathematically combined with the operating system size identifier to provide the identity of the first address wherein the device driver information will be found.
The operating system portion 102 further includes a common driver signature that is used to identify the last device driver, as will be discussed more fully below.
The data structure 100 further includes a plurality of device drivers 104-1 through 104-N, where N is the total number of device drivers stored. In accordance with the subject invention, a plurality of headers 106-1 through 106-N are each associated with a respective device driver. As shown in Figure 2 with respect to one header 106-i, the plurality of headers include a driver signature 200 (Figure 2), a driver size identifier (DSID) 202, and instructions and data 204 for loading and initializing its associated device driver 104-i (not shown).
In accordance with the presently preferred embodiment of the invention, the common driver signature 200 that is stored in the operating system portion 102, as discussed above, is also stored at the first address of the header 106-i, the first address being referred to herein as the current driver scan address (CDSA). Further, the common driver signature 200 is a 2 byte signature followed by the driver size identifier (DSID) 202. The driver size identifier 202 occupies another 2 bytes of memory and is followed by the instructions and data 204. An important aspect of the subject invention is that the operating system portion 102 is able to locate each header. Accordingly, by knowing the current driver scan address (CDSA) of any header 106-i, the computer can access the common driver signature 200, the driver size identifier (DSID) 202, or the instructions and data 204 for loading and initializing the associated device driver. Still further, by knowing the current driver scan address (CDSA), the computer also knows the first address of the associated driver 104-i.
Returning to Figure 1, in accordance with the present invention, the plurality of device drivers and headers are each stored in a portion of the, adapter region directly following the operating system portion 102. With reference to Figure 1, it will be understood that the address space occupied by the operating system portion 102 has addresses that are lower than the addresses occupied by the header 106-1. Similarly, the addresses of the address space occupied by the header 106-1 are lower than the addresses of the address space occupied by the driver 104-1, etc. It is significant, however, that the addresses of the address space occupied by the drivers 104-1 through 104-N and the headers 106-1 through 106-N are sequential. It will be further appreciated that the header 106-1 associated with the driver 104-1 occupies an address space
having addresses that are sequential with the addresses of the address space occupied by its associated driver 104-1. In this manner, the driver size identifier referred to in Figure 2 can be combined with the current driver scan address and the predetermined size of the header to determine the location of the next header 106-i and its associated driver 104-i to be loaded. In this manner, the plurality of drivers can be readily identified, loaded, and initialized using the headers 106-i.
Referring to Figure 3, a decision flow diagram is provided illustrating the method for identifying the device drivers to be loaded into the computer memory. Initially, the operating system of the computer will locate and access the operating system portion 102 (DOS Base) and determine a current driver scan address (CDSA), step 300. As discussed above, the operating system portion 102 includes an operating system size identifier for determining the first address following the operating system portion 102. That address is identified as the current driver scan address (CDSA).
After determining a current driver scan address (CDSA), the computer determines whether the information located at the current driver scan address (CDSA) is the common driver signature 200 (Figure 2) and, if not, determines that all device drivers have been loaded, step 302. If, however, the information located at the current driver scan address (CDSA) is the common driver signature, then the computer will execute the instructions and data 204 of the header 106-i to load and initialize the device driver 104-i, step 304. After the device driver has been loaded and initialized, the computer will locate the driver size identifier (DSID) 202 of the header 106-i, step 306. The driver size identifier (DSID) 202 is then combined with the current driver scan address (CDSA) to determine the new current driver scan address, step 308. Thereafter, step 302 is repeated to determine whether the new current driver scan address includes a driver signature.
It will be apparent to those skilled in the art that, when the driver signature is found, the computer knows it has located still another header and, therefore, determines that another device driver remains to be loaded and initialized. Further, since the plurality of headers and device drivers are stored in a portion of the address space of the adapter region having sequential addresses, if the new current driver scan address (CDSA) does not include the driver signature, then all device drivers have been loaded.
Still further, significant advantages can be realized from the method of the subject invention. Generally, in accordance with the above-
described method of the subject invention, the operating system will provide the header 106-i with a pointer to an address where the device driver is to be loaded. During execution of step 304, the header will load the device driver at the address indicated by the pointer so that the device driver is loaded into the computer's memory for operation. However, an alternative method for operating the device driver permits the device driver to be executed directly from the read only memory positioned in the upper memory region of the computer's address space. In accordance with this method, the operating system passes a pointer to the header to identify where the device driver is to be stored. However, instead of storing the complete device driver in the computer's memory, the header will only store variables needed during operation of the device driver along with a small number of instructions and data to identify where the device driver is stored in the upper memory region. The complete device driver code will not be copied into the computer's memory space. Thereafter, access to the device driver will be in the upper memory region via the small driver identification code loaded in the computer's memory. This method of operation provides significant savings in the random access memory of the computer.
From the foregoing, it will be appreciated that, although specific embodiments of the invention have been described herein for purposes of illustration, various modifications may be made without deviating from the spirit and scope of the invention. Accordingly, the invention is not limited except as by the appended claims.