Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
End Users
Pocket PCActiveSyncMultimediaEBooksWirelessSmartPhones
Developers
Windows MobileSmartPhonesWinCE ProgrammingVB for WinCEVC++ for WinCEPlatform BuilderTest Tools
PocketPC DirectoryFree SoftwareWeb Resources
Related Topics
PalmMobile PhonesMore Topics ...

Pocket PC Forum / Developers / Platform Builder / July 2008

Tip: Looking for answers? Try searching our database.

Mounting external filesystem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Michael--J - 22 Nov 2004 09:05 GMT
Hello,

I'm trying to implement Shadowing of the \Windows directory.

I've managed to persist any changed registry settings to my hard disk so
that they are not lost upon hard resets. Now i'm trying to mount my external
file system (i.e. my Disk On Module) as the root as well as Shadowing the
Windows directory. This would allow me to update applications (i.e. the
associated files) which i built into the OS image without having to re-build
the image all over again.

Below are my registry settings:

[HKEY_LOCAL_MACHINE\init\BootVars]
  "SYSTEMHIVE"="Documents and Settings\\system.hv"
  "PROFILEDIR"="Documents and Settings"
  "Start DevMgr"=dword:1  ; 1 will use HD for persistent registry....
  "RegistryFlags"=dword:1  ; Aggressive registry flushing.

[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\HDProfile]
  "MountFlags"=dword:E ; Ready to accept the hive....
            ; Set this file system as root
            ; To force this root fs to shadow Windows directory

I then copied a file over to my \Windows directory and restarted the device.
I browse to the \Windows folder only to discover the file isn't there -
shadowing did not take place. Are my registry settings correct? The
MountFlags value was obtained by OR'ing 2 (to specify this is where the
registry goes), 4 (to set the FS as the root), and 8 (to enable shadowing of
the windows directory). I then tried to add the following registry settings
but still no luck:

[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\HDProfile\FATFS]
    "MountFlags"=dword:E

I had a look at my common.reg file and it has this:

"MountFlags"=dword:1 ; to make it hidden
"MountFlags"=dword:2 ; to make this have the hive
"MountFlags"=dword:4 ; to mount as root
"MountFlags"=dword:10 ; to mount as external ROM filesystem (to shadow
windows directory)

MSDN seems to have conflicting settings on what implements shadowing, one
says 8 and another says 11. Which is it? I've tried both but they still wont
work!

Can anyone shed any light on this?

Thanks.
"Susan Loh [MS]" - 24 Nov 2004 15:21 GMT
Part of the confusion is that there's more than one way to shadow the
\Windows directory.  One way is to mount an "external ROM" file system.  
For example you might create a small image that runs XIP from RAM, and then
use flash as an additional "ROM" that contains everything that's not in the
image.  The other way to shadow the \Windows directory is to mount your
file system as the root.  In Windows CE 4.x you had to jump through some
hoops to do so; \Windows was either *only* your file system or *only* ROM;
not really a combination of both as the word "shadow" would imply.  In
Windows CE 5.0 there is true shadowing between a Windows directory on your
root and the ROM; the files a user sees are in a combination of the two
places.

So the problem remains to figure out why your settings aren't taking hold.  
It sounds like you're just changing registry settings & rebooting, which is
not going to work.  You also have to switch from the "ROM/RAM file system"
component to the "ROM-only file system" component, and do a rebuild
(sysgen) after that.  You only need to set the "MountFlags" value in the
same spot you've had it already, to get the registry hives stored on your
file system.  MountFlags=6 should be enough for your needs, since you're on
Windows CE 5.0 and shadowing happens already.

Sorry you've had so much trouble figuring this out.  I'll try to suggest
some updates to the documentation that might make the shadowing clearer.

P.S. The "aggressive registry flushing" flag can be a pretty big perf
killer.  You might want to check out our background flush thread instead.

Sue
sloh@microsoft.com     (remove "online" from reply-to address)
http://blogs.msdn.com/sloh/
_____________________________________________________________
This posting is provided "AS IS" with no warranties, and confers no rights.
_____________________________________________________________

Have an opinion on the effectiveness of Microsoft Embedded newsgroups?  Let
us know!
https://www.windowsembeddedeval.com/community/newsgroups
Michael--J - 25 Nov 2004 01:21 GMT
Hi Sue,

Thanks a lot for the reply.

I really didn't know that there were actually 2 ways to implement
shadowing... The one i wish to implement involves mounting my hard disk file
system as the root.

To be honest, i really have no concrete idea as to WHAT shadowing IS. You
can probably judge whether my understanding is accurate: To me, it means that
you have a ROM image which you create using PB. This is the "base" image
which gets loaded. If you add files to the \Windows, \My Documents, or any
other ROM folder, you are adding new files or overriding new files in that
base ROM image. Since the hard disk file system is the root, these "changes"
to the ROM image are "saved" (i.e. shadowed), and will persist after reboots.
Is that correct?

