We have a system with two partitions, the NK.bin and an internal
filesystem on the same NOR flash device. We have the need to load USB
drivers from the internal filesystem. The reason being, our NK.bin is
not upgradable but the filesystem is. So we have some ideas:

* We use the Loader/SystemPath registry variable to point to the
filesystem. This doesn't seem to work even though we put this entry in
the boot registry.

* We copy the USB driver files to the \WINDOWS directory after boot.
The problem here is that we have a race condition between the copy and
the USB driver loading.

* Let the USB driver fail loading the first time, then retry after we
boot up and copy driver files to \windows (is there a function to
reload a driver?)

Has anyone else had a similar problem? Thanks!

Re: Loading USB driver @ boot by Michel

Michel
Mon May 19 16:30:38 PDT 2008

The right way to do this is to mount the USB drive as root so that any
file on the USB drive will override any file in ROM:

Inside NK.BIN: usbdriver.dll (version 1.0)
On USB drive : usbdriver.dll (version 2.0)

Now if you mount the USB drive as root usbdriver.dll version 2.0 will be
used.

Inside NK.BIN: usbdriver.dll (version 1.0)
On USB drive :

In this case the system will just use version 1.0.

Of course you have to put all necessary USB driver registry settings
between ; HIVE BOOT SECTION tags to load everything at first boot. Then
set "MountAsRoot" in the USB drive profile and voila!

Of course loading a USB drive will increase your boot time with quite a
bit (the system won't continue booting until the USB drive is completely
loaded and mounted).

It's probably faster to use a part of the internal NOR flash as a
partition with a filesystem that can be mounted as root. Then you can
just "upgrade" the driver by copying usbdriver.dll v2 to the internal
NOR partition and on next boot the system will use the new version
instead of the one in the NK.BIN.



Good luck,

Michel Verhagen, eMVP
Check out my blog: http://GuruCE.com/blog

GuruCE Ltd.
Microsoft Embedded Partner
http://GuruCE.com
Consultancy, training and development services.

Steve Hugg wrote:
> We have a system with two partitions, the NK.bin and an internal
> filesystem on the same NOR flash device. We have the need to load USB
> drivers from the internal filesystem. The reason being, our NK.bin is
> not upgradable but the filesystem is. So we have some ideas:
>
> * We use the Loader/SystemPath registry variable to point to the
> filesystem. This doesn't seem to work even though we put this entry in
> the boot registry.
>
> * We copy the USB driver files to the \WINDOWS directory after boot.
> The problem here is that we have a race condition between the copy and
> the USB driver loading.
>
> * Let the USB driver fail loading the first time, then retry after we
> boot up and copy driver files to \windows (is there a function to
> reload a driver?)
>
> Has anyone else had a similar problem? Thanks!

Re: Loading USB driver @ boot by Bruce

Bruce
Mon May 19 18:30:41 PDT 2008

If I follow this correctly, changing the nk.bin isn't possible. So you
could use the HIVE registry, that I hope you have. change the name of the
new version of the driver and change it in the registry, now it should work
with your system path change pointing to your NOR flash.

--
Bruce Eitman (eMVP)
Senior Engineer
Bruce.Eitman AT EuroTech DOT com
My BLOG http://geekswithblogs.net/bruceeitman

EuroTech Inc.
www.EuroTech.com

