CN101853142A - Identification method of USB device with virtual drive - Google Patents
Identification method of USB device with virtual drive Download PDFInfo
- Publication number
- CN101853142A CN101853142A CN 201010162529 CN201010162529A CN101853142A CN 101853142 A CN101853142 A CN 101853142A CN 201010162529 CN201010162529 CN 201010162529 CN 201010162529 A CN201010162529 A CN 201010162529A CN 101853142 A CN101853142 A CN 101853142A
- Authority
- CN
- China
- Prior art keywords
- usb device
- usb
- flag
- state
- host computer
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Landscapes
- Stored Programmes (AREA)
Abstract
The invention relates to an identification method of a USB device with a virtual drive. When the USB device is plugged into a computer host, the processing flow of the USB device comprises the following steps: A. carrying out various initialization operations by the USB device; B. arranging identifiers; C. starting the USB device and determining the state of the identifiers in a memorizer; D. processing the request for acquiring character string descriptors sent by the computer host by the USB device; E. executing the operation of the USB virtual drive if the identifiers in the step D are in state 1; and F. executing the operation of a USB compound device if the identifiers in step D are in state 2. The invention has the advantage that by the principle and method, no matter whether the Windows operating system of the computer host is provided with the drive of the USB compound device with multiple interfaces or not, after the USB device is plugged into the host, the warning that the drive of the device can not be found can not pop up in the Windows operating system.
Description
Technical field
The present invention relates to the communication technology of USB (Universal Serial BUS, USB (universal serial bus)) equipment and host computer, relate in particular to the recognition technology of USB equipment complex and host computer.
Background technology
USB device is meant that the equipment that has USB interface such as mouse, keyboard, printer, scanner, camera, flash disk, MP3 machine, mobile phone, digital camera, portable hard drive, external smooth floppy drive, USB network interface card, ADSL Modem, Cable Modem etc. have the various external units of USB interface.Because it is fast, easy to use that USB interface has transmission speed, support hot plug, connect advantages such as flexible, independently-powered, this type of device category is more and more.In the logical organization of USB device, comprise equipment, configuration, interface and 4 levels of end points.Each USB device can comprise one or more sets configurations, and different configurations makes equipment list reveal different function combinations, and at synchronization, equipment can only use a cover configuration.One cover configuration can be made up of one or more logic interfacings, and in usb protocol, a logic interfacing is represented a basic functions, and the equipment with a plurality of logic interfacings is called the USB equipment complex.
USB device all need provide the corresponding driving program in use usually, it mainly is to provide the drive installation CD with equipment that USB device producer provides the approach of driver, but increased the cost of producer like this, CD is drawn flower because of carelessness or is lost and more can cause equipment to use under new environment simultaneously.At above-mentioned deficiency, be in USB device, to divide one section storage area to come the storing driver installation procedure in the prior art, USB device on original basis more adds a logic interfacing and on main frame this interface is exposed into a virtual drive interface, the zone of that section storing driver installation procedure is exposed to host computer with this interface, and that section storage area just is shown as virtual drive in host computer.This method has been added a logic interfacing more makes USB device must become the USB equipment complex, when inserting equipment first, because the driving of USB equipment complex is not installed as yet, Windows operating system will eject the warning that can not find device drives, and domestic consumer sees that these information will inevitably be all adrift.
Summary of the invention
The objective of the invention is in order to make USB device in Windows operating system, can not eject the warning that can not find device drives, proposed a kind of recognition methods of the USB device with virtual drive.
To achieve these goals, technical scheme provided by the invention is: 1. recognition methods with the USB device of virtual drive is characterized in that when USB device was inserted host computer, the treatment scheme of USB device comprised step:
A.USB equipment carries out various initialization operations;
B., flag is set, a flag is set in the storer of USB device, and make this flag have two states, the driving of state one expression USB device is not installed, the driving of state two expression USB device is installed, and when USB device was connected with host computer and starts first, the flag of USB device was initialized as state one, and make this flag after start-up course in can not be initialised again, and its address space can not taken by other program yet;
The C.USB device start is also judged the state of storer flag, when flag be state for the moment, start single interface configuration, USB device exposes as the USB virtual drive; When flag is state two, start many interface configuration, USB device exposes as the USB equipment complex;
The character string descriptor request of obtaining that D.USB device processes host computer is sent, and judge whether a last request is the request that configuration is set, if and the flag in the storer is state one, then the flag of storer is made as state two and USB device is restarted; Otherwise the state of storer flag is judged in continuation;
E. if flag is a state one among the step D, carry out the operation of USB virtual drive backward, USB equipment complex driver is installed, and the drive installation program can be revised as USBCCGP from USBSTOR with the service entry of registering in registration table for USB device in the Windows operating system;
F. if flag is a state two among the step D, carry out the operation of USB equipment complex backward, carry out the functional performance of various USB equipment complexes.
Principle of the present invention is to allow USB device initialization two cover configurations when starting, and a cover configuration only provides single interface configuration of a virtual drive interface, and an other cover configuration provides and comprises the many interface configuration of virtual drive interface in interior a plurality of logic interfacings.Always select single interface configuration when USB device starts for the first time, start with this configuration judge host computer in the back Windows operating system whether erecting equipment drive, restarting equipment then, and select the many interface configuration of startup is installed if drive.Otherwise do not restart, continue to carry out the driving that the USB equipment complex is installed in the virtual drive operation backward.
The invention has the beneficial effects as follows: utilize above-mentioned principle and method, no matter the driving of on the Windows operating system of host computer whether the USB equipment complex of many interfaces being installed, Windows operating system can not eject the warning that can not find device drives after USB device was inserted main frame.
Description of drawings
Fig. 1 is the processing flow chart of the USB device of the embodiment of the invention.
Fig. 2 is the Windows operating system processing flow chart of the embodiment of the invention.
Embodiment
Below in conjunction with the drawings and specific embodiments the present invention is described in detail.
In the present embodiment, host computer is selected standard configuration commonly used in the prior art, and operating system can be selected the WinXp of Windows operating system, Vista, versions such as Win7.When USB device is exposed to single interface, host computer can think that the USB device of this moment is a USB virtual drive, host computer is that USB device loads standard driver usbstor.sys by Windwos operating system, if this equipment is not also registered the driver service entry in the registration table again, Windows operating system also can be USB device registration service item USBSTOR in registration table; When USB device is exposed to many interfaces, host computer can think that the USB device of this moment is the USB equipment complex, host computer is that USB device loads USB equipment complex driver usbccgp.sys by Windwos operating system, if this equipment is not also registered the driver service entry in the registration table again, Windows operating system also can be USB device registration service item USBCCGP in registration table.As shown in Figure 1, a kind of recognition methods of the USB device with virtual drive, when USB device was inserted host computer, the treatment scheme of USB device comprised step:
A.USB equipment carries out various initialization operations, and for example initializes memory makes storer to use.
B., flag is set, a flag is set in the storer of USB device, and make this flag have two states, the driving of state one expression USB device is not installed, the driving of state two expression USB device is installed, and when USB device was connected with host computer and starts first, the flag of USB device was initialized as state one, and make this flag after start-up course in can not be initialised again, and its address space can not taken by other program yet.Present embodiment null representation state one, non-zero identification-state two, when USB device is connected with host computer and starts first, it is promptly zero that the flag of USB device is initialized as state one, can be in the start-up course afterwards again to this flag initialization, and the address space of this flag can not taken by other program yet.The state one in this step and the concrete numerical value of state two also can be exchanged.
The C.USB device start is also judged the state of storer flag, when flag be state for the moment, start single interface configuration, USB device exposes as the USB virtual drive; When flag is state two, start many interface configuration, USB device exposes as the USB equipment complex;
The character string descriptor request of obtaining that D.USB device processes host computer is sent, and judge whether a last request is the request that configuration is set, if and the flag in the storer is state one, then the flag of storer is made as state two and USB device is restarted; Otherwise the state of storer flag is judged in continuation.
E. if flag is a state one among the step D, carry out the operation of USB virtual drive backward, USB equipment complex driver is installed, and the drive installation program can be revised as USBCCGP from USBSTOR with the service entry of registering in registration table for USB device in the Windows operating system.Carry out the virtual drive operation in this step is the driving that the USB equipment complex is installed in the operation of simulation CD-ROM drive backward, after the installation, USB device restarts, at this moment, the mode that restarts has two kinds, a kind of user of being inserts after pulling out USB device once more, obviously, this mode is not very desirable, two kinds is that the drive installation program is sent out message to USB device and allowed equipment restart, and this reboot operation is exactly transparent to the user, gives host computer owing to only exposed USB virtual drive interface this moment, so the driver of host computer can only send message to USB device by described single interface, annunciator drives and installs.
F. if flag is a state two among the step D, carry out the operation of USB equipment complex backward, carry out the functional performance of various USB equipment complexes.Carry out the drive installation that USB equipment complex operation is meant USB device in this step finishes the back and restarts the functional performance that is afterwards undertaken by the various functional application of artificial realization USB equipment complex backward.
When USB device was inserted host computer, host computer detected USB device, and corresponding to the treatment scheme of above-mentioned USB device, as shown in Figure 2, the treatment scheme of the Windows operating system of host computer comprises step:
A. host computer is the USB device load driver by Windows operating system, when USB device is connected first with host computer because the driver usbccgp.sys of USB equipment complex is not installed, load standard driver usbstor.sys so operating system is USB device, Windows operating system can the appropriate location in registration table be the registration entries that USB device is added service USBSTOR by name simultaneously; Otherwise, as the driver usbccgp.sys that the USB equipment complex is installed, because the Service name USBSTOR of the registration entries in the USB device registration table has been USBCCGP by the drive installation modification of program at this moment, operating system can load USB equipment complex driver usbccgp.sys for USB device.Like this, after USB device was restarted, Windows can be USBSTOR or USBCCGP according to the Service name of registration entries, and deciding loading standard driver usbstor.sys still is USB equipment complex driver usbccgp.sys.
B. that load is standard driver usbstor.sys but not USB equipment complex driver usbccgp.sys if host computer is a USB device, then host computer directly send obtain character string descriptor request to USB device; Otherwise host computer sends the request that configuration is set earlier and arrives USB device, and then transmission is obtained the request of character string descriptor to USB device.
It is as described below that present embodiment judges whether the Windows operating system of host computer has installed the foundation that the USB equipment complex drives: no matter select single interface configuration for use during device start still be many interface configuration, may attempt being two drivers of matched on the host computer:
1. when USB device exposed as single interface configuration to host computer, host computer can think that equipment is a USB virtual drive, is device loads standard driver usbstor.sys then.If USB device is to insert host computer for the first time, Windows operating system also can be added the registration entries of service USBSTOR by name in registration table.
2. when USB device exposed many interface configuration to host computer, host computer can think that equipment is a USB equipment complex, is device loads USB equipment complex driver usbccgp.sys then.When USB device was installed USB equipment complex driver usbccgp.sys first, the drive installation program can be revised as USBCCGP from USBSTOR with service entry in the registration table.
When host computer loads these two drivings, the command sequence that these two drivers are dealt into USB device is different, usbstor.sys at first can send out an order of obtaining character string descriptor to equipment, and usbccgp.sys at first can send out one and the USB configure order is set to equipment, and then send out an order of obtaining character string descriptor to equipment, utilize this point difference, USB device just can judge whether driving installs on main frame.
Describe implementation process of the present invention in conjunction with Fig. 1 and Fig. 2 in detail in conjunction with an embodiment once more below.
Suppose that USB device inserts in the host computer that USB equipment complex driver usbccgp.sys is not installed, USB device is through initialization operation with after flag is set, USB device starts for the first time, this moment, flag was zero, thereby start single interface configuration, the character string descriptor request of obtaining that processing host is sent.Simultaneously, the registration entries that Windows operating system loads standard driver usbstor.sys and add service USBSTOR by name for USB device in registration table, at this moment, sending the request that configuration is set directly sends the request of obtaining character string descriptor to equipment and arrives equipment.After entering next determining step, " last one that obtains the character string descriptor request is configuring request to be set and the storer flag is 0 " this condition owing to do not satisfy this moment, enter again next time and judge, because this moment, the storer flag was 0, thereby carry out the USB virtual drive backward and operate, USB equipment complex driver usbccgp.sys is installed, and meanwhile, the drive installation program is revised as USBCCGP with the Service name of the registration entries in the registration table by USBSTOR.
USB device starts for the second time by artificial or automated manner, and this moment, flag was still zero, thereby started single interface configuration, the character string descriptor request of obtaining that processing host is sent.Simultaneously, because the Service name of the registration entries of USB device in registration table has been revised as by USBSTOR and has been revised as USBCCGP automatically, Windows operating system loads USB equipment complex driver usbccgp.sys, thereby Windows operating system can send character string descriptor is obtained in request that configuration is set then in transmission request earlier.After entering next determining step, " last one that obtains the character string descriptor request is configuring request to be set and the storer flag is 0 " this condition owing to satisfy this moment, thereby USB device is made as non-0 to the storer flag.USB device starts for the third time by artificial or automated manner, and this moment, flag was a non-zero, thereby started many interface configuration, the character string descriptor request of obtaining that processing host is sent.Simultaneously, because the Service name of the registration entries of USB device in registration table is USBCCGP, Windows operating system loads USB equipment complex driver usbccgp.sys, thereby Windows operating system can send character string descriptor is obtained in request that configuration is set then in transmission request earlier.After entering next determining step, " last one that obtains the character string descriptor request is configuring request to be set and the storer flag is 0 " this condition owing to do not satisfy this moment, enter again next time and judge,, thereby carry out the operation of USB equipment complex backward because this moment, the storer flag was 1.
Through above-mentioned manually or automatically restart for three times after, the driver of USB equipment complex is with regard to normal mounting, no matter restart how many times afterwards, Windows operating system all loads USB device USB equipment complex driver usbccgp.sys automatically, carries out the operation of USB equipment complex.
Those of ordinary skill in the art will appreciate that embodiment described here is in order to help reader understanding's principle of the present invention, should to be understood that protection scope of the present invention is not limited to such special statement and embodiment.Those of ordinary skill in the art can make various other various concrete distortion and combinations that do not break away from essence of the present invention according to these technology enlightenments disclosed by the invention, and these distortion and combination are still in protection scope of the present invention.
Claims (1)
1. the recognition methods with the USB device of virtual drive is characterized in that, when USB device was inserted host computer, the treatment scheme of USB device comprised step:
A.USB equipment carries out various initialization operations;
B., flag is set, a flag is set in the storer of USB device, and make this flag have two states, the driving of state one expression USB device is not installed, the driving of state two expression USB device is installed, and when USB device was connected with host computer and starts first, the flag of USB device was initialized as state one, and make this flag after start-up course in can not be initialised again, and its address space can not taken by other program yet;
The C.USB device start is also judged the state of storer flag, when flag be state for the moment, start single interface configuration, USB device exposes as the USB virtual drive.When flag is state two, start many interface configuration, USB device exposes as the USB equipment complex;
The character string descriptor request of obtaining that D.USB device processes host computer is sent, and judge whether a last request is the request that configuration is set, if and the flag in the storer is state one, then the flag of storer is made as state two and USB device is restarted; Otherwise the state of storer flag is judged in continuation;
E. if flag is a state one among the step D, carry out the operation of USB virtual drive backward, USB equipment complex driver is installed, and the drive installation program can be revised as USBCCGP from USBSTOR with the service entry of registering in registration table for USB device in the Windows operating system;
F. if flag is a state two among the step D, carry out the operation of USB equipment complex backward, carry out the functional performance of various USB equipment complexes.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201010162529.5A CN101853142B (en) | 2010-05-05 | 2010-05-05 | Identification method of USB device with virtual drive |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201010162529.5A CN101853142B (en) | 2010-05-05 | 2010-05-05 | Identification method of USB device with virtual drive |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101853142A true CN101853142A (en) | 2010-10-06 |
CN101853142B CN101853142B (en) | 2014-06-04 |
Family
ID=42804655
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201010162529.5A Expired - Fee Related CN101853142B (en) | 2010-05-05 | 2010-05-05 | Identification method of USB device with virtual drive |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN101853142B (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102375786A (en) * | 2011-10-18 | 2012-03-14 | 中兴通讯股份有限公司 | Automatic operating system identifying method and system for USB (Universal Serial Bus) equipment |
CN102622313A (en) * | 2011-01-30 | 2012-08-01 | 中兴通讯股份有限公司 | Method and system for switching ports of USB (universal serial bus) equipment and method for differentiating operating system |
CN102902518A (en) * | 2012-08-17 | 2013-01-30 | 中兴通讯股份有限公司 | Active USB (Universal Serial Bus) equipment and operating mode switching method thereof |
CN105094880A (en) * | 2014-05-23 | 2015-11-25 | 中兴通讯股份有限公司 | USB driving method, computer and compound equipment |
US11792085B2 (en) | 2011-09-14 | 2023-10-17 | Barco N.V. | Electronic tool and methods for meetings |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101620538A (en) * | 2008-07-01 | 2010-01-06 | 希姆通信息技术(上海)有限公司 | Method for automatically operating CDROM function on USB network card equipment |
CN101650694A (en) * | 2009-08-21 | 2010-02-17 | 深圳华为通信技术有限公司 | USB device, computer and method for achieving virtual device allocation of USB device |
CN101694641A (en) * | 2009-09-28 | 2010-04-14 | 北京深思洛克软件技术股份有限公司 | Method and system for initializing universal serial bus (USB) devices |
-
2010
- 2010-05-05 CN CN201010162529.5A patent/CN101853142B/en not_active Expired - Fee Related
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101620538A (en) * | 2008-07-01 | 2010-01-06 | 希姆通信息技术(上海)有限公司 | Method for automatically operating CDROM function on USB network card equipment |
CN101650694A (en) * | 2009-08-21 | 2010-02-17 | 深圳华为通信技术有限公司 | USB device, computer and method for achieving virtual device allocation of USB device |
CN101694641A (en) * | 2009-09-28 | 2010-04-14 | 北京深思洛克软件技术股份有限公司 | Method and system for initializing universal serial bus (USB) devices |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102622313A (en) * | 2011-01-30 | 2012-08-01 | 中兴通讯股份有限公司 | Method and system for switching ports of USB (universal serial bus) equipment and method for differentiating operating system |
CN102622313B (en) * | 2011-01-30 | 2015-08-12 | 中兴通讯股份有限公司 | The method of the port switching method of USB device, system and differentiation operating system |
US11792085B2 (en) | 2011-09-14 | 2023-10-17 | Barco N.V. | Electronic tool and methods for meetings |
CN102375786A (en) * | 2011-10-18 | 2012-03-14 | 中兴通讯股份有限公司 | Automatic operating system identifying method and system for USB (Universal Serial Bus) equipment |
WO2012155573A1 (en) * | 2011-10-18 | 2012-11-22 | 中兴通讯股份有限公司 | Method and system enabling usb device to automatically recognize operating system |
CN102375786B (en) * | 2011-10-18 | 2014-09-10 | 中兴通讯股份有限公司 | Automatic operating system identifying method and system for USB (Universal Serial Bus) equipment |
CN102902518A (en) * | 2012-08-17 | 2013-01-30 | 中兴通讯股份有限公司 | Active USB (Universal Serial Bus) equipment and operating mode switching method thereof |
US10042800B2 (en) | 2012-08-17 | 2018-08-07 | Zte Corporation | Active USB device and switching method for operating mode thereof |
CN105094880A (en) * | 2014-05-23 | 2015-11-25 | 中兴通讯股份有限公司 | USB driving method, computer and compound equipment |
WO2015176366A1 (en) * | 2014-05-23 | 2015-11-26 | 中兴通讯股份有限公司 | Universal serial bus drive method, computer and composite device |
Also Published As
Publication number | Publication date |
---|---|
CN101853142B (en) | 2014-06-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8028155B1 (en) | Initiating an operating system boot from firmware | |
EP2704041B1 (en) | Method for storing application data and terminal device | |
CN100365576C (en) | Memory mirror starting optimization of built-in operation system | |
CN101609408B (en) | A kind of method and system realizing self-start of terminal equipment | |
CN104679540A (en) | Computer system and computer system starting method | |
CN101853142B (en) | Identification method of USB device with virtual drive | |
CN112486522A (en) | Deployment method and device of OpenStack bare machine with intelligent network card | |
CN106484719B (en) | Method and terminal for expanding mobile phone storage | |
CN103593281A (en) | Test system and test method | |
CN112699071B (en) | USB port binding structure and method based on Linux system | |
CN102073524B (en) | A kind of method of wireless communication terminal and self-starting thereof | |
CN109426527B (en) | Computer system and method for sharing Bluetooth data between UEFI firmware and operating system | |
CN109375874B (en) | Method, device and equipment for calling distributed storage | |
CN104407890A (en) | Method for starting Android system from OTG (On-The-Go) equipment | |
CN113849272A (en) | Method and device for adding GPU (graphics processing Unit) resources in virtual machine | |
CN116737244A (en) | Method and device for starting multiple hardware domains of chip | |
US9465597B2 (en) | System for operating a device as a storage device and a modem device | |
US10616944B2 (en) | Computer system and method thereof for sharing of wireless connection information between UEFI firmware and OS | |
CN108234174B (en) | Management method and device of virtual network function | |
CN102929662A (en) | Network-based method for partitioning in batch | |
CN103440334A (en) | Driver matching method and device of mobile terminal | |
EP2835737A1 (en) | Data terminal running mode switching method, device, and data terminal | |
CN102591691B (en) | Hard disk startup method and the os starting loading method based on BIOS | |
WO2014102301A1 (en) | Method to provide connectivity capabilities to a computing device | |
CN102436386A (en) | Software upgrading method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20140604 Termination date: 20170505 |
|
CF01 | Termination of patent right due to non-payment of annual fee |