如何使用HIVE-based Registry

如何使用HIVE-based Registry

Mark 
            2007-12-04
CE HIVE 注册表可以使用户操作的相关设置以注册表的形式保存到 DOM 等存储设备中 . 加了 HIVE 的相关组件后 , 可以通过手动或自动方式保存信息到存储设备里 .
l
手动存储方式是执行一个软件后 , 把用户设置的相关信息回写到 HIVE 注册表里面
l
自动存储方式是在 Platform.reg 中把 RegistryFlags 设置成 1, 当用户启动系统后 , 设置相关信息就会自动的保存到 HIVE Registry 里面 .

CE5.0 CE6.0 下的具体操作如下所示

一.
CE6.0 下实现方法
1.
添加组件 :
l
Catalog->Core OS->CEBASE->FileSystem and Data Store->File System-Interneal
->ROM-only File System
l
Catalog->Core OS->CEBASE->FileSystem and Data Store->Registry storage->
Hive-based Registry
l
Catalog->Core OS->CEBASE->FileSystem and Data Store->Storage Manager
->Fat File System
l
Catalog->Device Drivers->Storage Devices -> ATAPI PCI Support
l
Catalog->Device Drivers->Storage Devices -> ATAPI PCI Support->
Basic ATAPI PCI CD/DVD ROM Support-> ATAPI PCI/IDE Storage Block Driver
  以后操作步骤有两种方法 :
方法一 : ( 手动保存信息到 HIVE Registry, 启动 CE 后需要执行相应的程序后才可以保存 )


2.
修改注册表
platform.reg 文件中添加如下内容 :
; @CESYSGEN IF FILESYS_FSREGHIVE
; HIVE BOOT SECTION
[HKEY_LOCAL_MACHINE/init/BootVars]

"SYSTEMHIVE"="//Registry//system.hv"


"PROFILEDIR"="//Registry"


"Start DevMgr"=dword:1


"DefaultUser"="User"


"Flags"=dword:3

[HKEY_LOCAL_MACHINE/Drivers/Resources/IRQ]

"Flags"=dword:1000

[HKEY_LOCAL_MACHINE/Drivers/Resources/IO]

"Flags"=dword:1000

[$(PCI_BUS_ROOT)/Template/GenericIDE]

"Flags"=dword:1000

[$(PCI_BUS_ROOT)/Template/GenericIDE/Device0]

"Flags"=dword:1000

[HKEY_LOCAL_MACHINE/System/StorageManager/FATFS]

"Flags"=dword:1004

[HKEY_LOCAL_MACHINE/System/StorageManager/Profiles/HDProfile/FATFS]

"MountAsBootable"=dword:1

[HKEY_LOCAL_MACHINE/Drivers/BuiltIn/PCI/Template/PCI-PCI-BRIDGE]

"Class"=dword:06


"SubClass"=dword:04


"NoConfig"=dword:1

; END HIVE BOOT SECTION
; @CESYSGEN ENDIF FILESYS_FSREGHIVE

; @CESYSGEN IF !FILESYS_FSYSRAM
; HIVE BOOT SECTION
[HKEY_LOCAL_MACHINE/System/StorageManager/Profiles/HDProfile/FATFS]

"MountAsRoot"=dword:1


"MountPermanent"=dword:1

; END HIVE BOOT SECTION
; @CESYSGEN ENDIF !FILESYS_FSYSRAM

3. 编译 image
4. 编写注册表刷新软件 ( 控制台程序 )
  具体程序如下 :

    #include "stdafx.h"


int WINAPI WinMain(HINSTANCE hInstance,
                    HINSTANCE hPrevInstance,
                    LPTSTR    lpCmdLine,
                    int      nCmdShow)
{
    RegFlushKey( HKEY_LOCAL_MACHINE);

RegFlushKey( HKEY_CLASSES_ROOT);

RegFlushKey( HKEY_CURRENT_USER);

RegFlushKey( HKEY_USERS);


    return 0;
}




方法二 : ( 自动保存信息到 HIVE Registry)
2. 修改注册表
platform.reg 文件中添加如下内容 :
; @CESYSGEN IF FILESYS_FSREGHIVE
; HIVE BOOT SECTION
[HKEY_LOCAL_MACHINE/init/BootVars]

"SYSTEMHIVE"="//Registry//system.hv"


"PROFILEDIR"="//Registry"


"Start DevMgr"=dword:1



"RegistryFlags"=dword:1


"DefaultUser"="User"


"Flags"=dword:3


[HKEY_LOCAL_MACHINE/Drivers/Resources/IRQ]

"Flags"=dword:1000


[HKEY_LOCAL_MACHINE/Drivers/Resources/IO]


"Flags"=dword:1000

[$(PCI_BUS_ROOT)/Template/GenericIDE]

"Flags"=dword:1000

[$(PCI_BUS_ROOT)/Template/GenericIDE/Device0]

"Flags"=dword:1000

[HKEY_LOCAL_MACHINE/System/StorageManager/FATFS]

