none
Field upgrade of kernel mode driver without NK.bin RRS feed

  • Question

  • I am developing a kernel mode driver that I would like to be able to upgrade without updating the entire NK.bin. Is it possible to have a dll run in kernel mode but not built into the nk.bin? 

    My understanding right now is the only way to get the driver to run in kernel mode is to add it to a .bib file so romimage knows to fix up the addresses and place it in the NK.bin. Is there another way?

    Wednesday, February 26, 2014 5:48 PM

Answers

  • Bill:

    Bradley and Misbah answered how to do it, but did not answer your specific question which I understand to be "can a kernel mode driver be updated outside of an nk.bin?"

    Yes, Kernel Mode drivers can be updated without updating the OS.  Kernel Mode drivers do not have to be fixed up unless they are included in the OS in the MODULES section of the bib file.

    There are some challenges to updating a driver outside of the OS.  What those challenges are and how to solve them will depend on your OS and the features that are included.


    Bruce Eitman (eMVP) Senior Engineer Bruce.Eitman AT Eurotech DOT com My BLOG http://geekswithblogs.net/bruceeitman Eurotech Inc. www.Eurotech.com

    • Marked as answer by Bill at Brady Thursday, February 27, 2014 3:59 PM
    Thursday, February 27, 2014 1:46 PM
    Moderator

All replies

  • I don't have experience with Windows Embedded CE 6.0 or newer doing exactly what you are doing but I know that you can do the following:

    1. Load user mode drivers outside of NK.bin via ActivateDevice
    2. Unload user mode drivers loaded by system and in NK.bin via DeactivateDevice
    3. Unload kernel mode drivers loaded by system and in NK.bin via DeactivateDevice
    4. Unload user mode driver loaded outside of NK.bin via DeactivateDevice

    I also believe that there is a configuration option in Windows Embedded CE 6.0 where you can restrict which drivers and applications are allowed to load on the device.  If you have problems loading the driver this is something that you can check.

    Have you tried to load your kernel driver via ActivateDevice?  If not (and if you don't have a driver yet to load) just create a stubbed out driver and attempt to load it to see if it does.


    Wednesday, February 26, 2014 9:50 PM
  • Check the Answer at the below post, This is what you have to do for your specific driver. You can copy your driver into some removable media and dynamically load and unload using ActivateDevice and DeactivateDevice using an application:

    http://social.msdn.microsoft.com/Forums/en-US/fbe7502c-1d7b-4c81-99e7-13c14936291e/how-to-load-a-driver-dll-without-registering-it-in-builtin-driver-registry?forum=winembplatdev#49a0406b-9782-4897-b8d1-7041632a86fd


    --- Misbah


    Senior Design Engineer T.E.S Electroni Solutions (Bangalore-India) www.tes-dst.com email-misbah.khan@tes-dst.com

    Thursday, February 27, 2014 11:28 AM
  • In addition, there is also a possibility to create an automatic installer. See http://msdn.microsoft.com/en-us/library/ee504656(v=winembedded.60).aspx

    Ian Bakshan
    Sr. Software Engineer Jungo Connectivity LTD.
    WinDriver – Driver Development Tool
    DriverCore – PC USB Drivers

    Thursday, February 27, 2014 1:45 PM
  • Bill:

    Bradley and Misbah answered how to do it, but did not answer your specific question which I understand to be "can a kernel mode driver be updated outside of an nk.bin?"

    Yes, Kernel Mode drivers can be updated without updating the OS.  Kernel Mode drivers do not have to be fixed up unless they are included in the OS in the MODULES section of the bib file.

    There are some challenges to updating a driver outside of the OS.  What those challenges are and how to solve them will depend on your OS and the features that are included.


    Bruce Eitman (eMVP) Senior Engineer Bruce.Eitman AT Eurotech DOT com My BLOG http://geekswithblogs.net/bruceeitman Eurotech Inc. www.Eurotech.com

    • Marked as answer by Bill at Brady Thursday, February 27, 2014 3:59 PM
    Thursday, February 27, 2014 1:46 PM
    Moderator
  • Thanks, Bruce. If I understand what you're saying, as long as my kernel driver bib entry is in the FILES section I can update it independently (with all the caveats of what that means for the OS).

    Somewhat related: Does this mean it would also be possible to load a kernel mode driver from my _FLATRELEASEDIR? Similar to what you outlined in your blog post here: http://geekswithblogs.net/BruceEitman/archive/2010/08/17/platform-builder-write-debug-fix-debug.aspx

    Thursday, February 27, 2014 3:59 PM
  • Bill:

    Whoa.  You lost me there.

    Is this entire thread about debugging?  If so, then that article tells you what you need to know.

    I had assumed, and possibly incorrectly, that you wanted to update it in the field since you didn't discuss debugging. 


    Bruce Eitman (eMVP) Senior Engineer Bruce.Eitman AT Eurotech DOT com My BLOG http://geekswithblogs.net/bruceeitman Eurotech Inc. www.Eurotech.com

    Thursday, February 27, 2014 5:10 PM
    Moderator
  • No, I took a bit of a left turn there - the information regarding only things in the MODULES section needing to be fixed up was what I was looking for. I just thought this same concept could be applied to debugging as well.
    Thursday, February 27, 2014 5:39 PM
  • Thanks, Bruce. If I understand what you're saying, as long as my kernel driver bib entry is in the FILES section I can update it independently (with all the caveats of what that means for the OS).

    Bruce was specifically mentioning about the driver being fixed up to kernel / user space.  If you have a file in the MODULES section you need to specify if it is loadable in user space, kernel space or both (No Flag, K Flag, Q Flag.)

    Do not put your driver in the FILES section, you should still be able to unload it / load it if it is in the MODULES section.

    Thursday, February 27, 2014 6:49 PM
  • Somewhat related: Does this mean it would also be possible to load a kernel mode driver from my _FLATRELEASEDIR? Similar to what you outlined in your blog post here: http://geekswithblogs.net/BruceEitman/archive/2010/08/17/platform-builder-write-debug-fix-debug.aspx

    If you don't have the driver in your .bib and it is built by your system it should still get loaded from your _FLATRELEASEDIR if you are using KITL during your development.  This can be very handy as it can significantly reduce the time required to test your changes.  This works for more than just drivers as well.
    Thursday, February 27, 2014 6:50 PM
  • Well, it does, but it is much uglier.  Much better to leave the driver out while debugging, that allows it to use your release directory.

    Bruce Eitman (eMVP) Senior Engineer Bruce.Eitman AT Eurotech DOT com My BLOG http://geekswithblogs.net/bruceeitman Eurotech Inc. www.Eurotech.com

    Thursday, February 27, 2014 10:10 PM
    Moderator