.kdfiles on Vista

Hi

I have a storage stack driver mapped using a driver replacement map. I can
see debug prints from my driver during the system boot, but the driver is
NOT replaced. If I enable the disabled HBA, that one the driver is intended
for, than the driver is replaced successfully. Any idea how to force the
driver to be replaced during the boot?

TIA
Andrew

.kdfiles only works on drivers that are loaded by the NT storage stack,
after kernel init. Anything loaded by the OS loader, before kernel init,
doesn’t work. This has always been true.

What’s different in Vista is that all storage drivers are always loaded by
the OS loader. This is part of an effort to make sure that any OS image
works on any machine. In previous versions of NT, installation would look
at the machine and set up the registry so that the appropriate drivers load
when the OS boots. This ended up frustrating people who moved a hard disk
(or just an image) from one machine to another, without running a full setup
and installation phase, because the OS might not boot when you changed the
motherboard or the storage device. Vista does on every boot what text-mode
setup did on old versions of NT, choosing the right HAL and storage drivers.
This takes longer to boot, but people seem to like the flexibility.

  • Jake Oshins
    Windows Kernel Team

“Andrew Sha” wrote in message
news:xxxxx@ntdev…
> Hi
>
> I have a storage stack driver mapped using a driver replacement map. I can
> see debug prints from my driver during the system boot, but the driver is
> NOT replaced. If I enable the disabled HBA, that one the driver is
> intended for, than the driver is replaced successfully. Any idea how to
> force the driver to be replaced during the boot?
>
> TIA
> Andrew
>
>
>

Jake

Thank you for your elaboration

So how to debug storage stack drivers? How to replace a storage stack driver that causes the BSOD without going thru Windows Repair mechanism? On XP a special debugger-enabled version of Ntldr needs to be installed to make possible to replace boot drivers and the ntldr_dbg was included in the DDK. So what is the procedure on Vista? It must be a way to replace boot drivers on Vista, people at MS manage to develop/debug storage drivers. Your input would much appreciated.

TIA
Andrew

You can do exactly the same thing, installing a debug copy of the Vista
loader. But what I usually do is put another copy of Windows on a different
partition and boot that when I want to copy new drivers.

  • Jake

wrote in message news:xxxxx@ntdev…
> Jake
>
> Thank you for your elaboration
>
> So how to debug storage stack drivers? How to replace a storage stack
> driver that causes the BSOD without going thru Windows Repair mechanism?
> On XP a special debugger-enabled version of Ntldr needs to be installed to
> make possible to replace boot drivers and the ntldr_dbg was included in
> the DDK. So what is the procedure on Vista? It must be a way to replace
> boot drivers on Vista, people at MS manage to develop/debug storage
> drivers. Your input would much appreciated.
>
> TIA
> Andrew
>
>

>You can do exactly the same thing, installing a debug copy of the Vista loader.

Well, where to get it from and how exactly to install it?

If I remembered that off the top of my head, I would have put it in the
message. Try your favorite search engine.

  • Jake

P.S. To anybody who happens to be reading this thread. I answer questions
in this newsgroup only when I’m very certain that I know the answer and the
answer requires no research. That’s all I have time for.

wrote in message news:xxxxx@ntdev…
> >You can do exactly the same thing, installing a debug copy of the Vista
> >loader.
>
> Well, where to get it from and how exactly to install it?
>

Well, I replaced winload.exe with the one from the checked build…still does not do the trick

Andrew, there is no debug loader in Vista - most of the debugging functionality was integrated directly into winload.exe (chk or fre). Unfortunately, porting of .kdfiles support to the new boot architecture got cut. I can suggest two options for you. First is to install a safe build (which is what folks around here generally do). Second is to change the start type of your driver from boot start to system start. This will cause it to get loaded during kernel initialization, but not by the loader, so you can take advantage of the kernel’s kdfiles support. This will only work if your HBA isn’t controlling the boot device.

Dave

David

Thank you, at least I can stop banging my head against a wall

Andrew

>do). Second is to change the start type of your driver from boot start to
system

start. This will cause it to get loaded during kernel initialization, but not
by the

What is the need in boot loader debugging? Yes, it loads the boot drivers, but
their DriverEntry is called much later by the kernel, and you will have an
initial breakpoint meanwhile.


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

Max, having an initial bp is not good enough. The OP wants to replace an
engineering build of boot driver which prevents the OS from booting.

OP, I feel your pain that not every machine in the QA lab has a
“kdfileable” ntldr for boot driver. And usually those machines don’t
have dual boot. here are my ways to get around the problem:

  1. If the system can still boot without your driver, you can set a BP at
    DriverEntry, then modify the return code to 0xCxxxxxxx so that OS won’t
    load your driver.
  2. Always keep an NT setup CD handy, boot to recovery mode and replace
    the driver. If yours are inbox, you’ll need sfpcopy.

Good luck.

Calvin Guan
NetXtreme NTX Miniport
Broadcom Corporation

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:bounce-279767-
xxxxx@lists.osr.com] On Behalf Of Maxim S. Shatskih
Sent: Friday, March 02, 2007 3:43 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] .kdfiles on Vista

>do). Second is to change the start type of your driver from boot
start
to
system
>start. This will cause it to get loaded during kernel
initialization,
but not
by the

What is the need in boot loader debugging? Yes, it loads the boot
drivers,
but
their DriverEntry is called much later by the kernel, and you will
have an
initial breakpoint meanwhile.


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

The WAIK can be used to create a PE boot CD that will give you access to
NTFS. A good registry editor can eliminate the boot driver or a different
version can be copied to try again.

“Calvin (Hao) Guan” wrote in message
news:xxxxx@ntdev…
Max, having an initial bp is not good enough. The OP wants to replace an
engineering build of boot driver which prevents the OS from booting.

OP, I feel your pain that not every machine in the QA lab has a
“kdfileable” ntldr for boot driver. And usually those machines don’t
have dual boot. here are my ways to get around the problem:

1) If the system can still boot without your driver, you can set a BP at
DriverEntry, then modify the return code to 0xCxxxxxxx so that OS won’t
load your driver.
2) Always keep an NT setup CD handy, boot to recovery mode and replace
the driver. If yours are inbox, you’ll need sfpcopy.

Good luck.

Calvin Guan
NetXtreme NTX Miniport
Broadcom Corporation

> -----Original Message-----
> From: xxxxx@lists.osr.com [mailto:bounce-279767-
> xxxxx@lists.osr.com] On Behalf Of Maxim S. Shatskih
> Sent: Friday, March 02, 2007 3:43 PM
> To: Windows System Software Devs Interest List
> Subject: Re:[ntdev] .kdfiles on Vista
>
> >do). Second is to change the start type of your driver from boot
start
> to
> system
> >start. This will cause it to get loaded during kernel
initialization,
> but not
> by the
>
> What is the need in boot loader debugging? Yes, it loads the boot
drivers,
> but
> their DriverEntry is called much later by the kernel, and you will
have an
> initial breakpoint meanwhile.
>
> –
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer

>1) If the system can still boot without your driver, you can set a BP at

DriverEntry, then modify the return code to 0xCxxxxxxx so that OS won’t
load your driver.

Exactly. The “!dh” command will allow you to find DriverEntry of the offending
driver.


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com