博客网 >

What Happens to File Systems During System Boot

From:IFS DDK

File systems are initialized during the system boot process; specifically, during I/O system initialization. The I/O Manager creates the global file system queue and initializes the file system and filter drivers that were loaded by the operating system (OS) loader and the PnP Manager.

Following is a summary of selected portions of the system boot process that are of interest to file system and filter driver developers.

  1. During system boot, the OS loader loads the boot file system, the RAW file system, and all drivers of type SERVICE_BOOT_START before the loader transfers control to the kernel. These drivers are in memory when the kernel gets control.

    Drivers are loaded in order of the load order groups to which they are assigned. Among file system filters, those that are assigned to one of the new file system filter driver load order groups are loaded before all other filter drivers. These load order groups are described in detail in File System Filter Driver Load Order Groups.

    Then all drivers in the "filter" load order group are loaded. Note that the "filter" group includes storage filter drivers as well as file system filter drivers, and it includes third-party as well as built-in filter drivers.

  2. The I/O Manager creates a global file system queue with four segments: one each for CD-ROM, disk, tape, and network file systems. Later, when each file system is registered, its control device objects are added to the appropriate segments of this queue. At this point, however, no file systems have yet been registered, so the queue is empty.
  3. The PnP Manager calls the DriverEntry routines of the RAW file system and all SERVICE_BOOT_START drivers.

    If a SERVICE_BOOT_START driver is dependent on other drivers, those drivers are loaded and started as well.

    The PnP Manager starts the boot devices by calling the AddDevice routines of the boot device drivers. If a boot device has child devices, those devices are enumerated. The child devices are also configured and started if their drivers are boot-start drivers. If a device's drivers are not all boot-start drivers, the PnP Manager creates a devnode for the device but does not start the device.

    At this point, all boot drivers are loaded and the boot devices are started.

  4. The PnP Manager traverses the PnP device tree, locating and loading the drivers that are associated with each devnode but not already running. (For more information about the PnP device tree, see Device Tree in the DDK Kernel-Mode Driver Design Guide.) When each PnP device starts, the PnP Manager enumerates the children of the device, if any. The PnP Manager configures the child devices, loads their device drivers, and starts the devices.

    The PnP Manager loads each device's drivers regardless of the drivers' StartType, LoadOrderGroup, or Dependencies values.

    In this step, the PnP Manager only configures and starts devices that are PnP-enumerable. If a device is not PnP-enumerable, the PnP Manager ignores the device and does not enumerate its children, even if the child devices are PnP-enumerable.

  5. The PnP Manager loads and initializes drivers of type SERVICE_SYSTEM_START that are not yet loaded.

    The file system recognizer (FsRec) is loaded at this time. Note that, although it is in the "Boot File System" load order group, FsRec is not the boot file system. The actual boot file system – that is, the file system that mounted the boot volume – is loaded at the start of the boot process.

    Later in the SERVICE_SYSTEM_START phase, file systems in the "File System" load order group are loaded. This includes the Named Pipe File System (NPFS) and Mailslot File System (MSFS). It does not include media-based file systems, such as NTFS, FAT, CDFS, or UDFS.

    Network file systems, which are in the "Network" load order group, are also loaded during this phase.

  6. After all drivers that load at boot time have been initialized, the I/O Manager calls the reinitialization routines of any drivers that have them. A reinitialization routine is a callback routine that is registered by a boot driver that needs to be given additional processing time at this point in the boot process. Reinitialization routines are registered by calling IoRegisterBootDriverReinitialization or IoRegisterDriverReinitialization.
  7. The Service Control Manager loads drivers of type SERVICE_AUTO_START that are not already loaded.

File System Recognizer

After system boot, the storage device drivers for all volumes attached to the system are loaded and started. However, not all built-in file systems are loaded, and not all file system volumes are mounted. The File System Recognizer (FsRec) performs these tasks as needed to process IRP_MJ_CREATE requests.

FsRec is loaded in the SERVICE_SYSTEM_START phase of system startup. Note that, although it is in the "Boot File System" load order group, FsRec is not the boot file system. The actual boot file system – that is, the file system that mounted the boot volume – is loaded at the start of the boot process.

(Chinese)

What Happens to File Systems During System Boot

 

 

系统引导过程中,文件系统被初始化;特别是在I/O系统初始化过程中。I/O manager建立global file system queue以及初始化被OS loaderPnP Manager加载的文件系统filter driver

 

system (OS) loader and the PnP Manager.

 

Following is a summary of selected portions of the system boot process that are of interest to file system and filter driver developers.

 

1 系统boot过程中,OS loader在其转换 控制 到内核之前加载boot file systemRAW file system、以及所有SERVICE_BOOT_START类型的驱动程序,当内核获得控制权的时候这些driver已在内存当中了。

 

