Enabling kernel debugging during installation on NT6.x

Hi,

I’m debugging some issues during Win2012 DVD installation where I need to
enable KD on the very first Windows reboot after DVD install done. The
first boot fails so installation doesn’t complete and I can’t run bcdedit.
I have to watch it boots, then press F8 or F10 at the right time to enable
KD.

In the past (NT 5.x), I can modify some text files on a install image and
burn a hacked install CD to debug the entire installation process. How
would one accomplish the same goal on NT6x?

Thanks,
Calvin

Hi,

Check if the oscdimg command of the automatic deployment kit would do the job.

“Create a boot order file”-section at
http://technet.microsoft.com/en-us/library/dd799243(v=WS.10).aspx
states how the bcd-database is included into the final DVD-image.

It might be possible to pre-configure the bcd-database offline before running oscdimg (or the Windows8.1-replacement for oscdimg).

/Andreas Nilsson

Calvin,
I enabled kernel debugging in Win 7 for EFI boot installation. I think a procedure for legacy boot would be similar.
I extracted efi/boot/microsoft/bcd file from a CD installation image and modified the file enabling the kernel debugging. I modified the bcd file by using Visual BCD utility, which i found is more convenient than bcdedit. In the BcdStore/Loaders/WindowsSetup/ you need to switch KernelDebuggerEnable to TRUE. Also check Setting/{dbgsettings}. I must be set up to serial debugging. After that you need to create a new installation image.

Igor Sharovar

Andreas and Igot, thanks for your reply. I will try that out.

Igor,

You seemed to imply that it has to be serial? Did you try1394 for DVD
installation? I’m asking because some of OEM rack mount servers have very
unstable com port with respect to kd. Once it broke, I have to physically
yank the power core and plug it back on to recover. Power cycling from iLO
doesn’t help. Problem is I don’t always have physical access to those
servers.

Ideally, I would also want to debug interactions with bootmgr and winload
on legacy BIOS systems during DVD install. If that’s impossible with 1394
(I highly doubt if it’s even possible with bootmgr on BIOS system), I want
to be at least able to debug in ntos environment with 1394 on those OEM
rack mounts.

Once I get it done, I will post here.

Thanks,
Calvin

On Fri, Feb 7, 2014 at 12:27 PM, wrote:

> Calvin,
> I enabled kernel debugging in Win 7 for EFI boot installation. I think a
> procedure for legacy boot would be similar.
> I extracted efi/boot/microsoft/bcd file from a CD installation image and
> modified the file enabling the kernel debugging. I modified the bcd file by
> using Visual BCD utility, which i found is more convenient than bcdedit. In
> the BcdStore/Loaders/WindowsSetup/ you need to switch KernelDebuggerEnable
> to TRUE. Also check Setting/{dbgsettings}. I must be set up to serial
> debugging. After that you need to create a new installation image.
>
> Igor Sharovar
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
>
> OSR is HIRING!! See http://www.osr.com/careers
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

I think setup.exe has command line parameters to enable kernel debugging. Run setup.exe /?

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Calvin Guan
Sent: Thursday, February 6, 2014 12:37 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Enabling kernel debugging during installation on NT6.x

Hi,

I’m debugging some issues during Win2012 DVD installation where I need to enable KD on the very first Windows reboot after DVD install done. The first boot fails so installation doesn’t complete and I can’t run bcdedit. I have to watch it boots, then press F8 or F10 at the right time to enable KD.

In the past (NT 5.x), I can modify some text files on a install image and burn a hacked install CD to debug the entire installation process. How would one accomplish the same goal on NT6x?

Thanks,
Calvin
— NTDEV is sponsored by OSR Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev OSR is HIRING!! See http://www.osr.com/careers For our schedule of WDF, WDM, debugging and other seminars visit: http://www.osr.com/seminars To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Pavel,

You are thinking of
http://technet.microsoft.com/en-us/library/hh824834.aspx You do have to
have a working windows on a disk to run the setup this way.

Don Burn
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Pavel Lebedynskiy
Sent: Saturday, February 08, 2014 7:05 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Enabling kernel debugging during installation on NT6.x

I think setup.exe has command line parameters to enable kernel debugging.
Run setup.exe /?

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Calvin Guan
Sent: Thursday, February 6, 2014 12:37 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Enabling kernel debugging during installation on NT6.x

Hi,

I’m debugging some issues during Win2012 DVD installation where I need to
enable KD on the very first Windows reboot after DVD install done. The
first boot fails so installation doesn’t complete and I can’t run bcdedit. I
have to watch it boots, then press F8 or F10 at the right time to enable KD.

In the past (NT 5.x), I can modify some text files on a install image and
burn a hacked install CD to debug the entire installation process. How would
one accomplish the same goal on NT6x?

Thanks,

Calvin

— NTDEV is sponsored by OSR Visit the list at:
http://www.osronline.com/showlists.cfm?list=ntdev
http: OSR is HIRING!! See
http://www.osr.com/careers http: For our schedule of
WDF, WDM, debugging and other seminars visit: http://www.osr.com/seminars To
unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

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

>Igor, You seemed to imply that it has to be serial? Did you try1394 for DVD installation?

Calvin,
It was two years ago and I don’t remember all details. I only remember that 1394 didn’t work for me.
But the serial worked fine and helped me a lot.
Igor Sharovar

Igor’s suggestion of modifying the BCD store offline is very helpful. The
only problem is that I can’t seem to convince Visual BCD utility from OSR
to open a BCD store file. I ended up using bcdedit /store c:\whatever_BCD
command to do what I want.

To answer my own questions:

  1. yes, PCAT bootmgr does support 1394 but not KDNET.
  2. bootmgfw.efi supports all transports including KDNET assuming you have
    one of the supported NICs.
  3. both versions of winload support all transports.

After DVD installation, the OS installer doesn’t seem to enable kernel
debugging on the installed backend storage(i.e. an FC target). So if you
need to debug the first boot like I did, you will need to somehow mount the
drive from a running system and extract the BCD and modify it offline and
then copy it back to the backend storage. On a EFI system that have shell
access with advanced commands, one can mount the drive to EFI and access it
provided the pre-OS driver is stable enough to do so.

BCD of an EFI system is on ESP which can’t be accessed by default even you
mounted the backend from a running system. I found the instructions in the
first answer of the post solved the problem.(
http://superuser.com/questions/662823/how-do-i-mount-the-efi-partition-on-windows-8-1-so-that-it-is-readable-and-write
)

Once all is set & done, and if your pre-OS firmware drivers are good enough
to load the BCD and bootmgr, then windbg will handle the rest of it. No
need for an ICE until NTOS got stuck in buggy SMM code like the one I
bumped into -:frowning:

Calvin

On Mon, Feb 10, 2014 at 1:09 PM, wrote:

> >Igor, You seemed to imply that it has to be serial? Did you try1394 for
> DVD installation?
>
> Calvin,
> It was two years ago and I don’t remember all details. I only remember
> that 1394 didn’t work for me.
> But the serial worked fine and helped me a lot.
> Igor Sharovar
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
>
> OSR is HIRING!! See http://www.osr.com/careers
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>