CM-X300: WinCE: Hive Based Registry on SD card

From Compulab Mediawiki
Revision as of 08:08, 4 February 2010 by Mike (talk | contribs) (Persisting the Registry on SD card)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Introduction

Windows Embedded CE supports two types of registries: RAM-based and hive-based.

The registry type is invisible to applications, but affects the persistence, boot sequence, boot time and memory consumption on a target device.

For more information about registry types please refer to Registry Types and Hive-Based Registry MSDN articles.

This page lists the required steps to set the hive based registry on the SD card.

For a review of changing the registry type to RAM-Based, please refer to Registry support section in the CM-X300: WinCE: OSDesign_Configuration article.

Persisting the Registry on SD card

The CM-X300 BSP is configured for HIVE-based registry with lazy flushing. The registry hive is located in the system NAND flash. In order to move registry hive location to SD Card, make the following changes to Platform.reg:

  • Apply the following values:
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\MSFlash]      
     "Flags"=dword:00010000
    
[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\MSFlash]
     "BootPhase"=dword:1

[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\MSFlash\FATFS]
     "MountAsBootable"=dword:0
     "MountAsRoot"=dword:0

; HIVE BOOT SECTION

; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; PMIC Driver (Power Management IC)
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\PI2C]
     "Prefix"="PWR"
     "Dll"="$(_TGTPLAT_PFX)_PI2C.dll"
     "Order"=dword:6  ; Must loading after MFP driver loading   
     "Flags"=dword:1000

IF BSP_NOPMIC !
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\PowerIC]
     "InterfaceType"=dword:0     ; Internal
     "Prefix"="PIC"
     "Dll"="$(_TGTPLAT_PFX)_PMIC.dll"
     "Flags"=dword:11000;  DEVFLAGS_TRUSTEDCALLERONLY
     "Order"=dword:7
     "IClass"="{1B4091E0-9F41-4d4f-8702-8C02368F20B1}"
ENDIF BSP_NOPMIC !

; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; IPM - Marvell Power Manager
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
IF BSP_NOIPM !
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\IPM]
    "Dll"="$(_TGTPLAT_PFX)_ipm_main.dll"
    "Prefix"="IPM"
    "IClass"="{A32942B7-920C-486b-B0E6-92A702A99B35}"
    "Order"=dword:10
    "Flags"=dword:11000;  DEVFLAGS_TRUSTEDCALLERONLY
    "Priority256"=dword:00000010
     "EnableD0CSOP"=dword:00000001
     "EnableD0CSIDLE"=dword:00000001
     "EnableD1IDLE"=dword:00000000
     "EnableD2IDLE"=dword:00000001
ENDIF BSP_NOIPM !
; END HIVE BOOT SECTION
Admolition note.png The above keys are already defined in the Platform.reg and only their values should be modified
  • Add the following entries to Platform.reg:
; @CESYSGEN IF FILESYS_FSREGHIVE
; HIVE BOOT SECTION
    
  [HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\SDMemory]
      "Name"="SD Memory Card"
      "Folder"=""
      "MountAsBootable"=dword:1
      "MountAsRoot"=dword:1
      "MountBootable"=dword:1
      "LoadFlags"=dword:1
      "BootPhase"=dword:0
      "DefaultFileSystem"="BINFS"
      "PartitionDriver"="mspart.dll"
      "Order"=dword:4
      "AutoMount"=dword:1
      "AutoPart"=dword:1
      "AutoFormat"=dword:1
      "MountHidden"=dword:0
      "MountAsNetwork"=dword:1
      "MountPermanent"=dword:1
      "EnableWriteBack"=dword:1 
      "MountSystem"=dword:1
    
   [HKEY_LOCAL_MACHINE\System\StorageManager\AutoLoad\ObjectStore]
      "MountAsBootable"=dword:0
      "MountAsRoot"=dword:0

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

   [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\GIO]
      "Prefix"="GIO"
      "Dll"="cm_x300_gpio.dll"
      "Order"=dword:6  ; Must load after MFP driver loads
      "Flags"=dword:00001000