"Michel Verhagen (eMVP)" <michel@nospam.box> wrote in message
news:uNJighguIHA.6096@TK2MSFTNGP06.phx.gbl...
> The right way to do this is to mount the USB drive as root so that any
> file on the USB drive will override any file in ROM:
>
> Inside NK.BIN: usbdriver.dll (version 1.0)
> On USB drive : usbdriver.dll (version 2.0)
>
> Now if you mount the USB drive as root usbdriver.dll version 2.0 will be
> used.
>
> Inside NK.BIN: usbdriver.dll (version 1.0)
> On USB drive :
>
> In this case the system will just use version 1.0.
>
> Of course you have to put all necessary USB driver registry settings
> between ; HIVE BOOT SECTION tags to load everything at first boot. Then
> set "MountAsRoot" in the USB drive profile and voila!
>
> Of course loading a USB drive will increase your boot time with quite a
> bit (the system won't continue booting until the USB drive is completely
> loaded and mounted).
>
> It's probably faster to use a part of the internal NOR flash as a
> partition with a filesystem that can be mounted as root. Then you can just
> "upgrade" the driver by copying usbdriver.dll v2 to the internal NOR
> partition and on next boot the system will use the new version instead of
> the one in the NK.BIN.
>
>
>
> Good luck,
>
> Michel Verhagen, eMVP
> Check out my blog: http://GuruCE.com/blog
>
> GuruCE Ltd.
> Microsoft Embedded Partner
> http://GuruCE.com
> Consultancy, training and development services.
>
> Steve Hugg wrote:
>> We have a system with two partitions, the NK.bin and an internal
>> filesystem on the same NOR flash device. We have the need to load USB
>> drivers from the internal filesystem. The reason being, our NK.bin is
>> not upgradable but the filesystem is. So we have some ideas:
>>
>> * We use the Loader/SystemPath registry variable to point to the
>> filesystem. This doesn't seem to work even though we put this entry in
>> the boot registry.
>>
>> * We copy the USB driver files to the \WINDOWS directory after boot.
>> The problem here is that we have a race condition between the copy and
>> the USB driver loading.
>>
>> * Let the USB driver fail loading the first time, then retry after we
>> boot up and copy driver files to \windows (is there a function to
>> reload a driver?)
>>
>> Has anyone else had a similar problem? Thanks!



Re: Loading USB driver @ boot by Michel

Michel
Mon May 19 19:31:32 PDT 2008

The way I read it they can change NK, just not later upgrade it. He can
change the boot hive (which you can only do if you create the NK). Once
he ships the device he can't update NK anymore. At least, that's how I
understand it...

Another way is just to unload the entire USB stack, then set the
registry to point to the dll on the USB drive (when it is already
mounted) and then reload the stack.

Code that shows you how to reload the stack is in one of my previous
posts, here:
http://groups.google.co.nz/group/microsoft.public.windowsce.platbuilder/browse_thread/thread/d9bf179790e115f8/0f164c0eaf67ab1c?hl=en&lnk=st&q=usb+unload+group%3A*windowsce*+author%3Amichel+author%3Averhagen#0f164c0eaf67ab1c


Good luck,

Michel Verhagen, eMVP
Check out my blog: http://GuruCE.com/blog

GuruCE Ltd.
Microsoft Embedded Partner
http://GuruCE.com
Consultancy, training and development services.

Bruce Eitman [eMVP] wrote:
> If I follow this correctly, changing the nk.bin isn't possible. So you
> could use the HIVE registry, that I hope you have. change the name of the
> new version of the driver and change it in the registry, now it should work
> with your system path change pointing to your NOR flash.
>

Re: Loading USB driver @ boot by Michel

Michel
Mon May 19 19:36:42 PDT 2008

Which leads to a chicken and egg problem and me waking up... Discard
that last post please.

Good luck,

Michel Verhagen, eMVP
Check out my blog: http://GuruCE.com/blog

GuruCE Ltd.
Microsoft Embedded Partner
http://GuruCE.com
Consultancy, training and development services.

Michel Verhagen (eMVP) wrote:
> The way I read it they can change NK, just not later upgrade it. He can
> change the boot hive (which you can only do if you create the NK). Once
> he ships the device he can't update NK anymore. At least, that's how I
> understand it...
>
> Another way is just to unload the entire USB stack, then set the
> registry to point to the dll on the USB drive (when it is already
> mounted) and then reload the stack.
>
> Code that shows you how to reload the stack is in one of my previous
> posts, here:
> http://groups.google.co.nz/group/microsoft.public.windowsce.platbuilder/browse_thread/thread/d9bf179790e115f8/0f164c0eaf67ab1c?hl=en&lnk=st&q=usb+unload+group%3A*windowsce*+author%3Amichel+author%3Averhagen#0f164c0eaf67ab1c
>
>
>
> Good luck,
>
> Michel Verhagen, eMVP
> Check out my blog: http://GuruCE.com/blog
>
> GuruCE Ltd.
> Microsoft Embedded Partner
> http://GuruCE.com
> Consultancy, training and development services.
>
> Bruce Eitman [eMVP] wrote:
>> If I follow this correctly, changing the nk.bin isn't possible. So
>> you could use the HIVE registry, that I hope you have. change the
>> name of the new version of the driver and change it in the registry,
>> now it should work with your system path change pointing to your NOR
>> flash.
>>

