The invention relates generally to the field of interconnecting devices with a computer, and more specifically, to swapping or changing the devices interconnected with a computer while the computer is in operation.
Drivers for fully xe2x80x9cplug-and-playxe2x80x9d operating systems and devices can handle the addition and removal of devices with little to no active involvement of the user. As a result, fully xe2x80x9cplug-and-playxe2x80x9d systems allow relatively unsophisticated users to install and exchange devices both easily and seamlessly, and without any need for the user to understand the software or have programming capability.
Within each operating system, there are a series of drivers for discovering and initializing devices included in a computer so that they can properly communicate with all of the resources of the computer. For operating systems, such as Windows 95(copyright) or 98(copyright) (products of Microsoft Corporation), the drivers enumerate or recognize the devices connected to the computer when the driver is started during the installation or booting up of the operating system. For some devices, however, their associated device driver is not fully xe2x80x9cplug and playxe2x80x9d enabled. Examples of these drivers include the IDE driver for hard disk drives and the floppy driver for floppy drives. Because these drivers are not fully xe2x80x9cplug and playxe2x80x9d enabled, the drivers for these devices are unable to enumerate the devices during runtime.
Due to this limitation, these operating systems cannot support the swapping of devices having not fully xe2x80x9cplug and playxe2x80x9d drivers, such as hard drives, CD-ROM drives and floppy drives, while the system is running (hot swapping) or in a sleeping state (warm swapping). Rather, the swapping or exchange of one of these devices for another requires the user to restart or reboot the computer. This requirement is both time-consuming and inconvenient to the user.
Briefly, the present invention comprises a method for enumerating a first device present in a computer system to make the first device recognizable to the computer system, the computer system having a memory and an operating system which uses a data structure stored in the memory for establishing a working configuration of the computer system, the data structure having one or more device nodes corresponding to devices present in the computer system, the method including the steps of providing an indication to the operating system that the first device has been inserted into the computer system while the computer system is in operation, enumerating a controller for controlling the first device in response to the indication, initializing a driver associated with the first device controller in response to the enumeration of the first device controller, locating, with the initialized driver, an enumerator associated with the first device controller, and enumerating the first device with the located enumerator, wherein the driver associated with the first device controller is only capable of locating the enumerator associated with the first device controller when initialized.
In another aspect of this method, prior to the step of connecting the first device, the method further includes the steps of determining whether a second device in the computer system is currently being accessed, removing the device node corresponding to the second device and a device node corresponding to a controller for controlling the second device from the data structure, isolating any data signals which are transmitted between the second device and the second device controller from being transmitted from the second device controller to the second device, and powering off the second device.
In yet another aspect of this method, the step of removing the device nodes corresponding to the second device and the second device controller includes the substep of unloading all drivers associated with the second device and the second device controller.
In a further aspect of the present invention, a computer program product comprises a computer usable medium having computer readable program code modules embodied therein for enumerating a first device present in a computer system to make the first device recognizable to the computer system, the computer system having a memory and an operating system which uses a data structure stored in the memory for establishing a working configuration of the computer system, the data structure having one or more device nodes corresponding to devices present in the computer system, the computer program product including a first enumeration module for enumerating a controller for controlling the first device after inserting the first device into the computer system while the computer system is in operation, an initialization module for initializing a driver associated with the first device controller in response to the enumeration of the first device controller, a locator module for identifying, with the initialized driver, an enumerator associated with the first device controller, and a second enumeration module for enumerating the first device with the located enumerator associated with the first device controller, wherein the driver associated with the first device controller is only capable of locating the enumerator associated with the first device controller when initialized.