在SD/MMC卡上实现hive (Implement WinCE HIVE&ROM system on NAND or SD system )

本是个很简单的topic,但无奈的是很多客户都没有实现。所以只能写一个guide给客户,让他们依葫芦画瓢。

在SD卡上实现hive以及实现binfs最精髓的思想是,在boot stage 1依次加载sd bus driver, sd host driver,而sd host driver会根据总线枚举的结果来加载sd或者mmc的client driver.这个driver就是sd_memory.dll.
另外就是要保证sd memory的驱动得在boot stage 2之前完成加载,不然就不能取得hive.reg之外的注册表。

如果有人也感兴趣在sd/mmc上实现binfs,除了做以上的动作之外还需要修改eboot,让eboot去生成binfs分区,并将ext.bin中binfs分区部的bin数据放到binfs分区中。这个我也已经实现了。有空再表吧...

来些英文的…

Implement WinCE HIVE&ROM

system on NAND or SD system

1.0      Scope

This document details in how toimplement the WinCE6 HIVE&ROM system. Two types of media are widely used in Au1300 system, the NAND flash and the SD card. The document will describe
the steps implementing HIVE&ROM system for both media type.

2.0      Hardware details

NAND flash is connected with Au1300’s static memory controller. The SD card is connected with SD slot.

3.0      Creating HIVE&ROM system

Section 3.1 will describe how to implement HIVE&ROM system on NAND flash disk while section 3.2 describes the similar system way to create HVIE&ROM system
on SD card.

3.1 HIVE&ROM system on NAND flash

3.1.1    Add catalog components

catalog->CEBASE->File Systems and Data Store->File system->ROM-only File System

catalog->CEBASE->File Systems and Data Store->Registry Storage- >Hive-based Registry

在SD/MMC卡上实现hive (Implement WinCE HIVE&ROM system on NAND or SD system )

catalog->CEBASE-> File Systems and Data Store->Storage Manager ->FAT File System

catalog->CEBASE-> File Systems and Data Store->Storage Manager ->Partition Driver

在SD/MMC卡上实现hive (Implement WinCE HIVE&ROM system on NAND or SD system )

catalog->Third Party->AVN13xx:MIPSII->Storage->NAND

在SD/MMC卡上实现hive (Implement WinCE HIVE&ROM system on NAND or SD system )

3.1.2    Step2: Registry settings

Update nand fmd driver registry with following content. The nand fmd driver registry is located /Drivers/Nandfmd/nandfmd.reg.

; HIVE BOOT SECTION

; This file is to be included in platform.reg if required.

[HKEY_LOCAL_MACHINE\Drivers\Builtin\NAND]

"Profile"="NAND"

"IClass"=multi_sz:"{A4E7EDDA-E575-4252-9D6B-4195D48BB865}"

"Order"=dword:0

"FriendlyName"="NAND FLASH Driver"

"Dll"="NANDFMD.dll"

"Prefix"="DSK"

"Index"=dword:1

"Flags"=dword:1000

[HKEY_LOCAL_MACHINE\System\StorageManager\AutoLoad\NAND]

"DriverPath"="Drivers\\Builtin\\NAND"

"LoadFlags"=dword:1

"Order"=dword:0

[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\NAND]

"Name"="NAND FLASH Storage"

"DefaultFileSystem"="FATFS"

"PartitionDriver"="mspart.dll"

"Folder"="NAND FLASH"

"AutoPart"=dword:1

"AutoMount"=dword:1

"AutoFormat"=dword:1

[HKEY_LOCAL_MACHINE\init\BootVars]

"SystemHive"="Documents and Settings\\system.hv"

"ProfileDir"="Documents and Settings"

"Flags"=dword:3

"RegistryFlags"=dword:1

"NoDefaultUser"=dword:0

; END HIVE BOOT SECTION

3.2 HIVE&ROM system on SD card

3.2.1    Add catalog components

catalog->CEBASE->File Systems and Data Store->File system->ROM-only File System

catalog->CEBASE->File Systems and Data Store->Registry Storage- >Hive-based Registry

在SD/MMC卡上实现hive (Implement WinCE HIVE&ROM system on NAND or SD system )

catalog->CEBASE-> File Systems and Data Store->Storage Manager ->FAT File System

catalog->CEBASE-> File Systems and Data Store->Storage Manager ->Partition Driver

在SD/MMC卡上实现hive (Implement WinCE HIVE&ROM system on NAND or SD system )

catalog->Third Party->AVN13xx:MIPSII->Storage->Removable->Secure Digital/MMC

在SD/MMC卡上实现hive (Implement WinCE HIVE&ROM system on NAND or SD system )

3.2.2    Step2: Registry settings

Update SDIO host driver registry with following content. The SDIO driver registry is located /Drivers/SDIO/sdio.reg.

;

;

; Alchemy Au1100 SD Controller registry settings

