<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>driver writing != bus driving : windbg</title><link>http://blogs.msdn.com/iliast/archive/tags/windbg/default.aspx</link><description>Tags: windbg</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>KMDF Debugging Videos</title><link>http://blogs.msdn.com/iliast/archive/2009/09/22/kmdf-debugging-videos.aspx</link><pubDate>Tue, 22 Sep 2009 22:29:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9898152</guid><dc:creator>iliast</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/iliast/comments/9898152.aspx</comments><wfw:commentRss>http://blogs.msdn.com/iliast/commentrss.aspx?PostID=9898152</wfw:commentRss><wfw:comment>http://blogs.msdn.com/iliast/rsscomments.aspx?PostID=9898152</wfw:comment><description>&lt;P&gt;A while ago, I wrote a &lt;A class="" href="http://blogs.msdn.com/iliast/archive/2009/06/09/umdf-debugging-videos.aspx" mce_href="http://blogs.msdn.com/iliast/archive/2009/06/09/umdf-debugging-videos.aspx"&gt;blog post&lt;/A&gt; about our &lt;A class="" href="http://www.microsoft.com/whdc/devtools/debugging/umdftraining.mspx" mce_href="http://www.microsoft.com/whdc/devtools/debugging/umdftraining.mspx"&gt;UMDF debugging videos&lt;/A&gt;, which were created by my teammate Abhishek.&lt;/P&gt;
&lt;P&gt;Now, I'm really excited to announce that we've released KMDF debugging videos, which can be found at &lt;A class="" href="http://www.microsoft.com/whdc/devtools/debugging/kmdf.mspx" mce_href="http://www.microsoft.com/whdc/devtools/debugging/kmdf.mspx"&gt;http://www.microsoft.com/whdc/devtools/debugging/kmdf.mspx&lt;/A&gt;. These videos were created by my teammate Kumar. They present 3 important aspects of KMDF debugging:&lt;/P&gt;
&lt;P&gt;1) &lt;A class="" href="http://www.microsoft.com/whdc/media/WinLogo/Debugging-KMDF-Drivers-Part-1.wvx" mce_href="http://www.microsoft.com/whdc/media/WinLogo/Debugging-KMDF-Drivers-Part-1.wvx"&gt;How to debug the KMDF log&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;2) &lt;A class="" href="http://www.microsoft.com/whdc/media/WinLogo/Debugging-KMDF-Drivers-Part-2.wvx" mce_href="http://www.microsoft.com/whdc/media/WinLogo/Debugging-KMDF-Drivers-Part-2.wvx"&gt;How to get information about a driver and its objects&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;3) &lt;A class="" href="http://www.microsoft.com/whdc/media/WinLogo/Debugging-KMDF-Drivers-Part-3.wvx" mce_href="http://www.microsoft.com/whdc/media/WinLogo/Debugging-KMDF-Drivers-Part-3.wvx"&gt;How to dump all the devices and queues&lt;/A&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9898152" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/iliast/archive/tags/UMDF/default.aspx">UMDF</category><category domain="http://blogs.msdn.com/iliast/archive/tags/KMDF/default.aspx">KMDF</category><category domain="http://blogs.msdn.com/iliast/archive/tags/Debugging/default.aspx">Debugging</category><category domain="http://blogs.msdn.com/iliast/archive/tags/windbg/default.aspx">windbg</category><category domain="http://blogs.msdn.com/iliast/archive/tags/WDF/default.aspx">WDF</category></item><item><title>UMDF Debugging Videos</title><link>http://blogs.msdn.com/iliast/archive/2009/06/09/umdf-debugging-videos.aspx</link><pubDate>Wed, 10 Jun 2009 04:29:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9720591</guid><dc:creator>iliast</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/iliast/comments/9720591.aspx</comments><wfw:commentRss>http://blogs.msdn.com/iliast/commentrss.aspx?PostID=9720591</wfw:commentRss><wfw:comment>http://blogs.msdn.com/iliast/rsscomments.aspx?PostID=9720591</wfw:comment><description>&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;UPDATE:&lt;/U&gt;&lt;/STRONG&gt;&amp;nbsp;You can find my post about KMDF debugging videos at &lt;A href="http://blogs.msdn.com/iliast/archive/2009/09/22/kmdf-debugging-videos.aspx"&gt;http://blogs.msdn.com/iliast/archive/2009/09/22/kmdf-debugging-videos.aspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;A while back I had written that we didn't have any videos, where we talk about UMDF (KMDF seems to get all the glory :P). Well, now we do!&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;My teammate, Abhishek, has created a series of tutorials that describe how to debug UMDF drivers. They can be found at &lt;A href="http://www.microsoft.com/whdc/devtools/debugging/umdftraining.mspx" mce_href="http://www.microsoft.com/whdc/devtools/debugging/umdftraining.mspx"&gt;http://www.microsoft.com/whdc/devtools/debugging/umdftraining.mspx&lt;/A&gt;. I've been through all the videos a few times and I think that they are very helpful and present some very nice tricks. I suggest that you install a UMDF driver and go through the same tasks that Abhishek is describing, in order to understand the tutorials better.&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;Feel free to give me any feedback (or any thank-you comments) that you want me to tell Abhishek :)&lt;BR&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9720591" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/iliast/archive/tags/UMDF/default.aspx">UMDF</category><category domain="http://blogs.msdn.com/iliast/archive/tags/Debugging/default.aspx">Debugging</category><category domain="http://blogs.msdn.com/iliast/archive/tags/windbg/default.aspx">windbg</category></item><item><title>Viewing WDF Logs In Windbg</title><link>http://blogs.msdn.com/iliast/archive/2009/06/09/viewing-wdf-logs-in-windbg.aspx</link><pubDate>Wed, 10 Jun 2009 03:44:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9720172</guid><dc:creator>iliast</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/iliast/comments/9720172.aspx</comments><wfw:commentRss>http://blogs.msdn.com/iliast/commentrss.aspx?PostID=9720172</wfw:commentRss><wfw:comment>http://blogs.msdn.com/iliast/rsscomments.aspx?PostID=9720172</wfw:comment><description>&lt;p&gt;One feature that is really helpful in debugging WDF drivers is the log file that is created by the frameworks themselves. In the log files you can see many warnings and errors that are created &lt;u&gt;by the framework&lt;/u&gt; (i.e. they come for free and the driver does not have to do anything). Did you ever have a problem trying to understand why a call to a WDF function fails or what the framework is doing under the hood? Then, continue reading:&lt;/p&gt;&lt;p&gt;In this post I'll explain how to look at the framework log files, while you're debugging a driver using windbg. I assume that you have already installed the WDK in the directory %winddk%.&lt;br&gt;&lt;/p&gt;&lt;p&gt;So, let's start with UMDF:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;You need to debug the wudfhost application that hosts your driver. This is described in an &lt;a href="http://blogs.msdn.com/iliast/archive/2008/02/01/debugging-user-mode-processes-using-a-kernel-mode-debugger.aspx" mce_href="http://blogs.msdn.com/iliast/archive/2008/02/01/debugging-user-mode-processes-using-a-kernel-mode-debugger.aspx"&gt;earlier post of mine&lt;/a&gt;.&amp;nbsp;&lt;/li&gt;&lt;li&gt;In windbg execute the command "!wmitrace.searchpath %winddk%\tools\tracing\%arch%", e.g. "&lt;b&gt;!wmitrace.searchpath c:\WinDDK\6001\tools\tracing\x86&lt;/b&gt;". The directory that you use should have files with names wdf01007.tmf, wdf01009.tmf, etc.&lt;/li&gt;&lt;li&gt;Execute the command "&lt;b&gt;!wmitrace.strdump&lt;/b&gt;" and find the number that corresponds to "WUDF Trace". Let's say that this number is 0x11.&lt;/li&gt;&lt;li&gt;Execute the command "!wmitrace.logdump number_from_previous_step", e.g. "&lt;b&gt;!wmitrace.logdump 0x11&lt;/b&gt;"&lt;/li&gt;&lt;li&gt;In order to control the verbosity of the output, you can use WdfVerifier, which can be found at %winddk%\tools\wdf\%arch%\wdfverifier.exe. Select the tab "User Mode Driver Settings" and change the tracing level. Also, enable the option "Send Log Output to Kernel Debugger". These options are global (i.e. they will be applied to all UMDF drivers)&lt;br&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;For KMDF, things are easier:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Load wdfkd in windbg. This file is located at %winddk%\bin\%arch%. In order to load it execute "!load %winddk%\bin\%arch%\wdfkd.dll", e.g. "&lt;b&gt;!load c:\WinDDK\6001\bin\x86\wdfkd.dll&lt;/b&gt;"&lt;br&gt;&lt;/li&gt;&lt;li&gt;Execute "!wdftmffile %winddk%\tools\tracing\&amp;lt;arch&amp;gt;\wdf01009.tmf", e.g. "&lt;b&gt;!wdftmffile c:\WinDDK\tools\tracing\x86\wdf01009.tmf&lt;/b&gt;". Make sure that the file wdf01009.tmf is in that directory. If you are debugging a KMDF 1.7 driver, then you need to use the file wdf01007.tmf, etc.&lt;/li&gt;&lt;li&gt;Execute "!wdflogdump my_driver" to see the log for your driver. For example, if you are debugging the echo driver, execute "&lt;b&gt;!wdflogdump echo&lt;/b&gt;".&lt;/li&gt;&lt;li&gt;In order to control the verbosity, you can use WdfVerifier. Select the "Kernel Mode User Driver Settings" tab, select your driver in the left panel and then either select or de-select the option "Enable verbose logging". This option is per-driver, i.e. if you want to enable verbose logging for multiple drivers, then you need to select all of them in the left panel.&lt;br&gt;&lt;br&gt;&lt;/li&gt;&lt;/ol&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9720172" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/iliast/archive/tags/UMDF/default.aspx">UMDF</category><category domain="http://blogs.msdn.com/iliast/archive/tags/KMDF/default.aspx">KMDF</category><category domain="http://blogs.msdn.com/iliast/archive/tags/Debugging/default.aspx">Debugging</category><category domain="http://blogs.msdn.com/iliast/archive/tags/windbg/default.aspx">windbg</category><category domain="http://blogs.msdn.com/iliast/archive/tags/WDF/default.aspx">WDF</category></item><item><title>Channel9 Video on Debugging BSODs</title><link>http://blogs.msdn.com/iliast/archive/2008/09/14/channel9-video-on-debugging-bsods.aspx</link><pubDate>Sun, 14 Sep 2008 22:33:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8951853</guid><dc:creator>iliast</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/iliast/comments/8951853.aspx</comments><wfw:commentRss>http://blogs.msdn.com/iliast/commentrss.aspx?PostID=8951853</wfw:commentRss><wfw:comment>http://blogs.msdn.com/iliast/rsscomments.aspx?PostID=8951853</wfw:comment><description>&lt;p&gt;I found a very interesting channel9 video on how to debug BSODs (Blue Screens of Death): &lt;a href="http://channel9.msdn.com/posts/Dan/Daniel-Pearson-Debugging-a-Windows-Blue-Screen-of-Death/" mce_href="http://channel9.msdn.com/posts/Dan/Daniel-Pearson-Debugging-a-Windows-Blue-Screen-of-Death/"&gt;http://channel9.msdn.com/posts/Dan/Daniel-Pearson-Debugging-a-Windows-Blue-Screen-of-Death/&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Daniel Pearson explains why blue screens happen in Windows, how a user can find the cause and how Driver Verifier works. Also, in the end he talks a little bit about how to debug applications and he shows a neat trick with notepad :)&lt;br&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8951853" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/iliast/archive/tags/Debugging/default.aspx">Debugging</category><category domain="http://blogs.msdn.com/iliast/archive/tags/windbg/default.aspx">windbg</category><category domain="http://blogs.msdn.com/iliast/archive/tags/Drivers+_2800_General_2900_/default.aspx">Drivers (General)</category></item><item><title>Crash Dump Analysis</title><link>http://blogs.msdn.com/iliast/archive/2006/12/11/crash-dump-analysis.aspx</link><pubDate>Tue, 12 Dec 2006 05:43:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1264335</guid><dc:creator>iliast</dc:creator><slash:comments>18</slash:comments><comments>http://blogs.msdn.com/iliast/comments/1264335.aspx</comments><wfw:commentRss>http://blogs.msdn.com/iliast/commentrss.aspx?PostID=1264335</wfw:commentRss><wfw:comment>http://blogs.msdn.com/iliast/rsscomments.aspx?PostID=1264335</wfw:comment><description>&lt;P&gt;I'm sure that many of you have had the unfortunate experience of watching the windows Blue Screen Of Death (BSOD) while working, and possibly have lost important data. A common reaction in this case is to blame Microsoft and continue working after the following reboot, as if nothing had happened. Another unfortunate experience is to see an application crash, while using it. In this case, there is a window that comes up, asking you, if you want to send the data to Microsoft for analysis (the same window also comes up after the BSOD). Many people might be afraid of the contents of the data that is sent to the network, so they select "No". The goal of this post is to help you understand what is going on in the background in each of the two cases and also to help clarify some misconceptions.&lt;/P&gt;
&lt;P&gt;&lt;B&gt;QUESTION 1: What causes all these reboots?&lt;/B&gt; &lt;BR&gt;&lt;/P&gt;
&lt;P&gt;First of all, because of the architecture of the windows kernel in the NT/2000/XP/Vista series, an application cannot corrupt data that belongs to another application or to the kernel. This means that each application is totally isolated and cannot harm the system. The worst thing that can happen is that the application does something invalid and crashes without any further implications for the rest of the system. On the other hand, the windows kernel and the device drivers have unlimited access to the system. If the kernel or a driver misbehaves, then it can corrupt the whole system. The immediate result of this, is that the reason for all the blue screens lies either in the windows kernel or in the windows device drivers. That's why, whenever an application crashes, the system keeps working without a problem, whereas if there is a bug in the kernel or in a device driver, the whole system goes down.&lt;/P&gt;
&lt;P&gt;Now that we've identified the possible causes of the crashes, it's time to go even further. According to the reports that were sent to Microsoft until April 2004 (from all those people, who pressed "Yes", when they were asked to send the data to Microsoft) the reasons for the crashes can be split as follows:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Third-party device drivers: 70%&lt;/LI&gt;
&lt;LI&gt;Unknown, because of severe memory corruption: 15%&lt;/LI&gt;
&lt;LI&gt;Hardware error: 10%&lt;/LI&gt;
&lt;LI&gt;Microsoft code: 5%&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;This shows that Microsoft is not the one to blame. The main cause for these crashes is poorly written third-party (non-Microsoft) device drivers.&lt;/P&gt;
&lt;P&gt;&lt;B&gt;QUESTION 2: Why does the system crash, when there is a kernel-mode error?&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;So, from the above analysis it is obvious that the system can overcome an application crash, however a kernel-mode error causes it to reboot. Why can't the system continue, after finding a kernel-mode error? Actually, what happens is that while kernel-mode code (either a device driver or the windows kernel) is executing, some discrepancy is found. For example, a pointer might be pointing to an invalid address, a data structure might have invalid values, etc. Even though this problem was found, it's possible that the "bad" code that caused this problem might have corrupted more data. For example, it might be possible that basic kernel structures are corrupted. That's why the function KeBugCheckEx is called (inside the kernel, this type of forced crash is called "bugcheck"), in order to write logging information to the page file, paint the blue screen and show some information about the crash in the screen.&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;QUESTION 3: How do we configure, whether we want to send anything to Microsoft?&lt;/B&gt; &lt;BR&gt;&lt;/P&gt;
&lt;P&gt;Even though, it's not well-known to most people, you can configure what will be sent to Microsoft. Somebody might want to report only the crashes that have to do with the operating system (after the BSOD). Somebody else might want to report only the crashes from the applications (either for all of them or only for some particular applications). In order to configure this, you need to go to &lt;/P&gt;
&lt;P&gt;Control Panel | System | Advanced | Error Reporting&lt;/P&gt;
&lt;P&gt;From there you'll be able to select which types of errors you want to report. Actually, even if you select a particular type of error to be reported, Windows will ask you again, after a program that belongs in that category crashes. So, by selecting a category, it doesn't mean that all crashes will be reported automatically.&lt;/P&gt;
&lt;P&gt;&lt;B&gt;QUESTION 4: Exactly what kind of data is sent to Microsoft?&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;Before answering this question, it is useful to understand what information is stored, when the system or an application crashes. Let's talk first about the files that are generated after a system crash. In order to set this, you need to go to&lt;/P&gt;
&lt;P&gt;Control Panel | System | Advanced | Startup and Recovery -&amp;gt; Settings&lt;/P&gt;
&lt;P&gt;In the "System Failure" part you'll be able to configure, if you want to write the crash to the system log, if you want to send an administrative alert and if you want to reboot after the crash. Also, you have the option of creating a memory dump and you can select the directory, in which you want to save it. There are 3 types of memory dumps:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Small memory dump or minidump (64kb for 32-bit systems, 128kb for 64-bit systems): It includes a minimum amount of information about the system before the crash, e.g. the bugcheck code, the loaded drivers, information for the current process and thread, etc.&lt;/LI&gt;
&lt;LI&gt;Kernel memory dump: This includes all the kernel-mode memory that was in physical memory at the time of the crash. There is no default size for this dump, however it should be around 50-100MB for most "normal" systems (with &amp;lt;= 2GB of RAM).&lt;/LI&gt;
&lt;LI&gt;Full memory dump: This includes all the physical memory. The size of the file will be the same as the physical memory of the system.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Here it's worth mentioning that at the time of the crash, the information is written to the pagefile. Therefore, the pagefile must be configured to be larger than the size of the dump. This might be a problem especially in the case of the Full memory dump. In order to set the size of the pagefile, you need to go to &lt;/P&gt;
&lt;P&gt;Control Panel | System | Advanced | Performance Settings -&amp;gt; Advanced | Virtual Memory -&amp;gt; Change&lt;/P&gt;
&lt;P&gt;After the system reboots, the information is copied from the page file to the file that was specified above. The reason that the information is not written directly to that file is that the kernel doesn't know the root of the problem at the time of the crash, so it's trying to use as fewer drivers as possible (the pagefile is already open and in use, so theoritically it's the safest destination).&lt;/P&gt;
&lt;P&gt;On the other hand, in order to configure the data that is stored, when an application crashes, you need to open a command prompt (or go to Start | Run) and execute drwtsn32.exe. This application is called Dr. Watson and there you'll be able to configure the destination file for the dump, as well as the type of the dump. Here the only options are the minidump and the full memory dump. There is also an option to create an old-style NT-compatible full memory dump. In addition, in the textarea "Application Errors" you can look at the application crashes that had been logged in the system. You can select any of them and click "View", if you are interested in looking at exactly what the log file includes.&lt;/P&gt;
&lt;P&gt;So, now it's time to answer the initial question: What exactly is sent to Microsoft? The answer is that regardless of the crash dump file that you have selected, the only thing that is sent to Microsoft is a minidump (both for kernel-mode and user-mode crashes). Of course, it would be impossible to send a 100MB kernel-mode dump or a 1GB full-memory dump, so that's why only the 64kb minidump is sent. Apart from the minidump, the information also includes an XML file with basic information about the version of the operating system and the loaded drivers, which you can look at, when you are prompted to select, if you want to send the data to Microsoft. There is no personal private information or anything like that. In fact, you can open the minidumps and check the included information. I'll also show a way of analyzing the minidumps and looking at the data that Microsoft has access to.&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;QUESTION 5: What does Microsoft do with this information?&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;When the minidump is received by Microsoft, it goes through some preprocessing and is stored in a server. If many minidumps that seem to have the same problem are received, then there is a team that analyzes them and finds the root of the problem. Afterwards, a webpage is created that shows exactly what the cause of the problem is. Most often it points to the driver causing the problem and gives a link to the manufacturer's webpage, so that a new version can be downloaded (if it exists). After the webpage is created, if somebody submits a dump that has the same problem, he is shown the corresponding webpage that will help him find the solution. Therefore, if somebody clicks "Yes", when asked to submit a crash dump he might either find the solution to the problem or help Microsoft find the solution and present it to the users in the future.&lt;/P&gt;
&lt;P&gt;&lt;B&gt;QUESTION 6: How can we analyze a crash dump?&lt;BR&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;Fortunately, there is a tool that can be used to analyze both the user-mode and the kernel-mode crash dumps: windbg. Microsoft has included the dump analysis algorithms in windbg, so in some basic cases it's easy to find the cause of the problem. Of course, there are many causes, in which there are many corrupted data structures and it's impossible to pinpoint the problem automatically. In that case, more advanced manual methods are used by the Online Crash Analysis (OCA) team in Microsoft.&lt;/P&gt;
&lt;P&gt;In order to perform the analysis by yourselves (either because you are unable to submit the data or because there is no answer in Microsoft's website), you need to open windbg, go to "File" | "Open Crash Dump" and select the dump file that you want to analyze. As I wrote in my previous &lt;A href="http://blogs.msdn.com/iliast/archive/2006/12/10/windbg-tutorials.aspx" mce_href="http://blogs.msdn.com/iliast/archive/2006/12/10/windbg-tutorials.aspx"&gt;post&lt;/A&gt; you need to set the path to the symbol files and reload them. If this step is omitted, then it won't be possible to analyze the file.&lt;/P&gt;
&lt;P&gt;The next step is to execute the command (this might take some time):&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;!analyze -v&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;At the top of the output you'll see the bugcheck code, it's description and some additional information (e.g. the address of the invalid memory that was accessed, whether it was a Read or a Write operation, etc). Further down you'll see the call stack of the dump under the title STACK_TEXT. This includes all the functions that were called, when the crash occurred. The function on the top is the most current one (it was called by the function below it, which was called by the function below it, etc), whereas the function at the bottom is the oldest function in the stack. The reason that the system crashed is because one of these functions did something invalid (e.g. passed or received an invalid argument that forced it to perform an invalid operation). Of course it's possible that the data was corrupted by another function that is not in the call stack. Fortunately, windbg has already done an automated analysis and points to the module that most probably caused the crash. You should look at the following fields:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;SYMBOL_NAME: Exactly where the invalid operation was caused (module + function)&lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;MODULE_NAME: The name of the module that caused the crash &lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;IMAGE_NAME: The file, in which the problematic code resides&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;In order to find more information about the problematic code you can execute:&lt;/P&gt;
&lt;P&gt;&lt;B&gt;lm kv m MODULE_NAME*&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;for example, if MODULE_NAME is problematic_driver, you should execute:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;B&gt;lm kv m problematic_driver*&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;lm stands for "list modules", k stands for "kernel modules", v stands for verbose and m stands for "match".&lt;/P&gt;
&lt;P&gt;Another option is to find the problematic file name, from the IMAGE_NAME tag, search it in the hard drive and either look at its properties, in order to identify its manufacturer or search it in the internet. Afterwards, you might need to update the buggy driver.&lt;/P&gt;
&lt;P&gt;Of course, it's possible that windbg's automatic analysis was not able to pinpoint the faulting driver. The reason for that might be that the call stack was corrupted or that some important code or data structure was overwritten or that there was a memory leak, etc. In that case, you might want to proceed into some manual solutions, in order to detect the problem. From this point there is no automated way to proceed, so I can just provide a few useful commands that might help you find more information about your system.&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;First you can execute&lt;/P&gt;
&lt;P&gt;&lt;B&gt;!process 0 0&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;&lt;B&gt;!process&lt;/B&gt; &lt;BR&gt;&lt;/P&gt;
&lt;P&gt;The first command prints information about all the running processes. this way you might be able to find a suspicious process. The second command shows information about the current process. If you execute&lt;/P&gt;
&lt;P&gt;&lt;B&gt;!process &amp;lt;process_address&amp;gt;&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;then you'll see more information about the particular process. You can find the addresses of the processes from the "!process 0 0" command. The process information includes information about its threads. You can find more information about each thread by executing&lt;/P&gt;
&lt;P&gt;&lt;B&gt;!thread &amp;lt;thread_address&amp;gt;&lt;/B&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and if the thread belongs to a driver with pending IRPs, then you can find more information about them by executing&lt;/P&gt;
&lt;P&gt;&lt;B&gt;!irp &amp;lt;irp_address&amp;gt;&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;Also, as&amp;nbsp; I wrote above, in order to see all the loaded modules you can try&lt;/P&gt;
&lt;P&gt;&lt;B&gt;lm kv&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;In order to find more information about the used memory (and possibly detect memory leaks), you can execute:&lt;/P&gt;
&lt;P&gt;&lt;B&gt;!vm &lt;/B&gt;and &lt;B&gt;!memusage&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;Finally, it's possible that the system hangs and does not crash. In order to debug it, you need to force a crash. The only way to do that is to go to the registry key HKLM\System\CurrentControlSet\Services\i8042prt\Parameters\CrashOnCtrlScroll and set it to 1. This works only for PS2 keyboards (not for USB). When the system hangs, you can keep the right control key pressed and press the scroll lock key twice. This will cause a crash, which you will be able to debug using windbg.&lt;/P&gt;
&lt;P&gt;A useful command in that case is:&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;!locks&lt;/B&gt; (prints the locks, which are currently held, provided that there is at least one additional thread waiting on them).&amp;nbsp; &lt;BR&gt;&lt;/P&gt;
&lt;P&gt;Another tool that can help you, if !analyze cannot find the root case is the Driver Verifier. This tool enables additional system checks, that will make it possible for the system to crash immediately, when a driver does something invalid, without allowing it to corrupt more data. This way, the crash dump will point directly to the driver. In order to execute it, you need to open a command prompt with administrative privileges (or from Start | Run) and execute "verifier.exe".&lt;/P&gt;
&lt;P&gt;There are some small differences between the User Interface in Windows 2000, Windows XP and Vista, so I'll explain the Windows XP interface. What you'll see is a window and some tasks that you're called to select. You need to select the task "Create custom settings (for code developers)", and then "Select individual settings from a full list". After that you'll see a screen with the following options:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Special pool: This option forces the memory allocation routines to operate on a special pool. For example, if a driver wants to allocate 100kb, then he is given a pointer that points to 100kb before the end of a free page. The rest of the page is marked with a specific signature. Also, the pages that are before and after this particular page are marked invalid. So, if a driver tries to write something after the end of the allocated space, there will be a page fault and the Driver Verifier will crash the system immediately. If the driver tries to write before the beginning of the allocated space, then after he frees the memory, the Driver Verifier will check the signature of the page, find that it's invalid and crash the system. The crash dump that will be generated from this crash will point directly to the faulting driver.&lt;/LI&gt;
&lt;LI&gt;Pool tracking: Each space allocation is marked with a special tag that is different for each driver. When the driver is unloaded, the Driver Verifier will check for the corresponding tags and if it finds any, then this means that the driver has a memory leak, so the system will crash.&lt;/LI&gt;
&lt;LI&gt;Force IRQL checking: Whenever a driver goes to IRQL at DPC/dispatch level or above, the Driver Verifier will cause all the pageable memory to be paged out to disk. So, if the driver tries to access this memory, then the system will crash with a bugcheck code equal to IRQL_NOT_LESS_OR_EQUAL&lt;/LI&gt;
&lt;LI&gt;I/O verification: All the IRPs are allocated from a special pool. If any of them is completed with an invalid I/O status, then the system crashes.&lt;/LI&gt;
&lt;LI&gt;Enhanced I/O verification (used to be "I/O Verification level 2" in Windows 2000): This includes even deeper tests for the IRPs. The I/O manager checks if the drivers complete asynchronous IRPs complete correctly, if they manage the device stack locations correctly and if they delete the device objects only once.&lt;/LI&gt;
&lt;LI&gt;DMA checking: The I/O manager makes sure that all the drivers configure the DMA operations correctly, otherwise it crashes the system.&lt;/LI&gt;
&lt;LI&gt;Deadlock detection: This option enables deadlock detection. When a deadlock is detected, the system crashes and you can use the &lt;B&gt;!deadlock&lt;/B&gt; command from windbg to find more information about what is causing it.&lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;Low Resources simulation: 7 minutes after the boot completes (so all the drivers have been loaded), the I/O manager starts failing random memory allocations. This way, if a driver doesn't check the status of a memory allocation, the system will crash.&lt;/LI&gt;
&lt;LI&gt;Disk Integrity Verification (only in Windows Server 2003): Windows keeps checksums of written data, so after each read it checks, if the data is still valid. If there is a discrepancy, the system crashes.&lt;/LI&gt;
&lt;LI&gt;SCSI Verification (included automatically, when a SCSI miniport driver is monitored): It includes some additional SCSI-related checks.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;You should select all of the existing options, apart from the "Low Resources Simulation" (because it includes very heavy operations and the system will be really slow). In the next screen, you need to select the drivers that you want to debug. You should start by selecting drivers that you think that are suspicious (either because windbg pointed to them or because the crashes started after you installed them, etc). Reboot and run the system for some time and observe its behaviour. If the system continues crashing, but not because of the drivers that you specified (i.e. the crash dump files are still vague and don't pinpoint to a specific driver), the next step is to select all the unsigned drivers. If you don't see any result, then the next step is to start enabling driver verifier for bigger groups of drivers, until you find the buggy one.&lt;/P&gt;
&lt;P&gt;Another useful tool for debugging memory leaks is poolmon, which is part of the Windows Support Tools and can be found &lt;A href="http://www.microsoft.com/downloads/details.aspx?FamilyId=49AE8576-9BB9-4126-9761-BA8011FABF38&amp;amp;displaylang=en" mce_href="http://www.microsoft.com/downloads/details.aspx?FamilyId=49AE8576-9BB9-4126-9761-BA8011FABF38&amp;amp;displaylang=en"&gt;here&lt;/A&gt; (for Windows XP). This tool displays information about memory allocations (both from paged pool and from non-paged pool), as well as discrepancies between allocations and deallocations. You just execute the tool from a command prompt (there is no User Interface) and select the types of memory pool that you want to look at. If the amount of allocated memory increases constantly, this means that there is a possible memory leak. You can find an overview &lt;A href="http://technet2.microsoft.com/WindowsServer/f/?en/library/0d302498-c947-4655-95af-719ae75acfb51033.mspx" mce_href="http://technet2.microsoft.com/WindowsServer/f/?en/library/0d302498-c947-4655-95af-719ae75acfb51033.mspx"&gt;here&lt;/A&gt; and a more detailed explanation &lt;A href="http://www.osronline.com/ddkx/ddtools/poolmon_7983.htm" mce_href="http://www.osronline.com/ddkx/ddtools/poolmon_7983.htm"&gt;here&lt;/A&gt;.&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;B&gt;ADDITIONAL RESOURCES:&lt;/B&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;This &lt;A href="http://www.networkworld.com/news/2005/041105-windows-crash.html?page=1" mce_href="http://www.networkworld.com/news/2005/041105-windows-crash.html?page=1"&gt;tutorial&lt;/A&gt; provides an introductory overview of the same concepts.&lt;/LI&gt;
&lt;LI&gt;Mark Russinovich presented this &lt;A href="http://www.microsoft.com/events/EventDetails.aspx?CMTYSvcSource=MSCOMMedia&amp;amp;Params=%7eCMTYDataSvcParams%5e%7earg+Name%3d%22ID%22+Value%3d%221032298076%22%2f%5e%7earg+Name%3d%22ProviderID%22+Value%3d%22A6B43178-497C-4225-BA42-DF595171F04C%22%2f%5e%7earg+Name%3d%22lang%22+Value%3d%22en%22%2f%5e%7earg+Name%3d%22cr%22+Value%3d%22US%22%2f%5e%7esParams%5e%7e%2fsParams%5e%7e%2fCMTYDataSvcParams%5e" mce_href="http://www.microsoft.com/events/EventDetails.aspx?CMTYSvcSource=MSCOMMedia&amp;amp;Params=%7eCMTYDataSvcParams%5e%7earg+Name%3d%22ID%22+Value%3d%221032298076%22%2f%5e%7earg+Name%3d%22ProviderID%22+Value%3d%22A6B43178-497C-4225-BA42-DF595171F04C%22%2f%5e%7earg+Name%3d%22lang%22+Value%3d%22en%22%2f%5e%7earg+Name%3d%22cr%22+Value%3d%22US%22%2f%5e%7esParams%5e%7e%2fsParams%5e%7e%2fCMTYDataSvcParams%5e"&gt;video&lt;/A&gt; in TechEd 2006. The corresponding slides are &lt;A href="http://download.microsoft.com/download/0/1/3/01381C25-72DA-4AA9-B792-43E02A243C71/SVR422R_Russinovich.ppt" mce_href="http://download.microsoft.com/download/0/1/3/01381C25-72DA-4AA9-B792-43E02A243C71/SVR422R_Russinovich.ppt"&gt;here&lt;/A&gt;.&lt;/LI&gt;
&lt;LI&gt;OSR has a more advanced &lt;A href="http://www.osronline.com/article.cfm?article=328" mce_href="http://www.osronline.com/article.cfm?article=328"&gt;article&lt;/A&gt; on the next steps that you can follow, in order to analyze more difficult crash dumps.&lt;BR&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1264335" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/iliast/archive/tags/Debugging/default.aspx">Debugging</category><category domain="http://blogs.msdn.com/iliast/archive/tags/windbg/default.aspx">windbg</category><category domain="http://blogs.msdn.com/iliast/archive/tags/Windows/default.aspx">Windows</category></item><item><title>Windbg Tutorials</title><link>http://blogs.msdn.com/iliast/archive/2006/12/10/windbg-tutorials.aspx</link><pubDate>Mon, 11 Dec 2006 10:27:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1258056</guid><dc:creator>iliast</dc:creator><slash:comments>11</slash:comments><comments>http://blogs.msdn.com/iliast/comments/1258056.aspx</comments><wfw:commentRss>http://blogs.msdn.com/iliast/commentrss.aspx?PostID=1258056</wfw:commentRss><wfw:comment>http://blogs.msdn.com/iliast/rsscomments.aspx?PostID=1258056</wfw:comment><description>&lt;p&gt;The debugger is always a very helpful tool for a developer. In this post I'll present windbg. This tool works both as a user-mode debugger (in order to debug user applications) and as a kernel-mode debugger (in order to debug windows drivers). It's not as fancy and heavy as the Visual Studio debugger, however it has the advantage that it's really small and extensible using debugger extension dlls. Besides, since SoftIce has been discontinued, currently windbg is the only windows kernel-mode debugger available (The Visual Studio debugger is only a user-mode debugger. Also, kd is just a non-graphical frontend to the same core functions that windbg supplies).&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight: bold;"&gt;STEP 1: Installation&lt;/span&gt; &lt;br&gt;&lt;/p&gt;
&lt;p&gt;The first step for somebody interested in windows debugging is to download windgb from this &lt;a href="http://www.microsoft.com/whdc/devtools/debugging/installx86.mspx" mce_href="http://www.microsoft.com/whdc/devtools/debugging/installx86.mspx"&gt;link&lt;/a&gt;. The default installation path is "C:\program files\Debugging Tools for Windows". In order to use windbg you need to execute the file C:\program files\Debugging Tools for Windows\windbg.exe&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight: bold;"&gt;STEP 2: Setting the symbol file path&lt;/span&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;After executing windgb, you need to set the path to the symbol files. This path points to the directories with the pdb files of your drivers. You can have different directories by seperating them with a semicolon (;). You also need to point to the corresponding pdb files of all the windows components, if you want the call stacks that you'll see to include the functions from the components that are developed by Microsoft. The problem in this case is that the windows pdb files change between service packs, hotfixes, etc. Fortunately, Microsoft has configured a symbol server, which can be used to download the needed files on-demand. This means that you just set the symbol&amp;nbsp; path to the symbol server and windbg downloads only the pdb files that it needs. As it is mentioned &lt;a href="http://www.microsoft.com/whdc/devtools/debugging/debugstart.mspx" mce_href="http://www.microsoft.com/whdc/devtools/debugging/debugstart.mspx"&gt;here&lt;/a&gt;, in order to do this, you need to add an entry to the windbg source path that's equal to:&lt;br&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;SRV*&lt;i&gt;DownstreamStore&lt;/i&gt;*http://msdl.microsoft.com/download/symbols&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;In the above line, http://msdl.microsoft.com/download/symbols is the symbol server (so you don't need to modify this), and DownstreamStore is the path, where you want the pdb files to be downloaded. This needs to be substituted by a local directory, e.g. c:\symbols, so the complete entry would be &lt;/p&gt;
&lt;p&gt;&lt;b&gt;SRV*c:\symbols*http://msdl.microsoft.com/download/symbols&lt;/b&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;Finally, as I said above, if you have additional pdb files for the drivers that you are developing in directories c:\drivers1, c:\drivers1\misc and d:\drivers2, the complete symbol path would be:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;b&gt;SRV*c:\websymbols*http://msdl.microsoft.com/download/symbols;c:\drivers1;c:\drivers1\misc;d:\drivers2&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;In order to set this line, you need to open windbg, go to "File", then click at "Symbol File Path" and paste the line in the textarea. Also, as it can be seen from the above example, the directories in the path aren't recursive, so if you have pdb files both in c:\drivers1 and c:\drivers1\misc, then you need to include both of them, since the format doesn't imply the latter.&lt;/p&gt;
&lt;p&gt;If you want to observe the process of symbol matching, you can enable verbose symbol matching by executing the command&lt;/p&gt;
&lt;p&gt;&lt;b&gt;!sym noisy&lt;/b&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Afterwards, you can force windbg to reload the symbols by typing&lt;/p&gt;
&lt;p&gt;&lt;b&gt;.reload /f&lt;/b&gt;&lt;/p&gt;and look at the output, in order to identify possible problems. 
&lt;p&gt;&lt;span style="font-weight: bold;"&gt;STEP 3: Setting the source file path&lt;/span&gt; &lt;br&gt;&lt;/p&gt;
&lt;p&gt;After setting the symbol file path, you might want to set the source file path, which points to your driver source files. This way you'll be able to do source level debugging instead of assembly-level debugging. In order to do that, you need to go to "File" and then "Source File Path".&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight: bold;"&gt;STEP 4: Find a good command reference list&lt;/span&gt; &lt;br&gt;&lt;/p&gt;
&lt;p&gt;The next step is to find a good list of windbg commands. Actually, windbg supports a huge list of commands and there are many lists that you'll find in the internet. I am using the one that I found in this &lt;a href="http://www.tonyschr.net/debugging.htm" mce_href="http://www.tonyschr.net/debugging.htm"&gt;website&lt;/a&gt;. Until you get familiar with the list, it might be helpful to print it and keep it next to you while debugging. Fortunately, after playing for a while with windbg, you'll be able to remember the most common ones and learn where to find information about the rest.&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight: bold;"&gt;STEP 5: Configuring the working environment&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;One important feature for debugging is the usage of breakpoints, which stop the normal flow of execution. So, if you set a breakpoint, while debugging an application, then the application will stop executing, when it hits it. This way you'll be able to debug. However, if you wanted to set a breakpoint in the windows kernel and the kernel hit the breakpoint, then the whole system would freeze, because kernel controls (among other stuff) process management, thread switching, etc. Therefore, even though it's possible to perform restricted kernel debugging (no breakpoints and some other limitations) using windbg with only one computer (by going to "File", "Kernel Debug", "Local"), the true power of kernel debugging can be seen, if you have 2 computer.&lt;/p&gt;
&lt;p&gt;So, let's say that you have "Computer1", which is the machine that has the drivers that you want to debug, and "Computer2", which is the computer that will be running windbg. First of all, you need to connect these two computers using a serial cable or a USB cable or Firewire (IEEE 1394). After that, you need to go to Computer2, start windbg, go to "File", "Kernel Debug" and select COM or USB or 1394 from the top tab according to the connection that you have chosen. You need to fill the corresponding tabs (e.g. for COM you need to specify the baud rate, which would most probably be 115200 and the COM port, which would be COM1 or COM2). After that you press "ok" and windbg will wait, until you configure "Computer1" to go into debug mode.&lt;br&gt;&lt;/p&gt;
&lt;p&gt;The configuration for "Computer1" depends on its Operating System. So, if you are running any Windows version prior to Windows Vista, you need to open the file "C:\boot.ini" with an editor (it's a hidden system file, so you might need to configure your system to show the system files). The file might look something like this:&lt;/p&gt;
&lt;p&gt;[boot loader]&lt;br&gt;timeout=30&lt;br&gt;default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS&lt;br&gt;[operating systems]&lt;br&gt;multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /fastdetect&lt;/p&gt;
&lt;p&gt;What you need to do is either add "/debug /debugport=COM1 /baudrate=115200" after the end of the last line, in order to make it equal to&lt;/p&gt;
&lt;p&gt;"multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /fastdetect /debug /debugport=COM1 /baudrate=115200"&lt;/p&gt;
&lt;p&gt;(but you need to keep in might that this way your system will always start in debug mode) or create a second entry by modifying boot.ini to look like:&lt;/p&gt;
&lt;p&gt;[boot loader]&lt;br&gt;timeout=30&lt;br&gt;default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS&lt;br&gt;[operating systems]&lt;br&gt;multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /fastdetect&lt;br&gt;multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional Debug Mode" /fastdetect /debug /debugport=COM1 /baudrate=115200 &lt;/p&gt;
&lt;p&gt;(so, when you boot the system, you'll see a menu and you'll be able to select whether you want to start in debug mode or not). All the above applies for serial debugging (which is the most popular method). &lt;/p&gt;
&lt;p&gt;On the other hand, if you are using Windows Vista (or later), you have to use bcdedit. You need to open a command prompt as an Administrator (using runas) and execute bcdedit. The format of the command is: &lt;/p&gt;
&lt;p&gt;&lt;b&gt;bcdedit /dbgsettings &lt;/b&gt;&lt;i&gt;DebugType &lt;/i&gt;&lt;b&gt;[debugport:&lt;/b&gt;&lt;i&gt;Port&lt;/i&gt;&lt;b&gt;] [baudrate:&lt;/b&gt;&lt;i&gt;Baud&lt;/i&gt;&lt;b&gt;]&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;So, for serial debugging (using COM1 at 115200bps) it is: &lt;/p&gt;
&lt;p&gt;&lt;b&gt;bcdedit /dbgsettings serial debugport:1 baudrate:115200&lt;/b&gt; &lt;/p&gt;
&lt;p&gt;For 1394 (using channel 32) it is: &lt;/p&gt;
&lt;p&gt;&lt;b&gt;bcdedit /dbgsettings 1394 CHANNEL:32&lt;/b&gt; &lt;/p&gt;
&lt;p&gt;For USB (using "debugging" as the target name) it is: &lt;/p&gt;
&lt;p&gt;&lt;b&gt;bcdedit /dbgsettings USB targetname:debugging&lt;/b&gt; &lt;br&gt;&lt;/p&gt;
&lt;p&gt;After that, you need to enable debugging by typing: &lt;b&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;bcdedit /debug on&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;In order to disable it later, you can type:&lt;/p&gt;
&lt;p&gt;&lt;b&gt;bcdedit /debug off&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;If you want more information about bcdedit's debug options, you can look at the following &lt;a href="http://www.osronline.com/article.cfm?article=475" mce_href="http://www.osronline.com/article.cfm?article=475"&gt;OSR article&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;After that you need to restart the computer and if everything was configured correctly, you will see Computer1 stop during boot, and Computer2's windbg will print a message saying that the connection was established. &lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-weight: bold;"&gt;STEP 6: Becoming familiar with windbg&lt;/span&gt; &lt;br&gt;&lt;/p&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;
&lt;p&gt;After that, it's time to start playing with windbg. Since there are many online tutorials that cover this part, I won't try to reinvent the wheel by writing an additional one, but I would like to provide some pointers. Keep in mind that most of the tutorials in the internet don't require a second computer, so you can just use local kernel debugging, in case you don't have a second computer. &lt;/p&gt;
&lt;p&gt;I think that one of the best tutorial to start with (both because it is very clear to understand and because it explains some terms in more depth than others) is the one that is supplied with windbg. It is located in the directory, where you installed windbg, and it is called kernel_debugging_tutorial.doc. This file explains both fundamental and more advanced debugging techniques by examining the sample driver IoCtl, which can be found at the WDK. If you don't have the WDK, then you can use any other driver, for which you have the source code, since the concepts are similar. This tutorial needs two computers, however even if you have only one, it would be useful to go through it and look at the commands and the different methods.&lt;/p&gt;
&lt;p&gt;A couple more introductory tutorials are the &lt;a href="http://www.codeproject.com/debug/windbg_part1.asp" mce_href="http://www.codeproject.com/debug/windbg_part1.asp"&gt;codeproject Windbg tutorial&lt;/a&gt;&amp;nbsp; and &lt;a href="http://mtaulty.com/communityserver/blogs/mike_taultys_blog/archive/2004/08/03/4656.aspx" mce_href="http://mtaulty.com/communityserver/blogs/mike_taultys_blog/archive/2004/08/03/4656.aspx"&gt;Mike Taulty&lt;/a&gt;'s tutorial. Both include a list of common commands, but the second one also goes step-by-step through a debug session (windbg is used as a user-mode debugger). Another list of common windbg commads can be found &lt;a href="http://www.software.rkuster.com/windbg/cmd.htm" mce_href="http://www.software.rkuster.com/windbg/cmd.htm"&gt;here&lt;/a&gt;,&lt;br&gt;&lt;/p&gt;
&lt;p&gt;After that, you can proceed to some more advanced debugging concepts by looking at the debuging tutorials in &lt;a href="http://www.codeproject.com/debug/" mce_href="http://www.codeproject.com/debug/"&gt;codeproject&lt;/a&gt; and most specifically:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.codeproject.com/debug/cdbntsd.asp" mce_href="http://www.codeproject.com/debug/cdbntsd.asp"&gt;Debug Tutorial Part 1: Beginning Debugging Using CDB and NTSD&lt;/a&gt;&lt;br&gt;&lt;a href="http://www.codeproject.com/debug/cdbntsd2.asp" mce_href="http://www.codeproject.com/debug/cdbntsd2.asp"&gt;Debug Tutorial Part 2: The Stack&lt;/a&gt;&lt;br&gt;&lt;a href="http://www.codeproject.com/debug/cdbntsd3.asp" mce_href="http://www.codeproject.com/debug/cdbntsd3.asp"&gt;Debug Tutorial Part 3: The Heap&lt;/a&gt;&lt;br&gt;&lt;a href="http://www.codeproject.com/debug/cdbntsd4.asp" mce_href="http://www.codeproject.com/debug/cdbntsd4.asp"&gt;Debug Tutorial Part 4: Writing WINDBG Extensions&lt;/a&gt;&lt;br&gt;&lt;a href="http://www.codeproject.com/debug/cdbntsd5.asp" mce_href="http://www.codeproject.com/debug/cdbntsd5.asp"&gt;Debug Tutorial Part 5: Handle Leaks&lt;/a&gt;&lt;br&gt;&lt;a href="http://www.codeproject.com/debug/cdbntsd6.asp" mce_href="http://www.codeproject.com/debug/cdbntsd6.asp"&gt;Debug Tutorial Part 6: Navigating The Kernel Debugger&lt;/a&gt;&lt;br&gt;&lt;a href="http://www.codeproject.com/debug/cdbntsd7.asp" mce_href="http://www.codeproject.com/debug/cdbntsd7.asp"&gt;Debug Tutorial Part 7: Locks and Synchronization Objects &lt;/a&gt;&lt;/p&gt;
&lt;p&gt;A very good list of tutorials, which includes most of the above ones and some additional ones can be found &lt;a href="http://blogs.msdn.com/dougste/articles/clrdebug.aspx" mce_href="http://blogs.msdn.com/dougste/articles/clrdebug.aspx"&gt;here&lt;/a&gt;. In addition, for those, who prefer watching videos than reading tutorials, Mike Taulty has a list of debugging videos &lt;a href="http://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/archive/2006/10/27/8941.aspx" mce_href="http://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/archive/2006/10/27/8941.aspx"&gt;here&lt;/a&gt;. Both these blogs provide useful debugging information.&lt;br&gt;&lt;/p&gt;
&lt;p&gt;In addition, the 2 blogs below cover more advanced debugging topics:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;font size="-0"&gt;&lt;font size="2"&gt;Ken Johnson's blog: &lt;a href="http://www.nynaeve.net/" mce_href="http://www.nynaeve.net/"&gt;http://www.nynaeve.net&lt;/a&gt;&lt;/font&gt;&lt;/font&gt;&lt;/li&gt;
&lt;li&gt;&lt;font size="-0"&gt;&lt;font size="2"&gt;Oleg Starodumov's blog: &lt;/font&gt;&lt;/font&gt;&lt;font size="-0"&gt;&lt;font size="2"&gt;&lt;a href="http://www.debuginfo.com" target="_blank" mce_href="http://www.debuginfo.com"&gt;http://www.debuginfo.com&lt;/a&gt;&lt;/font&gt;&lt;/font&gt;&lt;/li&gt;&lt;/ul&gt;Another very useful source of information is windbg's help file. &lt;font size="-0"&gt;&lt;font size="2"&gt;Its filename is debugger.chm and is installed in the same directory as windbg's executable. It is an easy-to-read file, even though it might seem overwhelming in the beginning.&lt;/font&gt;&lt;/font&gt; 
&lt;p&gt;Finally, for additional information, you can look at &lt;a href="http://www.osronline.com/page.cfm?name=ListServer" mce_href="http://www.osronline.com/page.cfm?name=ListServer"&gt;OSR's windbg list&lt;/a&gt; (you need to register for free) and at the microsoft.public.windbg newsgroup.&lt;br&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1258056" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/iliast/archive/tags/Debugging/default.aspx">Debugging</category><category domain="http://blogs.msdn.com/iliast/archive/tags/windbg/default.aspx">windbg</category></item></channel></rss>