Hive-Based Registry Startup Sequence

本文详细解析了在使用外部文件系统时,操作系统如何处理注册表的加载过程。为了解决启动过程中可能出现的问题,系统采用了一个小型的启动注册表来加载必要的驱动程序,并分为两个阶段加载系统中的驱动程序。第一阶段加载最小集的驱动程序,第二阶段则在完整的注册表可用后加载剩余的驱动程序。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Storing the registry on an external file system complicates the sequence of events that must occur to boot the system. For example, registry settings are needed to start the drivers that control the media on which the registry is stored. The solution is that a small boot registry hive is used to start only the few drivers necessary to reach the working system hive, which is in a persistent store such as a disk or flash chip. The boot hive is stored in ROM and so it does not change from boot to boot. Any changes made to it by drivers during boot will be propagated to the system hive when it becomes available, but on the next boot, the boot registry will revert to its ROM contents.

The loading of drivers in the system was broken into two boot phases. In the first phase, a small set of drivers is loaded, as specified in the boot registry. These are the drivers that are necessary to reach the file system on which the system registry is stored. When the registry is fully available, the second phase begins and another round of driver loading takes place. There are some special cases for drivers that were started in the first boot phase; they must set a particular flag to avoid being loaded a second time during the second boot phase. For more information, see Using the Hive-Based Registry. Also, because those drivers are started with the boot registry, which is in ROM, they are started with settings that will never change. If those drivers need to be configured dynamically, they may wait for the second boot phase and then reread their registry settings, because at that point the mutable system registry is in place.

The file system process (Filesys.exe) brings up the boot registry, starts Device.exe, and blocks waiting for the file system containing the system registry to be ready. The device manager loads a small set of drivers as specified in the boot registry, and then blocks waiting for the system registry to be available. The driver for the file system that contains the system registry must be marked with a bootable flag so that Filesys.exe knows what file system to wait for. When it is ready, the system registry is read from that file system. At this point, the registry is ready to go and applications are started. The second boot phase begins when it becomes time to start Device.exe in the application initialization sequence; because Device.exe is already running, an event named System/BootPhase2 is set to signal the second phase of driver loading. This event causes Device.exe to re-enumerate drivers based on the system registry.

The following illustration shows the startup sequence in detail. The order that processes run in is shown along with the periods of time that drivers are available and which registry hive is loaded at the time.

The following table describes the stages shown in the illustration.

StageDescription
AThe kernel starts Filesys.exe.
BFilesys.exe loads the boot registry.
CFilesys.exe starts the device and blocks.
DThe device starts drivers based on the boot registry.
EThe device blocks and the boot file system is initialized.
FFilesys.exe loads and mounts system registry.
GFilesys.exe ready, kernel initializes using the system registry.
HThe kernel is ready and signals Filesys.exe.
IFilesys.exe starts applications.
JInstead of starting the device, Filesys.exe signals the BootPhase2 event.

Device.exe then re-enumerates, starting drivers. Filesys.exe starts the remaining applications in the initialization key.

repainted from http://msdn.microsoft.com/en-us/library/ms885475.aspx

转载于:https://www.cnblogs.com/frankjobs/archive/2008/07/01/1232903.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值