Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Before Posting...
Please check out the Community Guidelines in the Announcements and Administration Category.

Early driver initialization

Martin_DrábMartin_Dráb Member - All Emails Posts: 57
via Email in NTDEV
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

Martin Dráb

Comments

  • Peter_Viscarola_(OSR)Peter_Viscarola_(OSR) Administrator Posts: 7,380

    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

    Peter Viscarola
    OSR
    @OSRDrivers

  • Martin_DrábMartin_Dráb Member - All Emails Posts: 57

    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.

    Martin Dráb

  • Peter_Viscarola_(OSR)Peter_Viscarola_(OSR) Administrator Posts: 7,380

    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

    Peter Viscarola
    OSR
    @OSRDrivers

  • Martin_DrábMartin_Dráb Member - All Emails Posts: 57

    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).

    Martin Dráb

  • Peter_Viscarola_(OSR)Peter_Viscarola_(OSR) Administrator Posts: 7,380

    I am sorry for the late response

    Well, we're glad you're back.

    Peter

    Peter Viscarola
    OSR
    @OSRDrivers

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Upcoming OSR Seminars
Developing Minifilters 29 July 2019 OSR Seminar Space
Writing WDF Drivers 23 Sept 2019 OSR Seminar Space
Kernel Debugging 21 Oct 2019 OSR Seminar Space
Internals & Software Drivers 18 Nov 2019 Dulles, VA