RE: Device driver should load before StorageManager by arogers
arogers
Mon Jan 05 12:34:38 CST 2004
If you are using an auto-load flash driver, it sounds like you must be
using CE 4.2. This reply is based on features available in 4.2 and not
before. If you are using an older version of CE, please let me know and
disregard the information in this message.
In CE 4.2, the "StartDevMgr" registry value (under HKLM\init\BootVars) has
been depricated. The new preferred method for starting the driver for your
hive storage device is to use the "flags" value. The following is taken
from %_WINCEROOT%\public\common\oak\files\common.reg:
; Valid Bits for Flags registry value
; If no flags are set, the hive will be stored in the object store.
;
; 0x00000001 Start storage manager in boot phase 1 for hive-based
registry
; 0x00000002 Start device manager in boot phase 1 for hive-based registry
; 0x00000004 Start storage manager in boot phase 1 for registry in
; external ROM (such as BINFS)
; 0x00000008 Start device manager in boot phase 1 for registry in
; external ROM (such as BINFS)
So, if the media where your hive files are stored requires only storage
manager (such as an autoload device), set the following:
; HIVE BOOT SECTION
[HKEY_LOCAL_MACHINE\init\BootVars]
"Flags"=dword:1
; END HIVE BOOT SECTION
If the media requires a driver to be loaded by device manager (such as
ATAPI for accessing a hard disk), se the following:
; HIVE BOOT SECTION
[HKEY_LOCAL_MACHINE\init\BootVars]
"Flags"=dword:2
; END HIVE BOOT SECTION
Note that if starting device manager is required, storage manager will
implicitly be started as well. So, setting flags=2 is the same as setting
flags=3 (1 and 2 OR'd together). Also, flags 4 and 8 are only necessary if
you are using BinFS and can be disregarded otherwise.
In addition to the flags registry value, CE 4.2 also introduced the
concept of auto loading a block device driver using storage manager witout
starting device manager. The sample registry keys for the msflash driver
(look under
%_WINCEROOT%\public\common\oak\drivers\block\msflashfmd\strata\stratad\strat
a.reg) show how to set up the keys for an auto load block device.
Basically, an auto load storage driver consists of a standard, built-in
driver registry entry (like a driver to be loaded by device manager) and an
additional autoload registry key that refers to it:
; HIVE BOOT SECTION
; original driver key
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\FlashDriver]
"Dll"="flashdriver.dll"
"Order"=dword:2
"Prefix"="DSK"
"Ioctl"=dword:4
"Profile"="MSFlash"
"IClass"="{A4E7EDDA-E575-4252-9D6B-4195D48BB865}"
; key use by storage manager to locate the driver key
[HKEY_LOCAL_MACHINE\System\StorageManager\AutoLoad\FlashDevice]
"DriverPath"="Drivers\\BuiltIn\\FlashDriver"
; LoadFlags 0x01 == load synchronously
"LoadFlags"=dword:1
"Order"=dword:0
"BootPhase"=dword:0
; END HIVE BOOT SECTION
Once the driver has been loaded by storage manager, it will not be loaded a
second time by device manager.
Andrew Rogers
Microsoft Windows CE
___________________________________________________________
To reply directly, remove "online" from my email address.
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
> From: Michael <anonymous@some.com>
> Newsgroups: microsoft.public.windowsce.platbuilder
> Subject: Device driver should load before StorageManager
> Date: Wed, 03 Dec 2003 17:25:07 +0100
> Organization: Swisscom IP+ (post doesn't reflect views of Swisscom)
> Lines: 36
> Message-ID: <s42ssvc8cej407cbksofrmd87gogpbfptk@4ax.com>
> NNTP-Posting-Host: 217.192.239.49
> Mime-Version: 1.0
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit
> X-Trace: rex.ip-plus.net 1070468752 17808 217.192.239.49 (3 Dec 2003
16:25:52 GMT)
> X-Complaints-To: abuse@ip-plus.net
> NNTP-Posting-Date: Wed, 3 Dec 2003 16:25:52 +0000 (UTC)
> X-Newsreader: Forte Free Agent 1.93/32.576 English (American)
> Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onlin
e.de!130.59.10.21.MISMATCH!irazu.switch.ch!news-zh.switch.ch!switch.ch!newsf
eed-zh.ip-plus.net!news.ip-plus.net!not-for-mail
> Xref: cpmsftngxa06.phx.gbl microsoft.public.windowsce.platbuilder:43030
> X-Tomcat-NG: microsoft.public.windowsce.platbuilder
>
> Hi everyone
>
> I am using a hive based registry.
> The HIVE BOOT SECTION looks something like this (pseudo)
> ;HIVE BOOT SECTION
> start DevMgr = 1 ; allow for hive based registry
> StorageManager autoload Flash profile
> ourDeviceDriver order:0
> flashDriver order:1
> ;END HIVE BOOT SECTION
>
> The Boot order now is the following:
> --------------------------------------------------------
> 0) Boot registry is loaded
> 1) Storage Manger starts
> -autoload flash profile loads 'flashDriver'
> 2) built in drivers are loaded
> ourDeviceDriver
> (flashDriver is already loaded and thus not loaded again)
>
> What I would need is:
> ----------------------------------
> 0) Boot registry is loaded
> 1) ourDeviceDriver is loaded
> 2) <do everything else>
>
> It is extremely important that 'ourDeviceDriver' is loaded prior to
> any driver else, i.e. 'flashDriver' depends on 'ourDeviceDriver'.
>
> Does anyone know how it can be achieved to load a device driver as
> soon as the Boot Registry is available BEFORE any other driver or
> component is loaded?
>
> Any hints appreciated, thanks.
> -Michael
>
>