How can I speed up the first-time loading of a Windows device driver for an USB device? - windows-xp

We have some boxes running Windows XP for an automated production process. I (not me personally but a robot) connect new USB devices to these boxes. There is a device driver for this device type and it's loaded after connecting a device and running like a charm.
But ... it takes about 8 to 10 seconds after pluging in a new device until it is accessible. When I connect an already previously seen device again it only takes 3 seconds. The driver has a catalog file. It's not signed by Microsoft WHQL but uses a test certificate we have installed on the machines.
There is only one inf/pnf file to be considered and so I wonder why it takes so long to detect a new device, create the information in the registry and load the driver.
Time is money and so I need to speed up the process.
Any hints for me? Especially does somebody know that WHQL-certified drivers are recognized more quickly by Windows / device manager?

These devices have unique serial numbers, correct? That's part of what Windows uses to create the per-instance data necessary to track whether it's seen this device before. In the case where you plug in a device that's already seen before, Windows will pick up the old instance data and load the appropriate driver. If you plug in a device that Windows has never seen before (e.g. same VID/PID but different serial number), it needs to go through the process of creating registry entries, parsing the INFs to find the correct driver, etc.
Are you sure those devices that show up quickly with WHQL'd drivers have never been attached to the system before? Also, are these systems configured to connect to Windows Update to look for drivers when a new device is attached? It's definitely true that Windows will prefer a WHQL'd driver over an unsigned (or self signed) package, so it's possible that Windows is trying hard to find something else before defaulting to your self signed driver.
-scott

Related

Solution to remote power cycle embedded devices

I am looking for a solution to remotely power cycle embedded devices that are connected via a USB hub to a server. I have a software solution (usbreset.c) that was posted in several responses in stack overflow - rebooting the usb port. This works if the device is still alive, can be detected by the server, but, it just fails to communicate with the server. I have had to use it a few times. however, sometimes the device could hang or freeze on a gui page and there is no serial communication. This requires physically power cycling the device using it's on-off switch. Someone suggested raspberry-pi solution. But as per that solution, I would need one raspberry-pi per device. It's as if using a raspberry-pi to serve as a relay. This is expensive and cannot scale. Could relays work in this situation i.e. the power pins of each device connect to a relay. So, one relay per device. There are remote IP power cycle solutions. so via a web interface it is possible to check which device is offline and power cycle just that one. Such solutions are common in IT. However, is such a solution viable to remote power cycle embedded devices connected at the other end?

How to know which functions available in a driver?

