Partager via


Block Driver Registry Settings (Compact 2013)

3/26/2014

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 depend on the registry settings to be present at startup. These keys must be part of the default registry. In addition, the default registry can include other registry keys and values that you install.

You can install keys for removable block devices on first use of the device.

Refer to the following sections for information on block devices and registry settings:

  • Name Limitations for Autoload Block Devices
  • Built-In Block Device Registry Keys
  • ATAPI Block Device Driver Registry Keys
  • Secure Digital (SD) Card Registry Settings
  • Names for Hard Disk Drives

Name Limitations for Autoload Block Devices

If you add AutoLoad block drivers to the platform, you must restrict AutoLoad subkeys to seven characters to avoid possible name collisions.

Within the registry code that configures the driver, the AutoLoad subkey 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 still work, but one is not accessible via the storage manager API, which can lead to limited functionality in some applications.

To avoid this situation, shorten the AutoLoad key names so they contain fewer than seven 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

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 uses 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 Compact contains components that you can add or remove by using SYSGEN variable settings. The following table lists the SYSGEN variables for the ATA/ATAPI driver and the dependencies for each variable.

SYSGEN variable

Description

Dependencies

SYSGEN_ATAPI_PCIO

On-board PCI ATA/ATAPI host bus adapter support. Hard disk drive only.

None

SYSGEN_ATAPI_PCIO_CD

On-board PCI ATA/ATAPI host bus adapter support. ATA hard disk drive and CD/DVD only.

SYSGEN_ATAPI_PCIO

SYSGEN_ATAPI_PCIP_PDC20262

On-board PCI ATA/ATAPI host bus adapter support. ATA hard disk drive, CD/DVD, and peripheral PCI Promise PDC2026 host bus adapter.

SYSGEN_ATAPI_PCIO
SYSGEN_ATAPI_PCIO_CD

SYSGEN_ATAPI_PCIP_PDC40518

On-board PCI ATA/ATAPI host bus adapter support. ATA hard disk drive, CD/DVD, and peripheral PCI Promise PDC40518 host bus adapter.

SYSGEN_ATAPI_PCIO
SYSGEN_ATAPI_PCIO_CD

SYSGEN_ATAPI

Full ATA/ATAPI support, including hard disk drive, CD/DVD, and PCI Promise PDC2026.

SYSGEN_ATAPI_PCIO
SYSGEN_ATAPI_PCIO_CD
SYSGEN_ATAPI_PCIP_PDC20262
SYSGEN_ATAPI_PCIP_PDC40518

The ATAPI driver consists of an Integrated Drive Electronics (IDE) enumerator and an ATA/ATAPI driver. The IDE enumerator is activated for each IDE controller. On activation, the IDE enumerator scans the controller's primary and secondary channels for ATA/ATAPI devices.

If the enumerator finds a device, it invokes a spawn function that can distinguish one IDE controller from another. This spawn function is specified in the Platform.reg file for each OS design, and no modifications to this function are 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 ATAPI driver in Windows Embedded Compact 2013 introduces a new registry setting, LegacyIRQ, to replace the registry key HKLM\Drivers\BuiltIn\PCI\Template\<Controller Key Name>\Legacy. If LegacyIRQ is equal to IRQ (IRQ 14 for CEPC), the value of the secondary channel IRQ will be the Primary IRQ plus 1 (IRQ 15 for CEPC). If LegacyIRQ is absent or equal to -1 (0xffffffff), the driver assumes it is not using the legacy IRQ and both channels use the same IRQ (IRQ sharing).

The ATAPI driver in Windows Embedded Compact 2013 uses the exported functions NativeConfig, CreateNativePCIHD, and CreateNativePCIHDCD to support ATAPI controllers with IRQ sharing (such as SATA). To support IRQ sharing, the Platform.reg file must contain the following settings:

[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\PCI\Template\GenericIDE]
    "ConfigEntry"="NativeConfig"    ; PCI configuration entry point
    "IsrDll"="giisr.dll"            ; bus-agnostic; installable ISR
    "IsrHandler"="ISRHandler"       ; bus-agnostic; installable ISR
    "SpawnFunction"="CreateNativePCIHDCD" or "CreateNativePCIHD" ; depends on HD only or HD + CD/DVD
    "LegacyIRQ"=dword:ffffffff      ; explicitly sets native mode; not necessary for most cases

In most situations, you do not need to set the LegacyIRQ value to support IRQ sharing. The default setting of legacy mode is contained in either the Platform.reg file or the %_WINCEROOT%\Public\Common\Oak\Drivers\Block\ATAPI\*.reg files. If the ProgIf value contained in PCIbus.dll reports the controller mode as native, the ATAPI driver automatically changes the default registry value to native mode. The ATAPI driver cannot overwrite the LegacyIRQ value from native to legacy mode.

If the ProgIf value does not report the controller mode (using the bit definitions described in the NativeConfig function definition in %_WINCEROOT%\public\common\oak\drivers\block\atapi\pcicfg.cpp), you must set the LegacyIRQ value explicitly, as follows:

  • To support native mode, set the LegacyIRQ value as follows:

        "LegacyIRQ"=dword:ffffffff      ; explicitly sets native mode; not necessary for most cases
    
  • To support legacy mode, set the LegacyIRQ value as follows:

        "LegacyIRQ"=dword:e      ; explicitly sets legacy mode
    

The following registry key 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
   "LegacyIRQ"=dword:0e            ; The primary legacy IRQ, commonly 0xe on x86. Or please refer to the public\COMMON\oak\drivers\block\atapi\genericide.reg for more detail.   "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
;  "IsrHandler"=""                 ; not required; only required for bus-agnostic drivers, e.g., Promise PDC20262
   "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 (SD) Card Registry Settings

The following registry key examples show the registry settings for the Secure Digital (SD) card 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}"

Names for Hard Disk Drives

To assign a unique name to a hard disk drive, you must add HDProfile keys to the registry. For example, if you have two hard drives that use the ALI1453 driver, you can create HDProfile keys that assign a unique name to each hard disk drive and set one hard disk drive as the primary master and the other as the primary subordinate.

The following HDProfile key example shows the registry settings for hard disk drives that use the ALI1453 driver.

[$(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

Reference

Block Driver Reference