; @CESYSGEN IF CE_MODULES_SDBUS
	
   [HKEY_LOCAL_MACHINE\Drivers\Builtin\SDBusDriver]
      "Order"=dword:15
      "Dll"="SDBus.dll"
      "Prefix"="SDC"
      "ThreadPriority"=dword:64     ; default thread priority for dispatch thread
      "RequestListDepth"=dword:30   ; pre-allocated requests
      "Flags"=dword:10000 ; DEVFLAGS_TRUSTEDCALLERONLY
      "IClass"=multi_sz:"{20FA98A8-B298-4b32-8D72-C716AEE2FA84}=%b","{6F40791D-300E-44E4-BC38-E0E63CA8375C}=%b"
      "Flags"=dword:00011000

   [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
      "Order"=dword:16
      "Profile"="SDMemory"
      "IClass"=multi_sz:"{A4E7EDDA-E575-4252-9D6B-4195D48BB865}",
                        "{8DD679CE-8AB4-43c8-A14A-EA4963FAA715}"
      "Flags"=dword:00001000
		
    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\SDHC]
        "Order"=dword:50
        "Flags"=dword:00001000
        "Dll"="cm_x300_sdhc.dll"
        "Prefix"="SDH"
        "SDHCIndex"=dword: 0
        "ControllerISTPriority"=dword:64
        "SlotNum"=dword:1 ;Number of slots connected to the controller
        "ClockAlwaysOn"=dword:0
        ; Indicate a power manageable interface
        "IClass"="{A32942B7-920C-486b-B0E6-92A702A99B35}"
        "HotPluginNRemovable"=dword:1 ;Hex that specifies which slot can be HotPlugged
        "FastPathEnabled"=dword: 0

    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\SDHC_2]
        "Order"=dword:50
        "Flags"=dword:00001000
        "Dll"="cm_x300_sdhc.dll"
        "Prefix"="SDH"
        "SDHCIndex"=dword: 1
        "ControllerISTPriority"=dword:64
        "SlotNum"=dword:1
        "ClockAlwaysOn"=dword:1
        ; Indicate a power manageable interface
        "IClass"="{A32942B7-920C-486b-B0E6-92A702A99B35}"
        "HotPluginNRemovable"=dword:0
        "FastPathEnabled"=dword: 0
		
	
    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\PCI\Template\SDIOStandardHC]
	"Dll"="SDHC.dll"
	"Prefix"="SHC"
	"IsrDll"="giisr.dll"
	"IsrHandler"="ISRHandler"
	"Class"=dword:08 ; General peripheral
	"SubClass"=dword:05 ; SD Host Controller
	"ProgIf"=dword:00 ; 00 Std host no DMA, 01 Std host DMA, 02 vendor unique
	"DefaultWakeupSources"=dword:06 ; Wake on insertion and removal
	"AllowWakeOnSDIOInterrupts"=dword:01
	"ObjectCreationProc"="CreateSDHCPciObject"
	"Flags"=dword:00001000
	"Order"=dword:17
		
    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\PCI\Template\SDIOStandardHCWithDMA]
	"Dll"="SDHC.dll"
	"Prefix"="SHC"
	"IsrDll"="giisr.dll"
	"IsrHandler"="ISRHandler"
	"Class"=dword:08 ; General peripheral
	"SubClass"=dword:05 ; SD Host Controller
	"ProgIf"=dword:01 ; 00 Std host no DMA, 01 Std host DMA, 02 vendor unique
	"DefaultWakeupSources"=dword:06 ; Wake on insertion and removal
	"AllowWakeOnSDIOInterrupts"=dword:01
	"ObjectCreationProc"="CreateSDHCPciObject"
	"Flags"=dword:00001000
	"Order"=dword:18

; @CESYSGEN ENDIF CE_MODULES_SDBUS
; END HIVE BOOT SECTION
; @CESYSGEN ENDIF FILESYS_FSREGHIVE
Admolition note.png The HIVE BOOT SECTION and cesysgen conditionals are not just a comments, do not forget to copy them also.
  • Rebuild the BSP.