Driver被按照在load order groups中被指定的顺序加载。在文件系统filter中,那些被一个新的文件系统filter driver load order groups指定的filter被先于其他的filter driver加载。关于这些load order groups详细描述,见File System Filter Driver Load Order Groups

 

接下来(then),所有在load order group中指定的filter load 注意:“filter groups还包括storage filter而不仅仅是文件系统filter,而且,还包括第三方的filter driver而不仅仅指buildin(内建)的filter driver

 

2 IO Manager 创建一个有4segment的全局文件系统队列:CD-ROMdisktape以及network file system各一个。以后,当每个文件系统被注册时,他们的Controld device object被添加到相应的队列的segment中。然而,至此,还没有文件系统被注册,所以这个对列是空的。PnP Manager呼叫所有SERVICE_BOOT_START类型driversRAW file systemDriverEntry例程。如果有SERVICE_BOOT_START 类型的driver需要依赖其他的drivers,最好是这些被依赖的drivers已经被加载并启动了。

 

3 PnP manager通过呼叫boot device driverAddDevice例程来启动boot device,如果一个boot device还有子device的话,这些子device会被枚举。假如这些子devicesboot-start类型driver的,他们也会被配置并启动。如果一个设备的驱动程序并不是所有都是boot-start类型的,PnP Manager就会为这个设备创建一个devnode,但并不启动它.

至此,所有的boot driver被加载,boot device被启动。

 

4 PnP manager检查PnP device tree 发现并加载每个与 devnode 相关联但还没有运行的driver,当每个PnP Device启动后,PnP manager枚举该设备的子设备。PnP Manager配置这些子设备,configures the child devices, 加载他们的设备驱动程序,并启动他们。

PnP Manager加载每个设备的驱动程序并不去管这些driverStarttypeloadordergroup或者依赖的values。在这一步骤中,PnP manager只配置和启动能被枚举到的device。如果一个设备不能被枚举,PnP Manager将忽略这些设备而且不会再去枚举他们的子设备,尽管他们的子设备能够被PnP枚举到。

 

5 PnP Manager加载并初始化那些至此还没被加载的SERVICE_SYSTEM_START类型的驱动程序。FsRec就是在此时被加载的。注意,尽管FsRec是在“boot file systemload order group中, FsRec却不是boot file system,实际的引导文件系统是被mountedboot volume的文件系统。该文件系统在引导过程中被加载。

以后,在SERVICE_SYSTEM_START阶段,那些在”file systemload order group中的文件系统被load,他们包括命名管道文件系统(NPFS)和邮槽文件系统(MSFS),但不包括任何介质类型的文件系统,诸如NTFS,FAT,CDFS,UDFS.

网络文件系统处于“netword load order group中,也是在这个阶段被load

 

6 在所有引导时被加载的驱动程序被初始化后,IO Manager呼叫所有driver都拥有的reinitialization 例程。reinitialization 例程是一个被boot driver注册的callback例程,一个需要在引导过程中的这个地方被附加的处理. Reinitialization通过调用 IoRegisterBootDriverReinitialization or IoRegisterDriverReinitialization来注册。

 

7 The service Control Manager加载已经被加载的SERVICE_AUTO_START类型的驱动程序。

 

File System Recognizer(文件系统识别器)

系统引导后,所有被attach到系统的volumestorage device driver被加载并启动,然而,并不是所有的内建的文件系统被加载了,也不是所

有的文件系统volumemounted了。FsRec执行这些任务还需要处理IRP_MJ_CREATE请求。FsRec在系统启动过程中的SERVICE_SYSTEM_START被加

 

载,注意,虽然FsRec是在“Boot File Systemload order group中,然而,FsRec并不是boot File system,实际的boot file system却是

 

在引导过程中被加载的文件系统mountedboot file ststem

<< 关于 IFS 编译 WINVER... / unresolved exter... >>

专题推荐

不平凡的水果世界

不平凡的水果世界

平凡的水果世界,平凡中的不平凡。 今朝看水果是水果 ,看水果还是水果 ,看水果已不是水果。这境界,谁人可比?在不平凡的水果世界里,仁者见仁,智者见智。

中国春节的那些习俗

中国春节的那些习俗

正月是农历新年的开始,人们往往将它看作是新的一年年运好坏的兆示期。所以,过年的时候“禁忌”特别多。当然,各个地方的风俗习惯不一样,过年的禁忌也是不一样的。

评论
0/200
表情 验证码:

magichere

  • 文章总数0
  • 画报总数0
  • 画报点击数0
  • 文章点击数0
个人排行
        博文分类
        日期归档