{"id":44113,"date":"2014-09-10T07:00:00","date_gmt":"2014-09-10T07:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2014\/09\/10\/i-wrote-the-original-blue-screen-of-death-sort-of\/"},"modified":"2021-02-08T10:12:18","modified_gmt":"2021-02-08T18:12:18","slug":"20140910-00","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20140910-00\/?p=44113","title":{"rendered":"I wrote the original blue screen of death, sort of"},"content":{"rendered":"<p><a href=\"https:\/\/devblogs.microsoft.com\/oldnewthing\/20140909-00\/?p=44123\"> We pick up the story<\/a> with Windows\u00a095. As I noted, the blue <kbd>Ctrl<\/kbd>+<kbd>Alt<\/kbd>+<kbd>Del<\/kbd> dialog was introduced in Windows\u00a03.1, and in Windows\u00a095; it was already gone. In Windows\u00a095, hitting <kbd>Ctrl<\/kbd>+<kbd>Alt<\/kbd>+<kbd>Del<\/kbd> called up a dialog box that looked something like this:<\/p>\n<table style=\"color: black; background-color: #d4d0c8; border-width: 2px; border-style: outset; font-size: 9pt; width: 0em; hyphens: none; font-family: MS Sans Serif, Arial, sans-serif;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr style=\"padding: 2px; font-size: 8pt; background-color: #0a246a; font-family: Tahoma, MS Sans Serif, Arial, sans-serif;\">\n<td style=\"padding: 4px 2px 4px 4px;\" align=\"right\"><b style=\"float: left; color: white;\">Close Program<\/b> <span style=\"background-color: #d4d0c8; border: solid 1px white; border-bottom-color: #404040; border-right-color: #404040;\"> <span style=\"border: solid 1px transparent; border-right-color: #808080; border-bottom-color: #808080; position: relative;\"> <span style=\"position: relative; top: -1px; left: 1px;\"><b>\u00d7\u00a0<\/b><\/span> <\/span> <\/span><\/td>\n<\/tr>\n<tr style=\"background-color: inherit;\">\n<td style=\"padding: 10px; padding-bottom: 0px;\">\n<div style=\"background: white; height: 15em; padding-bottom: 2px; border: 2px inset #d4d0c8;\">\n<div style=\"border: 0px dotted white;\">Explorer<\/div>\n<div style=\"border: 1px dotted white; background: #000080; color: white;\">Contoso Deluxe Composer [not responding]<\/div>\n<div style=\"border: 0px dotted white;\">Fabrikam Chart 2.0<\/div>\n<div style=\"border: 0px dotted white;\">LitWare Chess Challenger<\/div>\n<div style=\"border: 0px dotted white;\">Systray<\/div>\n<\/div>\n<div>WARNING: Pressing CTRL+ALT+DEL again will restart your computer.<br \/>\nYou will lose unsaved information in all programs that are running.<\/div>\n<\/td>\n<\/tr>\n<tr style=\"background-color: inherit;\">\n<td style=\"padding: 10px;\" align=\"center\" nowrap=\"nowrap\">\n<div style=\"border: solid 1px black; margin: 2px; display: inline-block;\">\n<div style=\"border: solid 1px; border-color: white black black white;\">\n<div style=\"border: solid 1px; border-color: #C0C0C0 #808080 #808080 #C0C0C0;\">\n<div style=\"border: 1px dotted black; width: 8em;\"><u>E<\/u>nd Task<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div style=\"border: solid 1px; border-color: white black black white; margin: 2px; display: inline-block;\">\n<div style=\"border: solid 1px; border-color: #C0C0C0 #808080 #808080 #C0C0C0;\">\n<div style=\"border: solid 1px transparent;\">\n<div style=\"border: 0px dotted black; width: 8em;\"><u>S<\/u>hut Down<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div style=\"border: solid 1px; border-color: white black black white; margin: 2px; display: inline-block;\">\n<div style=\"border: solid 1px; border-color: #C0C0C0 #808080 #808080 #C0C0C0;\">\n<div style=\"border: solid 1px transparent;\">\n<div style=\"border: 0px dotted black; width: 8em;\">Cancel<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>(We learned about Systray <a href=\"https:\/\/devblogs.microsoft.com\/oldnewthing\/20030910-00\/?p=42583\"> some time ago<\/a>.)<\/p>\n<p>Whereas Windows\u00a03.1 responded to fatal errors by crashing out to a black screen, Windows\u00a095 switched to showing severe errors in blue. And I&#8217;m the one who wrote it. Or at least modified it last.<\/p>\n<p>I was responsible for the code that displayed blue screen messages: Asking the kernel-mode video driver to switch into text mode, filling the screen with a blue background, drawing white text, waiting for the user to press a key, restoring the screen to its original contents, and reporting the user&#8217;s response back to the component that asked to display the message.\u00b9<\/p>\n<p>When a device driver crashed, Windows\u00a095 tried its best to limp along despite a catastrophic failure in a kernel-mode component. It wasn&#8217;t a blue screen of death so much as a blue screen of lameness. For those fortunate never to have seen one, it looked like this:<\/p>\n<table style=\"font-size: 80%; background-color: #0000aa; color: white; font-family: Consolas, monospace; font-weight: bold; hyphens: none;\">\n<tbody>\n<tr style=\"background-color: inherit;\">\n<td style=\"width: 80ex; padding: 5ex;\">\n\u00a0<\/p>\n<div style=\"text-align: center;\"><span style=\"background-color: #aaaaaa; color: #0000aa;\">\u00a0Windows\u00a0<\/span><\/div>\n<div>\u00a0<br \/>\n\u00a0<\/div>\n<div>An exception 0D has occurred at 0028:80014812. This was called from 0028:80014C34. It may be possible to continue normally.<\/div>\n<div>\u00a0<\/div>\n<div>* Press any key to attempt to continue.<\/div>\n<div>* Press CTRL+ALT+DEL to restart your computer. You will<\/div>\n<div>\u00a0 lose any unsaved information in all applications.<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Note the optimistic message &#8220;It may be possible to continue normally.&#8221; Everybody forgets that after Windows 95 showed you a blue screen error, <i>it tried its best to ignore the error and keep running anyway<\/i>. I mean, sure your scanner driver crashed, so scanning doesn&#8217;t work any more, but the rest of the system seems to be okay.<\/p>\n<p>(Imagine if you did that today. &#8220;Press any key to ignore this kernel panic.&#8221;)<\/p>\n<p>Technically, what happened was that the virtual machine manager abandoned the <i>event<\/i> currently in progress and returned to the event dispatcher. It&#8217;s the kernel-mode equivalent to <a href=\"http:\/\/blog.paulbetts.org\/index.php\/2010\/07\/20\/the-case-of-the-disappearing-onload-exception-user-mode-callback-exceptions-in-x64\/\"> swallowing exceptions in window procedures<\/a> and returning to the message loop. If there was no event in progress, then the current application was terminated.<\/p>\n<p>Sometimes the problem was global, and abandoning the current event or terminating the application did nothing to solve the problem; all that happened was that the next event or application to run encountered the same problem, and you got another blue screen message a few milliseconds later. After about a half dozen of these messages, you most likely gave up hope and hit <kbd>Ctrl<\/kbd>+<kbd>Alt<\/kbd>+<kbd>Del<\/kbd>.<\/p>\n<p>Now, that&#8217;s what the message looked like originally, but that message had a problem: Since the addresses at which device drivers were loaded into the kernel were not predictable, having the raw address didn&#8217;t really tell you much. If you were someone who was told, &#8220;This senior executive got this crash message, can you figure out what happened?&#8221;, all you had to work with was a bunch of mostly useless numbers.<\/p>\n<p>That someone might have been me.<\/p>\n<p>To help with this problem, I tweaked the message to include the name of the driver, the section number, and the offset within the section.<\/p>\n<table style=\"font-size: 80%; background-color: #0000aa; color: white; font-family: Consolas, monospace; font-weight: bold; hyphens: none;\">\n<tbody>\n<tr style=\"background-color: inherit;\">\n<td style=\"width: 80ex; padding: 5ex;\">\n\u00a0<\/p>\n<div style=\"text-align: center;\"><span style=\"background-color: #aaaaaa; color: #0000aa;\">\u00a0Windows\u00a0<\/span><\/div>\n<div>\n\u00a0<\/div>\n<div>An exception 0D has occurred at 0028:80014812 in VxD CONTOSO(03) + 00000152. This was called from 0028:80014C34 in VxD CONTOSO(03) + 00000574. It may be possible to continue normally.<\/div>\n<div>\u00a0<\/div>\n<div>* Press any key to attempt to continue.<\/div>\n<div>* Press CTRL+ALT+DEL to restart your computer. You will<\/div>\n<div>\u00a0 lose any unsaved information in all applications.<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Now you had the name of the driver that crashed, which might give you a clue of where the problem is, even if you knew nothing else. And somebody with access to a MAP file for the driver could now look up the address and identify which line crashed. Not great, but better than nothing, and before I made this change, nothing is what you had.<\/p>\n<p>So you could say that I wrote the Windows 95 blue screen of <span style=\"text-decoration: line-through;\">death<\/span> lameness to make my own life easier.<\/p>\n<p><b>Bonus chatter<\/b>: Later, someone (I forget whether it was me, so let&#8217;s say it was one of my colleagues) added some more code to inspect the crashing address, and if it was inside the kernel heap manager, the message changed slightly:<\/p>\n<table style=\"font-size: 80%; background-color: #0000aa; color: white; font-family: Consolas, monospace; font-weight: bold; hyphens: none;\">\n<tbody>\n<tr style=\"background-color: inherit;\">\n<td style=\"width: 80ex; padding: 5ex;\">\n\u00a0<\/p>\n<div style=\"text-align: center;\"><span style=\"background-color: #aaaaaa; color: #0000aa;\">\u00a0Windows\u00a0<\/span><\/div>\n<div>\n\u00a0<\/div>\n<div>A 32-bit device driver has corrupted critical system memory, resulting in an exception 0D at 0028:80001812 in VxD VMM(01) + 00001812. This was called from 0028:80014C34 in VxD CONTOSO(03) + 00000575.<\/div>\n<div>\u00a0<\/div>\n<div>* Press any key to attempt to continue.<\/div>\n<div>* Press CTRL+ALT+DEL to restart your computer. You will<\/div>\n<div>\u00a0 lose any unsaved information in all applications.<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>In this case, the sentence &#8220;It may be possible to continue normally&#8221; disappeared. Because we knew that, odds are, it won&#8217;t be.<\/p>\n<p><b>Bonus chatter<\/b>: Nice job, <a href=\"http:\/\/beta.slashdot.org\/submission\/3832559\/raymond-chen-authored-the-windows-31-ctrlaltdel-screen\"> Slashdot<\/a>. You considered posting a correction, but your correction was also wrong. At least you realized your mistake.<\/p>\n<p>\u00b9 Since this code ran in the kernel, it didn&#8217;t have access to keyboard layout information. It doesn&#8217;t know that if you are using the Chinese-Bopomofo keyboard layout, then the way to type &#8220;OK&#8221; is to press <kbd>C<\/kbd>, followed by <kbd>L<\/kbd>, followed by <kbd>3<\/kbd>. Not that it would help, because there is no IME in the kernel anyway. As much as possible, <a> the responses were mapped to language-independent keys like <kbd>Enter<\/kbd> and <kbd>ESC<\/kbd><\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It was blue, but it wasn&#8217;t completely deadly.<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[2],"class_list":["post-44113","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-history"],"acf":[],"blog_post_summary":"<p>It was blue, but it wasn&#8217;t completely deadly.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/44113","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=44113"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/44113\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=44113"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=44113"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=44113"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}