It turned blue, is something wrong with it?
BSOD is the kernel response to an unsolvable particular situation. If you see it, it means that something has happened and it is definitely wrong.
The kernel environment imposes many restrictions on the programmer's free hand: you consider IRQL, sync access to shared variables, and you do not stay too long in ISR, you should verify any data from the userland… Breaking at least one of the rules, you will receive a bunch of phrases in a standard VGA video with the poor palette.
In fact, this makes sense. If in the user mode the application simply closes without even removing a trail after itself (that the kernel will do that), so it will not break the integrity of the entire system.
How often do you have to see the Blue Screen of Death Windows (BSoD)? BSoD can occur in the different situations, for example, in the process of loading the operating system or during working with the OS. How do you determine what caused the occurrence of BSoD and fix this problem? The OS of Windows is capable to store a memory dump when an error occurs, and the system administrator can analyze the data dump and find the cause of BSoD.
There are two types of memory dumps, such as a minidump and a full dump. Depending on your operating system, it can store the full or small dumps, or take no actions when an error occurs.
The minidump is located in %systemroot%\minidump, and it has a name like Minixxxxxx-xx.dmp.
The full dump is located in %systemroot%, and it has a name like Memory.dmp.
The other day I debugged the driver, because when I was using it, at first glance appeared chaotic and some magic BSoDs. All function calls were correct; there were not any errors with zero pointers and other common problems. I did not figure out what could happen with this driver, I asked more experienced friend to see what's wrong. A few hours later he said that understood the reason for the bug. The result confused both of us.
It turned out that the cause of falling was the banal and simple: in the logic of the driver was used a stack extensively, often a function used 10 - 20 KB of memory on the stack under various buffers and arrays. MSDN says that the kernel stack is limited to three pages of memory (for 32-bit architecture is about 12KB), and therefore it is better to refrain from the multiple function calls and recursion.