A device driver is a component that Windows uses to interact with a hardware device, such as a modem or network adapter. Rather than access the device directly, Windows loads device drivers and calls functions in the drivers to carry out actions on the device but how windows know which functions are available and how to call them?
As far as the first part of your question, on a modern system that supports ACPI (also see OSDev Wiki's page) Windows (or any other OS worth its salt) uses that to detect devices via the tables that are loaded by the BIOS (e.g. the DSDT).

Is there any method to log into blackberry 10 through usb cable

Now I face a tricky problem. My Blackberry Classics has a black screen problem. When I connect it to my laptop with USB cable, Blackberry Link can detect it. However when it tried to connect to it, the Blackberry Blend prompted me to set the Allow Connections switch to on on the device. Obviously, I could not do that. I am thinking maybe there is a method to let me connect to the Blackberry 10 through the USB port just like a console port, but I am not sure. Does anyone know about it? Thanks in advance.
Momenitcs does provide a few ways to connect with a device. But generally the device has to be in development mode, which requires interacting with the device which you apparently can't do. The access is also limited to the development user so you could not use it to, for example, access data from installed applications.
About the only thing you can do at this point is use link to backup your data and restore to that phone once repaired, or to a new phone.
Also, since this question is not really suitable for StackOverflow I'm going to flag it for closing. Questions like this properly belong on SuperUser http://meta.superuser.com/questions/4836/what-is-the-difference-between-super-user-and-stack-overflow/4838

At boot time how OS determines all the hardware?

I have these related questions:
Does anybody know how an OS gets to know all hardware connected on the motherboard? (I guess this is called "Hardware Enumeration").
How does it determine what kind of hardware is residing at an specific IO address (i.e.: serial or parallel or whatever controller)?
How to code a system module which will do this job? (Assuming no OS loaded yet, just BIOS).
I know BIOS is just a validation and an user friendly interface to configure hardware at boot time with no real use after that for most modern OS's (win, Linux, etc). Besides I know that for the BIOS it should not be difficult to find all hardware because it is specifically tuned by the board manufacturer (who knows everything about it!). But for an OS or an application above BIOS that is a complete different story. Right?
Pre-PCI this was much more difficult, you needed a trick for each product, and even with that it was difficult to figure everything out. With usb and pci you can scan the busses to find a vendor and product id, from that you go into a product specific discovery (like the old days this can be difficult). Sometimes the details for that board are protected by NDA or worse you just dont get to know unless you work there on the right team.
The general approach is either based on detection (usb, pcie, etc vendor/product ids) you load a driver or write a driver for that family of product based on the documentation for that family of product. Since you mentioned BIOS, win, linux that implies X86 or a PC, and that pretty much covers the autodetectable. Beyond that you rely on the user who knows what hardware was installed in the system and a driver that came with it. or in some way you ask them what is installed (the specific printer at the end of a cable or out on the network if not auto detectable is an easy to understand example).
In short you take decades of experience in trying to succeed at this and apply it, and still fail from time to time since you are not in 100% control of all the hardware in the system, there are hundreds of vendors out there each doing their own thing.
BIOS enumerates the pci(e) for an x86 pc, for other platforms the OS might do it. The enumeration includes allocating address space for the device based on pci compliant rules. but within that address space you have to know how to program that specific board from vendor documentation if available.
Sorry my English is not very good.
Responding questions 1 and 2:
During the boot process, only the hardware modules strictly necessary to find and start the OS are loaded.
These hardware modules are: motherboard, hard drive, RAM, graphics card, keyboard, mouse, screen (that is detected by the graphics card), network card, CD / DVD, and a few extra peripherals such as USB units.
Each hardware module you connect to a computer has a controller that is like a small BIOS with all the information of the stored device: manufacturer, device type, protocols, etc
The detection process is very simple: the BIOS has hardcoded all the information about the motherboard, with all communication ports. At startup, the BIOS sends a signal to all system ports asking the questions "Who are you? What are you? How do you function?" and all attached devices answers by sending their information. In this way the computer knows how much RAM you have, if there is present a keyboard or a mouse, which storage devices are available, screen resolution, etc ...
Obviously, this process only works with the basic modules needed to boot the system, and does not work with complex peripherals that require specific drivers: printers, scanners, webcams ... all these complex peripherals are loaded by software once the OS has been charged.
Responding question 3:
If you wants to load a specific module during the boot, you must:
- Create a controller for this module.
- If the peripheral is too complex to load everything from the controller, you must to write all the proccess to control that module directly in the BIOS module, or reprogram the IPL to manage that specific module.
I hope I've helped
Actually, when you turn on your system, the BIOS starts the IPL (Initial program load) from ROM. For check the all connected devices are working good and also check the mandatory devices such as keyboard, CMOS, Hard disk and so on. If it is not success, it gives an error flag to the BIOS. The BIOS shows us the error through video devices.
If it is success, the control of boot is transferred to BIOS for further process.
The above all process are called POST (Power On Self Test).
Now the BIOS have the control. It checks all secondary memory devices for boot loader of the OS. If it hit, the bootloader's memory address is transferred to RAM.
The Ram started to execute the bootloader. Here only the os starts to run.
If the bootloader not hit, the bios shows us the boot failure error.
I hope your doubt clarified...

Exchange data between iOS app and Mac app through USB cable

I'm looking for a way to exchange data between my own iOS app and my own OS X application through a cable.
I know there have to be frameworks to connect to the device from inside a Mac application, apps like iExplore can import and export files from the device.
It doesn't matter in which way the data is exchanged as long as it's through a cable. It may use the filesystem, or if I can get the device on the same network as the Mac through a connection or even use 3rd party hardware.
It doesn't matter if it uses private APIs or if the device needs a jailbreak, it is for internal use only.
Thanks in advance.
IMPORTANT: the solution can't feature anything wireless, no wifi, no bluetooth, no cellular tethering, the data exchange should work even with the device in airplane mode. This is the main requirement.
And it has to be relatively fast. I want to exchange small packages less than 1 kB once every few seconds. The delay between send and receive should be as little as possible, 1 second is the longest acceptable delay.
Take a look at https://bitbucket.org/tristero/ipodaccessframework which can get/put files into an applications private document directory, provided you know its application bundle id.