×

Method and apparatus for intercommunications amongst device drivers

  • US 7,979,868 B2
  • Filed: 01/07/2007
  • Issued: 07/12/2011
  • Est. Priority Date: 01/07/2007
  • Status: Active Grant
First Claim
Patent Images

1. A machine-implemented method for managing device drivers of devices in a computer, the method comprising:

  • providing an application programming interface (API) by a kernel of an operating system (OS) executed in a memory by a processor of a computer, the API being accessible by a plurality of device drivers associated with a plurality of devices in the computer, wherein each of the plurality of devices is represented by a node of a device tree having a hierarchical structure, and wherein the API is maintained by a node that is a most top node in the device tree;

    receiving, at a device manager running within the kernel via the API, a request from a first instance of a device driver during an initialization of the first instance of the device driver, wherein the first instance of the device driver was launched in response to an initialization of a first of the plurality of devices installed in the computer;

    in response to the request, determining, by the device manager based on the request, whether a second instance of the device driver is currently loaded within the kernel for supporting a second of the plurality of devices installed in the computer, including accessing a data structure having a plurality entries corresponding to the plurality of devices, wherein each entry includes a first field to store an identifier of a corresponding device and a second field to store a handle of a device driver currently associated with the corresponding device;

    inserting a first handle of the first instance of the device driver in the second field of a corresponding device in the data structure if the second field is empty;

    starting the first instance of the device driver if the second field of the corresponding device is empty;

    returning, by the device manager via the API, a first driver handle of the first instance of the device driver if the second instance of the device driver has not been loaded;

    returning, by the device manager via the API, a second driver handle of the second instance of the device driver if the second instance of the device driver has been loaded, including retrieving the second driver handle from the second field of the corresponding device in the data structure; and

    unloading the first instance of the device driver if the second instance of the device driver is currently loaded, wherein the returned first and second driver handles are used by the first instance of the device driver to determine whether the first instance of the device driver should unload itself from the memory prior to finishing the initialization of the first instance of the device driver, such that only one instance of the device driver is loaded in the memory during regular operations of the device driver.

View all claims
  • 1 Assignment
Timeline View
Assignment View
    ×
    ×