Build: Difference between revisions

No edit summary
No edit summary
 
Line 90: Line 90:
== Debugging ==
== Debugging ==
Kernel debugging can be enabled by editing the <code>C:\boot.ini</code> file in your installed build, and adding <code>/debug /debugport=COM1 /baudrate=115200</code> to the end of a config line.
Kernel debugging can be enabled by editing the <code>C:\boot.ini</code> file in your installed build, and adding <code>/debug /debugport=COM1 /baudrate=115200</code> to the end of a config line.


For example here's a <code>boot.ini</code> with two choices, one with debugging & one without, with this NTLDR will show an OS boot choice menu at startup:<syntaxhighlight lang="ini" line="1">
For example here's a <code>boot.ini</code> with two choices, one with debugging & one without, with this NTLDR will show an OS boot choice menu at startup:<syntaxhighlight lang="ini" line="1">
Line 132: Line 130:


=== Un-filtering kernel messages ===
=== Un-filtering kernel messages ===
Even with a chk build you may notice that the kernel doesn't seem to output much over KD, this seems to be because most of the kernel components use <code>KdPrintEx</code>, which allows filtering KD messages to certain components (although MS's docs seem to suggest KdPrintEx filtering was only used in Vista, it does seem that 2003 makes use of it too)
Even with a chk build you may notice that the kernel doesn't seem to output much over KD, this seems to be because most of the kernel components use <code>KdPrintEx</code>, which allows filtering KD messages to certain components (although MS's docs seem to suggest <code>KdPrintEx</code> filtering was only used in Vista, it does seem that 2003 makes use of it too).
 
 


To enable components you'll need to open the registry of your installed build to the following key (or create it if it doesn't exist)<syntaxhighlight lang="registry">
To enable components you'll need to open the registry of your installed build to the following key (or create it if it doesn't exist)<syntaxhighlight lang="registry">
Line 140: Line 136:
</syntaxhighlight>Then create a DWORD value named the component you want to enable (e.g. <code>LDR</code>), and set the value to hexadecimal <code>FFFFFFFF</code>.
</syntaxhighlight>Then create a DWORD value named the component you want to enable (e.g. <code>LDR</code>), and set the value to hexadecimal <code>FFFFFFFF</code>.


A list of the component registry names can be found inside <code>base\published\obj\i386\dpfiltercm.c</code> after a build. This also contains the symbol names for the component (eg. <code>Kd_LDR_Mask</code>), which can be set directly through WinDbg/KD via the symbol name. (eg. <code>ed nt!Kd_LDR_Mask 0xFFFFFFFF</code>, with symbols loaded this should set the LDR components filter value in real-time)
A list of the component registry names can be found inside <code>base\published\obj\i386\dpfiltercm.c</code> after a build. This also contains the symbol names for the component (e.g. <code>Kd_LDR_Mask</code>), which can be set directly through WinDbg/KD via the symbol name. (eg. <code>ed nt!Kd_LDR_Mask 0xFFFFFFFF</code>, with symbols loaded this should set the LDR components filter value in real-time)


The <code>WIN2000</code> components value (default <code>1</code>) is added to every components value, essentially making <code>WIN2000</code> the default value for all components - so setting this to <code>FFFFFFFF</code> should make every component print to KD. You'll get a ton more debug output from this, but all the KD prints will likely slow down the system a lot (unfortunately it doesn't seem possible to disable a component when using WIN2000 to enable them all)
The <code>WIN2000</code> components value (default <code>1</code>) is added to every components value, essentially making <code>WIN2000</code> the default value for all components - so setting this to <code>FFFFFFFF</code> should make every component print to KD. You'll get a ton more debug output from this, but all the KD prints will likely slow down the system a lot (unfortunately it doesn't seem possible to disable a component when using WIN2000 to enable them all)