With regards to the my image configurations, it IS a ROM-only filesystem, it
HAS a Hive-based regsitry, and my registry settings looked like this:

[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\HDProfile]
   "MountAsBootable"=dword:1
   "MountAsRoot"=dword:1

The above settings didn't do it for me so I changed it as you suggested to:

[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\HDProfile]
   "MountFlags"=dword:6

I then copied a file to "\Windows" and "\My Documents" and rebooted. It
still didn't work - the file wasn't present in both directories. Is there
something i'm doing fundamentally wrong?

Also, i am using the aggressive registry flushing approach because i dont
change the registry that often. If i use the background flush thread instead,
wont that introduce periodic thread flushing? That would also be a perf issue
wouldn't it?

Thanks.

> Part of the confusion is that there's more than one way to shadow the
> \Windows directory.  One way is to mount an "external ROM" file system.  
[quoted text clipped - 33 lines]
> us know!
> https://www.windowsembeddedeval.com/community/newsgroups
"Susan Loh [MS]" - 30 Nov 2004 16:19 GMT
> To be honest, i really have no concrete idea as to WHAT shadowing IS. You
> can probably judge whether my understanding is accurate: To me, it means that
[quoted text clipped - 4 lines]
> to the ROM image are "saved" (i.e. shadowed), and will persist after reboots.
> Is that correct?

The only ROM folder is \Windows.  All of ROM shows up in one flat list in
\Windows.  No subdirectories of \Windows are ROM.  \My Documents is not
ROM.  (It probably gets set up during boot, by copying files from ROM to
\My Documents.)  Otherwise your understanding of shadowing is correct: you
can drop newer versions of the ROM files into the \Windows directory --
they will be stored on  your persistent file system and they will be the
files that are used instead of the ones in ROM.

> I then copied a file to "\Windows" and "\My Documents" and rebooted. It
> still didn't work - the file wasn't present in both directories. Is there
> something i'm doing fundamentally wrong?

The thing that makes me suspect that you are NOT using the ROM-only file
system is that your files are disappearing.  That sounds like they are NOT
getting stored on your persistent file system.  It sounds like you're using
the RAM file system without realizing it.  What about files in the root
directory, do they persist?  Do files anywhere persist?  Or, do you have a
named directory that your persistent file system might be getting loaded
as, for example \Hard Disk?

To switch from the ROM/RAM file system to the ROM-only file system, you
have to change components in the catalog as well as do a clean rebuild.  
Are you 100% sure you did both?

> Also, i am using the aggressive registry flushing approach because i dont
> change the registry that often. If i use the background flush thread instead,
> wont that introduce periodic thread flushing? That would also be a perf issue
> wouldn't it?

The thread is set up so that it won't wake up unless changes have been
made.  Basically it waits a delay after the changes, then flushes.  But
since the thread basically flushes at an unpredictable (to software) time,
it may not be suitable for your needs.  It's all up to you, and the
aggressive flushing may be more along the lines of what you need.

Sue
sloh@microsoft.com     (remove "online" from reply-to address)
http://blogs.msdn.com/sloh/
_____________________________________________________________
This posting is provided "AS IS" with no warranties, and confers no rights.
_____________________________________________________________

Have an opinion on the effectiveness of Microsoft Embedded newsgroups?  Let
us know!
https://www.windowsembeddedeval.com/community/newsgroups
Michael--J - 30 Nov 2004 23:55 GMT
You were right Sue, i only did one of the two things: i did change the
catalog items but i only did a build and sysgen w/out selecting the "Clean
before building" option. So i selected it this time and it worked. The
"\HardDisk" directory is now gone and files that i put into the "\Windows"
directory stay there. Thanks so much for your help Sue.

Kind Regards,

Michael--J.

> > To be honest, i really have no concrete idea as to WHAT shadowing IS. You
> > can probably judge whether my understanding is accurate: To me, it means
[quoted text clipped - 57 lines]
> us know!
> https://www.windowsembeddedeval.com/community/newsgroups
waqasdanish - 31 Jul 2008 07:32 GMT
Hi,

I have also done these steps in order to mount my NAND Flash as root. The
files are copied successully and remain in the persistent storage. But I am
having a strange problem. Whenever I copy files, approximately equal to the
size of Flash FAT partition, OS image is corrupted when I restart my board
and the bootloader stucks at the start. I think the files on NAND Flash
overwrite the WinCE image area on flash??

Any idea?

An immediate response in this regard shall be highly appreciated.

Regards,
Waqas
>You were right Sue, i only did one of the two things: i did change the
>catalog items but i only did a build and sysgen w/out selecting the "Clean
[quoted text clipped - 11 lines]
>> us know!
>> https://www.windowsembeddedeval.com/community/newsgroups
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.