; HIVE BOOT SECTION

; setting for SD bus driver to load driver

[HKEY_LOCAL_MACHINE\Drivers\Builtin\SDHC_Au1100]

"Dll"="SDIO.dll"

"Order"=dword:1

"Prefix"="SDP"

; force the host controller to run in the PIO mode instead of

; of DMA mode.

"PIOMode"=dword:0

; Disable the MMC 8 bit wide data bus for SD0, the eMMC slot, which is slot 1

; for emmc device, dont disable 8 bits bus

; for sd device, only support 4 bits bus

"Disable8BitBus"=dword:1

"Index"=dword:1

"Flags"=dword:1000

[HKEY_LOCAL_MACHINE\Drivers\Builtin\SDBusDriver]

"Dll"="SDBus.dll"

"Order"=dword:0

"Index"=dword:1

"Prefix"="SDC"

"ThreadPriority"=dword:64     ; default thread priority for dispatch thread

"RequestListDepth"=dword:30   ; pre-allocated requests

"Flags"=dword:11000 ; DEVFLAGS_TRUSTEDCALLERONLY

"IClass"=multi_sz:"{20FA98A8-B298-4b32-8D72-C716AEE2FA84}=%b","{6F40791D-300E-44E4-BC38-E0E63CA8375C}=%b"

[HKEY_LOCAL_MACHINE\Drivers\SDCARD\ClientDrivers\Class\SDMemory_Class]

"Dll"="SDMemory.dll"

"Order"=dword:1

"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}"

[HKEY_LOCAL_MACHINE\Drivers\SDCARD\ClientDrivers\Class\MMC_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      ; milliseconds

;"IdlePowerState"=dword:2     ; 0 == D0, 1 == D1, etc.

;"DisablePowerManagement"=""  ; if value present, then disable (remove value to enable)

"Profile"="MMC"

"IClass"=multi_sz:"{A4E7EDDA-E575-4252-9D6B-4195D48BB865}",

"{A32942B7-920C-486b-B0E6-92A702A99B35}"

[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\MMC]

"Name"="MMC Memory Card"

"Folder"="MMCCard"

"PartitionDriverName"="MSPART"

"DefaultFileSystem"="FATFS"

"BootPhase"=dword:0

[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\MMC\FATFS]

"MountAsBootable"=dword:1

"MountAsROM"=dword:1

"MountAsRoot"=dword:1

"AutoFormat"=dword:1

"AutoPart" =dword:1

"AutoMount"=dword:1

"BootPhase"=dword:0

[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\SDMemory]

"PartitionDriverName"="MSPART"

"Name"="SD Memory Card"

"Folder"="SDCard"

"DefaultFileSystem"="FATFS"

"BootPhase"=dword:0

[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\SDMemory\FATFS]

;  "MountAsBootable"=dword:1

;  "MountAsROM"=dword:1

;  "MountAsRoot"=dword:1

"AutoFormat"=dword:1

"AutoPart" =dword:1

"AutoMount"=dword:1

"BootPhase"=dword:0

[HKEY_LOCAL_MACHINE\Drivers\SDCARD\ClientDrivers\Class\SDMemory_Class\High_Capacity]

"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}",

"{8DD679CE-8AB4-43c8-A14A-EA4963FAA715}"

[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\MMC\BINFS]

"MountSystem"=dword:1

"MountAsROM"=dword:1

"BootPhase"=dword:0

; SDHC Memory Storage class driver

[HKEY_LOCAL_MACHINE\Drivers\SDCARD\ClientDrivers\Class\MMC_Class\High_Capacity]

"Dll"="SDMemory.dll"

"Prefix"="DSK"

"BlockTransferSize"=dword:100  ; send no more than 256 blocks of data per bus transfer

"Index"=dword:1

"BootPhase"=dword:0

;"BlockTransferSize"=dword:40  ; send no more than 64 blocks of data per bus transfer

"SDClockRateOverride"=dword:2625A0         ; 52000000 Hz

;"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"="MMC"

"IClass"=multi_sz:"{A4E7EDDA-E575-4252-9D6B-4195D48BB865}",

"{8DD679CE-8AB4-43c8-A14A-EA4963FAA715}"

[HKEY_LOCAL_MACHINE\System\StorageManager\BinFS]

"BootPhase"=dword:0

"Order"=dword:0

"FriendlyName"="BIN Filesystem"

"Dll"="binfs.dll"

"Paging"=dword:1

[HKEY_LOCAL_MACHINE\init\BootVars]

"SystemHive"="\\Hive\\system.hv"

"ProfileDir"="Documents and Settings"

"Flags"=dword:3

"RegistryFlags"=dword:1

"NoDefaultUser"=dword:0

; END HIVE BOOT SECTION

上一篇:self.automaticallyAdjustsScrollViewInsets


下一篇:神奇的Content-Type——在JSON中玩转XXE攻击