Hive-Based Registry使用

        对于Hive干什么用这里就不多介绍了,根据文档的介绍,Hive形式的注册表分为:Boot hive,System hv和User hive三种。Boot hive就是指那部分在Boot过程中需要使用到的注册表信息,这部分是实在没办法放在System hive中了,所以就把它们单独放在Boot hive中了。System hive是不用放在Boot中的和系统相关的注册表信息,而User hive则是用户相关的注册表信息了。下面就看看这三个部分的具体内容:

1.Boot hive ,原文是这样介绍的:

      The boot hive contains system settings that are applied only during boot. The boot hive is read out of ROM and used to start drivers and file systems needed to reach the system hive file. Once the system hive is mounted, the boot hive is discarded. Changes made to the registry during the boot process are copied into the system hive once it is available. The boot hive in ROM remains unchanged.

       从这段介绍中可以理解Boot中的信息是用来在后面获得System hive而在Boot阶段所必需包括的注册表信息。因此Boot hive中的内容只要能让后面获得System hive成为可能就可以了。

2.System hive,原文如下:

       The system hive contains system settings that do not pertain to any one user. The OEM selects the system hive file name and location. The system hive file is typically named System.hv, but the location can vary.

The registry value SystemHive under HKEY_LOCAL_MACHINE\init\BootVars indicates the path and file name of the system hive.

       从中可以看出System和用户无关,由OEM来选择System hive的文件名与位置,默认的System hive会被命名为System.hv,但位置不固定。在HKEY_LOCAL_MACHINE\init\BootVars 键下的值SystemHive 指定System hive的名字和路径。

3.User hive,原文如下:

       A user hive contains user-specific settings. All user hives are named User.hv and are located inside separate user directories. Each directory is given the name of the user to which it belongs.

The registry value ProfileDir under HKEY_LOCAL_MACHINE\init\BootVars indicates the location where all user directories are placed.

       User hive包括了和用户相关的注册表信息。所有的User hive都是一样的名字:User.hv。但是放在不同的用户目录下,例如有两个用户的目录A,B,两个目录里的User hive都叫做User.hv。但是一个是A/User.hv。另一个是B/User.hv。同System hive类似,在HKEY_LOCAL_MACHINE\init\BootVars 下的ProfileDir 指定了所有用户目录存放的路径。

       有了以上的信息,下面来看如何使能Hive Registry。

1.在PB中把Hive-based Registry Catalog item加进来。

2.添加注册表[HKEY_LOCAL_MACHINE\init\BootVars]下的内容:
    "SystemHive"="<your system hive location>"

    "ProfileDir"="<your user hive location>"

    "DefaultUser"="<username>"
    "Flags"=dword:<your value>

3.把在Boot阶段所需要的注册表信息封装在所示的注释中

   ; HIVE BOOT SECTION
   <your registry settings>
   ; END HIVE BOOT SECTION
4.在存放System hive的分区,要做相应的设置,在CE5.0之后的要设MountAsBootable = dword:1.对于早期的版本,则需要设置MountFlags =dword :2

分区路径为[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\<MyProfile>\<MyFileSystem>]
5.如果希望在每次修改后自动保存,那么在[HKEY_LOCAL_MACHINE\init\BootVars]下设置                             "RegistryFlags"=dword:1

       以上都是根据PB的帮助文档和别人的Blog获得的信息,能不能使用起来我还没有验证过。不过应该差不多了,最后说一下自己的一点理解,也算一个例子吧。例如我们的系统使用BINFS和FATFS,System.hv存放在FAT上面,那么在Boot Hive中需要把BINFS和FATFS都使能起来,不然在后面的加载过程中得不到System.hv的话其他驱动就没法加载了。只有在Boot Hive中把BINFS和FATFS都使能起来,这样才能在FAT分区中获得System.hv这样才能保证后面的驱动正常的加载。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值