Chinaunix首页 | 论坛 | 博客
  • 博客访问: 303826
  • 博文数量: 47
  • 博客积分: 2026
  • 博客等级: 大尉
  • 技术积分: 1620
  • 用 户 组: 普通用户
  • 注册时间: 2007-12-25 09:34
文章分类

全部博文(47)

文章存档

2009年(8)

2008年(39)

我的朋友

分类: WINDOWS

2008-07-23 10:15:47

CEHIVE注册表可以使用户操作的相关设置以注册表的形式保存到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
阅读(3538) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~