1. A host device comprising: a communications unit for exchanging information with a peripheral device having firmware, the communication unit receiving an identification code of the peripheral device through the communication unit; a first memory for storing an identification code of the host device having firmware; a second memory for storing firmware of the host device and the peripheral device; a discrimination unit for discriminating an optimum environment for operation of the combination of both devices based on both identification codes and the firmware stored in the second memory; and shunting means for shunting firmware stored in the second memory with the firmware of a peripheral device or the host device in accordance with the discrimination result.