Answered Kernel debugging and successive driver recompilations

  • Thursday, January 27, 2011 4:50 PM
     
     

    Hello,

    I am new in writing device drivers, and now I am trying to use kernel debugging with the old Sample BDA driver and my own customizations of it.

    For that kernel debugging, I use WinDbg and a virtual machine (Windows XP SP3) inside VMWare Workstation , and a virtual serial port. And of course a user mode application (a DirectShow TV program).

    As debugging can involves many changes of the drivers, thus many recompilations, I now hardly copy the new version of the driver (that was at first regularly installed using .inf files) each time, directly into C:\Windows\system32\drivers\ .

    My problem is that Windows XP (inside VMWare) doesn't seem to take in account the new driver if the previous one has already been loaded since booting, unless I completely reboot the virtual machine: despite the replacement, it continues to use the previous one, letting me thinking that this driver stays loaded in memory and reused each time the user mode application that needs it is launched.

    Maybe I missed something in the documentation, but I would like to know if there is a mean to force the reloading of each new freshly compiled driver version in memory without having to reboot the virtual computer?

    Is there a better way for upgrading the tested driver from one version to another (at a rate of several versions per hour) than just hardly overwriting one version with another?

    Gingko

     

All Replies

  • Thursday, January 27, 2011 4:59 PM
     
     Answered
    Use .kdfiles to tell WinDbg to load the driver from your development directory. You will have to Stop/Start the driver using a net command (net start <service>) a PowerShell start-service/stop-service, or enable/disable in Device Manager. You can also use SC, depending upon the type of driver. However, if anything else is using the driver, you will still have to reboot.
    Gary G. Little NanoTelesis Systems, LLC
  • Thursday, January 27, 2011 10:16 PM
     
     

    Thank you very much for the .kdfiles suggestion, It works.

    But it is more problematic to stop and restart the service as I cannot find what I could write for <service> behind "net stop/start " or "sc stop/start ". Neither writing the display name of my driver nor writing its filename, with or without extension, produces any other effect that returning an error message. Using the Device Manager doesn't help better as there is no "Enable/Disable " line on my driver's contextual menu (nor with any other regular BDA driver, actually) . I also tried to use devcon without success.

    This may actually be a relatively small problem as when using .kdfiles (possibly because of it) , it seems that my driver actually reloads by itself, but only if the BDA user mode program needing the driver has been stopped for some time (around 2 or 3 minutes, I'm not sure exactly) . I don't understand exactly the reason of this delay.

    My driver is a BDA / avstream (mini)driver , actually it is the BDA Sample taken from the DDK for Windows Server 2003 SP1 that I am trying to modify in order to have it issuing real Transport Stream data taken from a .ts file recorded from a real TV broadcaster.

    Gingko

     

  • Thursday, January 27, 2011 11:51 PM
    Owner
     
     

    pnp drivers can be controlled with net start/stop. instead, go to device manager and device the device OR use devcon (cmd line tool) and run devcon disable <...>


    d -- This posting is provided "AS IS" with no warranties, and confers no rights.
  • Friday, January 28, 2011 8:10 AM
     
     

    pnp drivers can be controlled with net start/stop. instead, go to device manager and device the device OR use devcon (cmd line tool) and run devcon disable <...>

    I'm sorry, but as stated in my previous message, none of these methods seems to work :

    […] as I cannot find what I could write for <service> behind "net stop/start " or "sc stop/start ". Neither writing the display name of my driver nor writing its filename, with or without extension, produces any other effect that returning an error message. Using the Device Manager doesn't help better as there is no "Enable/Disable " line on my driver's contextual menu (nor with any other regular BDA driver, actually) . I also tried to use devcon without success. […]

    Maybe I am actually unable to find which parameters to give on the command lines, but the fact this is not possible even with device manager doesn't let my thinking so.

    Gingko

  • Friday, January 28, 2011 6:03 PM
    Owner
     
     
     i mean to say that you can NOT enable/disable a pnp driver with net start/stop.

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.