Block Driver Registry Settings (Windows Embedded CE 6.0)
1/6/2010
The Device Manager uses and manages several registry keys under the HKEY_LOCAL_MACHINE\Drivers registry key to load, track, and unload linear block device drivers.
Built-in devices rely on the registry settings to be present at startup. These keys must be part of the default registry, which includes the registry keys and values that you install.
You can install keys for removable block devices, such as linear flash memory PC Cards, on first use of the device.
This topic contains information about the following:
- Name Limitations For Autoload Block Devices
- PC Card Block Device Registry Keys
- Built-In Block Device Registry Keys
- ATAPI Block Device Driver Registry Keys
- Secure Digital Card Registry Settings
- the Hard Drives
Name Limitations For Autoload Block Devices
OEMs that add AutoLoad block drivers to their platform should keep AutoLoad sub-keys limited to seven characters to avoid possible name collisions.
Within the registry code that configures the driver, the AutoLoad sub-key string determines the name of a storage device. Because of the seven character limit, two drivers named Block Device1 and BlockDevice2 are both shortened to BlockDe, creating a name conflict.
The following example configures Storage Manager to AutoLoad two storage drivers, BlockDevice1 and BlockDevice2.
[HKEY_LOCAL_MACHINE\System\StorageManager\Autoload\BlockDevice1]
"DriverPath"="Drivers\\BuiltIn\\BlockDevice1"
"LoadFlags"=dword:1
"BootPhase"=dword:0
[HKEY_LOCAL_MACHINE\System\StorageManager\Autoload\BlockDevice2]
"DriverPath"="Drivers\\BuiltIn\\BlockDevice2"
"LoadFlags"=dword:1
"BootPhase"=dword:1
Note that both storage devices will still work, but one will not be accessibly via the storage manager API which can lead to limited functionality in some applications.
To work around this problem, shorten the AutoLoad key names to be shorter than 7 characters:
[HKEY_LOCAL_MACHINE\System\StorageManager\Autoload\BlkDev1]
"DriverPath"="Drivers\\BuiltIn\\BlockDevice1"
"LoadFlags"=dword:1
"BootPhase"=dword:0
[HKEY_LOCAL_MACHINE\System\StorageManager\Autoload\BlkDev2]
"DriverPath"="Drivers\\BuiltIn\\BlockDevice2"
"LoadFlags"=dword:1
"BootPhase"=dword:1
PC Card Block Device Registry Keys
To detect removable block devices, the Device Manager initiates a detection sequence to determine the specific device type.
The value of the Folder registry subkey under the HKEY_LOCAL_MACHINE\Drivers\PCMCIA\MyDriver registry key is optional. Its value determines the folder names that are associated with file system volumes.
The default value is Storage Card for the first volume, Storage Card2 for the second, and so on.
For example, if you use the value of the Folder registry subkey to change the folder name to My Folder, that is the name of the first device. The second folder is My Folder2, and so on.
The block device driver reads the Folder registry subkey when the file system driver requests a folder name.
The HKEY_LOCAL_MACHINE\Drivers\PCMCIA\Detect\20 registry key is an example. The 20 registry subkey can be any other number. Its value determines the order in which the Device Manager tries the driver's MyDriverDetectdisk function relative to other drivers' detection functions when attempting to identify an unknown type of PC Card.
For more information about the Device Manager, see Device Manager.
The Device Manager requires registry keys to initiate the detection sequence. The following registry key examples show how a PC Card driver named MyDriver uses registry keys:
[HKEY_LOCAL_MACHINE\Drivers\PCMCIA\MyDriver]
"Prefix" = "XXX"
"Dll" = "MyDriver.DLL"
"Index" = DWORD:1
"Order" = DWORD:1
"IClass"="{A4E7EDDA-E575-4252-9D6B-4195D48BB865}"
[HKEY_LOCAL_MACHINE\Drivers\PCMCIA\Detect\20]
"Dll"="MyDriver.DLL"
"Entry"="MyDriverDetectdisk"
Built-In Block Device Registry Keys
The HKEY_LOCAL_MACHINE\Drivers\BuiltIn registry key recognizes built-in block devices. The value of the Folder registry subkey is optional.
The following registry key example shows how a built-in driver called MyDriver should use the HKEY_LOCAL_MACHINE\Drivers\BuiltIn registry key:
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\MyDriver]
"Prefix" = "XXX"
"Dll" = "MyDriver.DLL"
"Index" = DWORD:1
"Order" = DWORD:1
"IClass"="{A4E7EDDA-E575-4252-9D6B-4195D48BB865}"
ATAPI Block Device Driver Registry Keys
The ATA/ATAPI driver for Windows Embedded CE is contains components that can be added or removed based on SYSGEN variable settings. The following table shows the components for the ATA/ATAPI driver.
SYSGEN variable | Description |
---|---|
SYSGEN_ATAPI_PCMCIA |
ATA PCMCIA/PC Card disk support. |
SYSGEN_ATAPI_PCIO |
On-board PCI ATA/ATAPI host bus adapter support. Hard disk only. |
SYSGEN_ATAPI_PCIO_CD |
On-board PCI ATA/ATAPI host bus adapter support. ATA hard disk and CD/DVD only. |
SYSGEN_ATAPI_PCIP_PDC20262 |
On-board PCI ATA/ATAPI host bus adapter support. ATA hard disk, CD/DVD, and peripheral PCI Promise PDC2026 host bus adapter. |
SYSGEN_ATAPI |
Full ATA/ATAPI support, including, PCMCIA/PC Card disk, hard disk, CD/DVD, and PCI Promise PDC2026. |
The following table shows the dependencies for the ATA/ATAPI SYSGEN variables.
SYSGEN variables | Dependencies |
---|---|
SYSGEN_ATAPI_PCIO_CD |
SYSGEN_ATAPI_PCIO |
SYSGEN_ATAPI_PCIP_PDC20262 |
SYSGEN_ATAPI_PCIO_CD, SYSGEN_ATAPI_PCIO |
SYSGEN_ATAPI |
SYSGEN_ATAPI_PCMCIA, SYSGEN_ATAPI_PCIO, SYSGEN_ATAPI_PCIO_CD, SYSGEN_ATAPI_PCIP_PDC20262 |
The ATAPI driver consists of an IDE enumerator and an ATA/ATAPI driver. The IDE enumerator is activated for each IDE controller. On activation, the IDE enumerator scans the primary and secondary channel, if present, of the controller in search of ATA/ATAPI devices.
If the enumerator finds a device, it invokes a spawn function specified in the registry. Since a driver supports multiple IDE controllers, this spawn function distinguishes one IDE controller from another. This function is specified in the Platform.reg file for an OS design. No modification to the spawn function is necessary.
The following list shows the location of the registry files for the ATAPI driver:
- %_WINCEROOT%\public\common\oak\drivers\block\atapi
- Ali1543.reg
- Genericide.reg
- Geodeide.reg
- I82371.reg
- Pdc20262.reg
- %_WINCEROOT%\public\common\oak\files
- Common.reg
- %_WINCEROOT%\platform\<your platform>\files
- Platform.reg
The following registry example shows the registry settings for the Intel i82371 driver.
; SpawnFunction specified in platform.reg.
// The top-most key is that of the IDE enumerator
[\Template\<Controller>]
"IClass"=multi_sz:"{CDDC3621-3512-4b3f-BB6F-B4DD5E061795}"
"Prefix"="IDE"
"Dll"="atapi.dll"
"Order"=dword:06
"Class"=dword:01
"SubClass"=dword:01
"ProgIF"=dword:80
"VendorID"=dword:8086 ; e.g., i82371 Vendor ID
"ConfigEntry"="GenericConfig" ; PCI configuration entry point
"Legacy"=dword:01 ; legacy mode; use Irq for IRQ of primary channel and Irq+1 for IRQ of secondary channel; only required for legacy on-board controllers
"Irq"=dword:0E ; 14; provided by bus driver
"SysIntr"=dword:00 ; SysIntr not specified; provided by bus driver
"DMAAlignment"=dword:04 ; default DMA alignment
"SoftResetTimeout"=dword:03 ; ATA/ATAPI spec defines 31s ceiling; this is too long
; "IsrDll"="" ; not required; only required for bus-agnostic drivers, e.g., Promise PDC20262; ATA PCMCIA/PC Card disk
; "IsrHandler"="" ; not required; only required for bus-agnostic drivers, e.g., Promise PDC20262; ATA PCMCIA/PC Card disk
"RegisterStride"=dword:01 ; ATA register stride; register block is contiguous
// Under the IDE enumerator key are 4 subkeys; one subkey for each possible device on a // two-channel controller: Device0 = master on primary channel, Device1 = subordinate on
// primary channel, Device2 = master on secondary channel, Device3 = subordinate on secondary
// channel
[\Template\<Controller>\Device0]
"IClass"=multi_sz:"{A4E7EDDA-E575-4252-9D6B-4195D48BB865}"
"Prefix"="DSK"
"Dll"="atapi.dll"
"InterruptDriven"=dword:01 ; enable interrupt driven I/O
"DMA"=dword:01 ; enable DMA; 0 = disabled, 1 = enabled, 2 = enabled for hard disks and disabled for CD-ROMs
"DoubleBufferSize"=dword:10000 ; 65536 byte (128 sectors) double buffer; maximum is 256 secotrs
"DrqDataBlockSize"=dword:200 ; 1 sector (512 byte) DRQ data block
"WriteCache"=dword:01 ; enable on-disk write cache
"LookAhead"=dword:01 ; enable on-disk look-ahead
"DeviceId"=dword:00 ; device 0, i.e., primary master
"TransferMode"=dword:FF ; use device default transfer mode (Ultra DMA 3, 4 require 80-conductor cable)
// The "TransferMode" byte value can take on the following values:
Mode Value (Hex)
---- -----
PIO default mode 00
PIO default mode, disable IORDY 01
PIO flow control transfer mode Mode 0=08, 1=09, 2=0A, 3=0B, 4=0C
Multiword DMA mode Mode 0=20, 1=21, 2=22
Ultra DMA mode Mode 0=40, 1=41, 2=42, 3=43, 4=44
// Note: Not all drives support all DMA modes; Ultra DMA modes 3 and 4 require an 80-conductor cable.
[\Template\<Controller>\Device1]
...
[\Template\<Controller>\Device2]
...
[\Template\<Controller>\Device3]
...
Secure Digital Card Registry Settings
The following registry key examples show the registry settings for the SD memory driver.
; SD Memory Storage class driver
[HKEY_LOCAL_MACHINE\Drivers\SDCARD\ClientDrivers\Class\SDMemory_Class]
"Dll"="SDMemory.dll"
"Prefix"="DSK"
"BlockTransferSize"=dword:40 ; send no more than 64 blocks of data per bus transfer
;"SingleBlockWrites"=dword:1 ; alternatively force the driver to use single block access
;"IdleTimeout"=dword:7D0 ; 2000 milliseconds
;"IdlePowerState"=dword:2 ; 0 == D0, 1 == D1, etc.
;"DisablePowerManagement"="" ; if value present, then disable (remove value to enable)
"Profile"="SDMemory"
"IClass"=multi_sz:"{A4E7EDDA-E575-4252-9D6B-4195D48BB865}",
"{A32942B7-920C-486b-B0E6-92A702A99B35}"
Naming the Hard Drives
To have a unique name for each hard disk, you need to add "HDProfile" keys. The following example shows how to add two, uniquely-named hard drives, one of which is the primary master drive and one the primary subordinate drive.
[$(PCI_BUS_ROOT)\Template\ALI1453\Device0]
"HDProfile"="HDProfile2" ; primary master
[$(PCI_BUS_ROOT)\Template\ALI1453\Device1]
"HDProfile"="HDProfile3" ; primary subordinate
[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\HDProfile2]
"Name"="IDE Hard Disk Drive"
"Folder"="MyHD"
[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\HDProfile3]
"Name"=" second IDE Hard Disk Drive"
"Folder"="SecondaryHD"
See Also
Concepts
Block Driver Architecture
Block Driver Samples