Re: Loading USB driver @ boot by Bruce

Bruce
Tue May 20 06:00:20 PDT 2008

:-)

--
Bruce Eitman (eMVP)
Senior Engineer
Bruce.Eitman AT EuroTech DOT com
My BLOG http://geekswithblogs.net/bruceeitman

EuroTech Inc.
www.EuroTech.com

"Michel Verhagen (eMVP)" <michel@nospam.box> wrote in message
news:%23sD2gJiuIHA.4476@TK2MSFTNGP06.phx.gbl...
> Which leads to a chicken and egg problem and me waking up... Discard that
> last post please.
>
> Good luck,
>
> Michel Verhagen, eMVP
> Check out my blog: http://GuruCE.com/blog
>
> GuruCE Ltd.
> Microsoft Embedded Partner
> http://GuruCE.com
> Consultancy, training and development services.
>
> Michel Verhagen (eMVP) wrote:
>> The way I read it they can change NK, just not later upgrade it. He can
>> change the boot hive (which you can only do if you create the NK). Once
>> he ships the device he can't update NK anymore. At least, that's how I
>> understand it...
>>
>> Another way is just to unload the entire USB stack, then set the registry
>> to point to the dll on the USB drive (when it is already mounted) and
>> then reload the stack.
>>
>> Code that shows you how to reload the stack is in one of my previous
>> posts, here:
>> http://groups.google.co.nz/group/microsoft.public.windowsce.platbuilder/browse_thread/thread/d9bf179790e115f8/0f164c0eaf67ab1c?hl=en&lnk=st&q=usb+unload+group%3A*windowsce*+author%3Amichel+author%3Averhagen#0f164c0eaf67ab1c
>> Good luck,
>>
>> Michel Verhagen, eMVP
>> Check out my blog: http://GuruCE.com/blog
>>
>> GuruCE Ltd.
>> Microsoft Embedded Partner
>> http://GuruCE.com
>> Consultancy, training and development services.
>>
>> Bruce Eitman [eMVP] wrote:
>>> If I follow this correctly, changing the nk.bin isn't possible. So you
>>> could use the HIVE registry, that I hope you have. change the name of
>>> the new version of the driver and change it in the registry, now it
>>> should work with your system path change pointing to your NOR flash.
>>>



Re: Loading USB driver @ boot by Steve

Steve
Tue May 20 09:30:51 PDT 2008

Hey guys -- our filesystem is on internal NOR flash (not USB) so the
unload/reload suggestion should work. We can't easily remount root, so
this may be our best option.

Thanks!

On May 19, 10:36 pm, "Michel Verhagen (eMVP)" <mic...@nospam.box>
wrote:
> Which leads to a chicken and egg problem and me waking up... Discard
> that last post please.
>
> Good luck,
>
> Michel Verhagen, eMVP
> Check out my blog:http://GuruCE.com/blog
>
> GuruCE Ltd.
> Microsoft Embedded Partner
> http://GuruCE.com
> Consultancy, training and development services.
>
> Michel Verhagen (eMVP) wrote:
> > The way I read it they can change NK, just not later upgrade it. He can
> > change the boot hive (which you can only do if you create the NK). Once
> > he ships the device he can't update NK anymore. At least, that's how I
> > understand it...
>
> > Another way is just to unload the entire USB stack, then set the
> > registry to point to the dll on the USB drive (when it is already
> > mounted) and then reload the stack.
>
> > Code that shows you how to reload the stack is in one of my previous
> > posts, here:
> >http://groups.google.co.nz/group/microsoft.public.windowsce.platbuild...
>
> > Good luck,
>
> > Michel Verhagen, eMVP
> > Check out my blog:http://GuruCE.com/blog
>
> > GuruCE Ltd.
> > Microsoft Embedded Partner
> > http://GuruCE.com
> > Consultancy, training and development services.
>
> > Bruce Eitman [eMVP] wrote:
> >> If I follow this correctly, changing the nk.bin isn't possible. So
> >> you could use the HIVE registry, that I hope you have. change the
> >> name of the new version of the driver and change it in the registry,
> >> now it should work with your system path change pointing to your NOR
> >> flash.