"Flags"=dword:1004

[HKEY_LOCAL_MACHINE/System/StorageManager/Profiles/HDProfile/FATFS]

"MountAsBootable"=dword:1

[HKEY_LOCAL_MACHINE/Drivers/BuiltIn/PCI/Template/PCI-PCI-BRIDGE]

"Class"=dword:06


"SubClass"=dword:04


"NoConfig"=dword:1

; END HIVE BOOT SECTION
; @CESYSGEN ENDIF FILESYS_FSREGHIVE

; @CESYSGEN IF !FILESYS_FSYSRAM
; HIVE BOOT SECTION
[HKEY_LOCAL_MACHINE/System/StorageManager/Profiles/HDProfile/FATFS]

"MountAsRoot"=dword:1


"MountPermanent"=dword:1

; END HIVE BOOT SECTION
; @CESYSGEN ENDIF !FILESYS_FSYSRAM
3. 编译 image


二.
CE5.0 上的实现方法
1.
添加组件 :
l
Catalog->Core OS->CEBASE->FileSystem and Data Store->Registry storage->
Hive-based Registry
l
Catalog->Core OS->CEBASE->FileSystem and Data Store->Storage Manager
->Fat File System
l
Catalog->Device Drivers->Storage Devices ->ATAPI PCI/IDE Storage Block Driver -> ATAPI PCI/IDE Storage Block Driver
  以后操作步骤有两种方法 :
方法一 : ( 手动保存信息到 HIVE Registry, 启动 CE 后需要执行相应的程序后才可以保存 )


2.
修改注册表
platform.reg 文件中添加如下内容 :
; @CESYSGEN IF FILESYS_FSREGHIVE
; HIVE BOOT SECTION

[HKEY_LOCAL_MACHINE/init/BootVars]
"SYSTEMHIVE"="//Registry//system.hv"
"PROFILEDIR"="//Registry"
"Start DevMgr"=dword:1
"DefaultUser"="User"

[HKEY_LOCAL_MACHINE/Drivers/Resources/IRQ]
"Flags"=dword:1000
[HKEY_LOCAL_MACHINE/Drivers/Resources/IO]
"Flags"=dword:1000
[$(PCI_BUS_ROOT)/Template/GenericIDE]
"Flags"=dword:1000
[HKEY_LOCAL_MACHINE/System/StorageManager/FATFS]
"Flags"=dword:1000
[HKEY_LOCAL_MACHINE/System/StorageManager/Profiles/HDProfile]
"MountFlags"=dword:2
[HKEY_LOCAL_MACHINE/Drivers/BuiltIn/PCI/Template/PCI-PCI-BRIDGE]
"Class"=dword:06
"SubClass"=dword:04
"NoConfig"=dword:1
; END HIVE BOOT SECTION
; @CESYSGEN ENDIF FILESYS_FSREGHIVE
3. 编译 image
4. 编写注册表刷新软件 ( 控制台程序 )
  具体程序如下 :

    #include "stdafx.h"


int WINAPI WinMain(HINSTANCE hInstance,
                    HINSTANCE hPrevInstance,
                    LPTSTR    lpCmdLine,
                    int      nCmdShow)
{
    RegFlushKey( HKEY_LOCAL_MACHINE);

RegFlushKey( HKEY_CLASSES_ROOT);

RegFlushKey( HKEY_CURRENT_USER);

RegFlushKey( HKEY_USERS);


    return 0;
}




方法二 : ( 自动保存信息到 HIVE Registry)
2. 修改注册表
platform.reg 文件中添加如下内容 :
; @CESYSGEN IF FILESYS_FSREGHIVE
; HIVE BOOT SECTION

[HKEY_LOCAL_MACHINE/init/BootVars]
"SYSTEMHIVE"="//Registry//system.hv"
"PROFILEDIR"="//Registry"
"Start DevMgr"=dword:1
"RegistryFlags"=dword:1
"DefaultUser"="User"

[HKEY_LOCAL_MACHINE/Drivers/Resources/IRQ]
"Flags"=dword:1000

[HKEY_LOCAL_MACHINE/Drivers/Resources/IO]
"Flags"=dword:1000

[$(PCI_BUS_ROOT)/Template/GenericIDE]
"Flags"=dword:1000

[HKEY_LOCAL_MACHINE/System/StorageManager/FATFS]
"Flags"=dword:1000

[HKEY_LOCAL_MACHINE/System/StorageManager/Profiles/HDProfile]
"MountFlags"=dword:2

[HKEY_LOCAL_MACHINE/Drivers/BuiltIn/PCI/Template/PCI-PCI-BRIDGE]
"Class"=dword:06
"SubClass"=dword:04
"NoConfig"=dword:1

; END HIVE BOOT SECTION
; @CESYSGEN ENDIF FILESYS_FSREGHIVE
3. 编译 image
http://blog.chinaunix.net/u1/57862/showart_1089425.html

你可能感兴趣的:(如何使用HIVE-based Registry)