Early driver initialization

Hello,

we have a driver that needs to be started really early during the boot
process (ideally before any storage controller devices are initialized).
It seemed that setting driver’s load order group to Boot Bus Extender
and placing its tag into begginning of the list does the job pretty
well. At least until recently.

Well, in our company universe, there exist one laptop, running Windows
10 1803, that makes an exception. It seems that the measures described
in the previous paragraph are not enough. So, is it possible to do
anything else to assure our driver will be initialized like one of the
first? Or maybe, there is an UEFI settings forcing Windows to
pre-load/pre-initialize some of its drivers earlier? We actually do not
need to be really the first driver to initialize but we need to be “in
front”.

Does ELAM help in this case? Anyway, I expect it requires some extra
signing compared to regular drivers.

Of course, I can make our driver a lower filter of a device class like
HDC but I would really like to avoid this since it makes the driver
mandatory for successful boot of the machine.

Thank you for any suggestions.

Best regards
Martin

It seemed that setting driver’s load order group to Boot Bus Extender
and placing its tag into beginning of the list does the job pretty
well.

And, of course, setting the driver to “Boot Start”… right?

It seems that the measures described
in the previous paragraph are not enough.

Hmmmm… Are you SURE? What drivers are starting before yours and after yours (a) on systems where it works, (b) on the laptop where it does not work??

Does ELAM help in this case?

Only if you’re actually writing an ELAM product. Otherwise, forget that approach. The blessings necessary from MSFT alone will make it difficult.

Of course, I can make our driver a lower filter of a device class like
HDC but I would really like to avoid this since it makes the driver
mandatory for successful boot of the machine.

What’s an “HDC”? I’ve got an HBA and a USB HCD… But I don’t know what you mean by “HDC”.

But, in any case… NOW you have me intrigued. What type of driver IS this and how are you starting it? If it needs to be a filter, it needs to be a filter. There really isn’t a choice "well, I could be a lower-filter of so-and-so or not.

Peter

And, of course, setting the driver to “Boot Start”… right?

Yes, the driver is a boot-start one (its Start value is set to zero) and it initializes at boot. However, some drivers, not even having their tag in the Boot Bus Extender group (such as partmgr) are already initialized at that time.

I actually think the system respects the load order given by groups and tags only up to some extent. If it realizes that, for example, a driver with tag placed really late in the Boot Bus Extender group needs to be initialized right now because it is registered as a lower filter for a device class needed at boot-time (HDC or SCSIAdpater, DiskDrive etc.), the system just initializes the driver and (temporarily) skips drivers with tags present nearer to the front of the Boot Bus Extender tag list. The only ceriteria here is that that “late” driver is a boot-start one, so its image is mapped to kernel memory.

Hmmmm… Are you SURE? What drivers are starting before yours and after yours (a) on systems
where it works, (b) on the laptop where it does not work??

I will check this more rigorously and get back here with precise information.

Only if you’re actually writing an ELAM product. Otherwise, forget that approach. The blessings
necessary from MSFT alone will make it difficult.

Thank you for clarifying this. I expeted something like that.

What’s an “HDC”? I’ve got an HBA and a USB HCD… But I don’t know what you mean by “HDC”.

HDC = Hard Disk Controller. It is a device setup class, probably similar to SCSIAdapter. Usually, a device belonging to this class has disk drives and CDROMs within its bus relations.

Like I said, I’m still confused as to what type of driver you’re trying to write.

And I’m not sure how you can be a lower filter of the disk controller. I don’t think you’d ever see any IRPs.

Peter

I am sorry for the late response. After the mailing lists were moved, e-mail notifications somehow stopped working for me at all.

I actually managed to solve my problem with early driver initialization. It seems that export drivers are initialized early enough if another driver depends on them. And an export driver is enough for me at that early time (I do not need a driver object there).

I am sorry for the late response

Well, we’re glad you’re back.

Peter