1 /* xscreensaver, Copyright (c) 1998-2014 Jamie Zawinski <jwz@jwz.org>
3 * Permission to use, copy, modify, distribute, and sell this software and its
4 * documentation for any purpose is hereby granted without fee, provided that
5 * the above copyright notice appear in all copies and that both that
6 * copyright notice and this permission notice appear in supporting
7 * documentation. No representations are made about the suitability of this
8 * software for any purpose. It is provided "as is" without express or
11 * Blue Screen of Death: the finest in personal computer emulation.
12 * Concept cribbed from Stephen Martin <smartin@mks.com>;
13 * this version written by jwz, 4-Jun-98.
14 * Mostly rewritten by jwz, 20-Feb-2006.
20 - Define a function `new_os(dpy,win)' that returns a `bsod_state' struct.
21 - Draw on the window to set up its frame-zero state. This must be fast:
22 no sleeping or long loops!
23 - Populate the bsod_state structure with additional actions to take by
24 using the various BSOD_ macros. Note that you can control the delays
25 when printing text on a per-character or per-line basis.
26 - Insert your function in the `all_modes' table.
27 - Add a `doXXX' entry to `bsod_defaults'.
28 - Add fonts or colors to `bsod_defaults' if necessary.
30 Look at windows_31() for a simple example.
32 Look at linux_fsck() for a more complicated example with random behavior.
34 Or, you can bypass all that: look at nvidia() for a really hairy example.
38 #include "screenhack.h"
39 #include "xpm-pixmap.h"
44 #ifdef HAVE_XSHM_EXTENSION
49 # include <sys/utsname.h>
50 #endif /* HAVE_UNAME */
52 #if defined(HAVE_GDK_PIXBUF) || defined(HAVE_XPM) || defined(HAVE_COCOA)
57 # include "images/amiga.xpm"
58 # include "images/hmac.xpm"
59 # include "images/osx_10_2.xpm"
60 # include "images/osx_10_3.xpm"
61 # include "images/android.xpm"
63 #include "images/atari.xbm"
64 #include "images/mac.xbm"
65 #include "images/macbomb.xbm"
66 #include "images/atm.xbm"
69 #define countof(x) (sizeof((x))/sizeof((*x)))
74 LEFT_FULL, CENTER_FULL, RIGHT_FULL,
75 COLOR, INVERT, MOVETO, MARGINS,
76 CURSOR_BLOCK, CURSOR_LINE, RECT, COPY, PIXMAP, IMG,
77 PAUSE, CHAR_DELAY, LINE_DELAY,
83 void *arg1, *arg2, *arg3, *arg4, *arg5, *arg6;
89 XWindowAttributes xgwa;
93 int left_margin, right_margin; /* for text wrapping */
94 int top_margin, bottom_margin; /* for text scrolling */
98 Pixmap pixmap; /* Source image used by BSOD_PIXMAP */
100 int x, y; /* current text-drawing position */
101 int current_left; /* don't use this */
103 int pos; /* position in queue */
105 struct bsod_event *queue;
107 unsigned long char_delay; /* delay between printing characters */
108 unsigned long line_delay; /* delay between printing lines */
110 Bool macx_eol_kludge;
113 int (*draw_cb) (struct bsod_state *);
114 void (*free_cb) (struct bsod_state *);
116 async_load_state *img_loader;
120 # if !defined(__GNUC__) && !defined(__extension__)
121 /* don't warn about "string length is greater than the length ISO C89
122 compilers are required to support" in these string constants... */
123 # define __extension__ /**/
127 /* Draw text at the current position; align is LEFT, CENTER, RIGHT, or *_FULL
128 (meaning to clear the whole line margin to margin).
130 #define BSOD_TEXT(bst,align,string) do { \
131 ensure_queue (bst); \
132 (bst)->queue[(bst)->pos].type = (align); \
133 (bst)->queue[(bst)->pos].arg1 = (void *) strdup (__extension__ (string)); \
134 (bst)->queue[(bst)->pos].arg2 = (bst)->queue[(bst)->pos].arg1; \
135 (bst)->queue[(bst)->pos].arg3 = (void *) 0; \
139 /* Flip the foreground and background colors
141 #define BSOD_INVERT(bst) do { \
142 ensure_queue (bst); \
143 (bst)->queue[(bst)->pos].type = INVERT; \
147 /* Set the foreground and background colors to the given pixels
149 #define BSOD_COLOR(bst,fg,bg) do { \
150 ensure_queue (bst); \
151 (bst)->queue[(bst)->pos].type = COLOR; \
152 (bst)->queue[(bst)->pos].arg1 = (void *) fg; \
153 (bst)->queue[(bst)->pos].arg2 = (void *) bg; \
157 /* Set the position of the next text.
158 Note that this is the baseline: lower left corner of next char printed.
160 #define BSOD_MOVETO(bst,x,y) do { \
161 ensure_queue (bst); \
162 (bst)->queue[(bst)->pos].type = MOVETO; \
163 (bst)->queue[(bst)->pos].arg1 = (void *) ((long) (x)); \
164 (bst)->queue[(bst)->pos].arg2 = (void *) ((long) (y)); \
168 /* Delay for at least the given number of microseconds.
170 #define BSOD_PAUSE(bst,usec) do { \
171 ensure_queue (bst); \
172 (bst)->queue[(bst)->pos].type = PAUSE; \
173 (bst)->queue[(bst)->pos].arg1 = (void *) ((long) (usec)); \
177 /* Set the delay after each character is printed.
179 #define BSOD_CHAR_DELAY(bst,usec) do { \
180 ensure_queue (bst); \
181 (bst)->queue[(bst)->pos].type = CHAR_DELAY; \
182 (bst)->queue[(bst)->pos].arg1 = (void *) ((long) (usec)); \
186 /* Set the delay after each newline.
188 #define BSOD_LINE_DELAY(bst,usec) do { \
189 ensure_queue (bst); \
190 (bst)->queue[(bst)->pos].type = LINE_DELAY; \
191 (bst)->queue[(bst)->pos].arg1 = (void *) (usec); \
195 /* Set the prevailing left/right margins (used when strings have
196 embedded newlines, and when centering or right-justifying text.)
198 #define BSOD_MARGINS(bst,left,right) do { \
199 ensure_queue (bst); \
200 (bst)->queue[(bst)->pos].type = MARGINS; \
201 (bst)->queue[(bst)->pos].arg1 = (void *) ((long) (left)); \
202 (bst)->queue[(bst)->pos].arg2 = (void *) ((long) (right)); \
206 /* Draw a blinking cursor; type is CURSOR_BLOCK or CURSOR_LINE.
207 usec is how long 1/2 of a cycle is. count is how many times to blink.
208 (You can pass a gigantic number if this is the last thing in your mode.)
210 #define BSOD_CURSOR(bst,ctype,usec,count) do { \
211 ensure_queue (bst); \
212 (bst)->queue[(bst)->pos].type = (ctype); \
213 (bst)->queue[(bst)->pos].arg1 = (void *) (usec); \
214 (bst)->queue[(bst)->pos].arg2 = (void *) (count); \
218 /* Draw or fill a rectangle. You can set line-width in the GC.
220 #define BSOD_RECT(bst,fill,x,y,w,h) do { \
221 ensure_queue (bst); \
222 (bst)->queue[(bst)->pos].type = RECT; \
223 (bst)->queue[(bst)->pos].arg1 = (void *) ((long) (fill)); \
224 (bst)->queue[(bst)->pos].arg2 = (void *) ((long) (x)); \
225 (bst)->queue[(bst)->pos].arg3 = (void *) ((long) (y)); \
226 (bst)->queue[(bst)->pos].arg4 = (void *) ((long) (w)); \
227 (bst)->queue[(bst)->pos].arg5 = (void *) ((long) (h)); \
231 /* Copy a rect from the window, to the window.
233 #define BSOD_COPY(bst,srcx,srcy,w,h,tox,toy) do { \
234 ensure_queue (bst); \
235 (bst)->queue[(bst)->pos].type = COPY; \
236 (bst)->queue[(bst)->pos].arg1 = (void *) ((long) (srcx)); \
237 (bst)->queue[(bst)->pos].arg2 = (void *) ((long) (srcy)); \
238 (bst)->queue[(bst)->pos].arg3 = (void *) ((long) (w)); \
239 (bst)->queue[(bst)->pos].arg4 = (void *) ((long) (h)); \
240 (bst)->queue[(bst)->pos].arg5 = (void *) ((long) (tox)); \
241 (bst)->queue[(bst)->pos].arg6 = (void *) ((long) (toy)); \
245 /* Copy a rect from bst->pixmap to the window.
247 #define BSOD_PIXMAP(bst,srcx,srcy,w,h,tox,toy) do { \
248 BSOD_COPY(bst,srcx,srcy,w,h,tox,toy); \
249 (bst)->queue[(bst)->pos-1].type = PIXMAP; \
252 /* Load a random image (or the desktop) onto the window.
254 #define BSOD_IMG(bst) do { \
255 ensure_queue (bst); \
256 (bst)->queue[(bst)->pos].type = IMG; \
260 /* Jump around in the state table. You can use this as the last thing
261 in your state table to repeat the last N elements forever.
263 #define BSOD_LOOP(bst,off) do { \
264 ensure_queue (bst); \
265 (bst)->queue[(bst)->pos].type = LOOP; \
266 (bst)->queue[(bst)->pos].arg1 = (void *) (off); \
270 /* Restart the whole thing from the beginning.
272 #define BSOD_RESET(bst) do { \
273 ensure_queue (bst); \
274 (bst)->queue[(bst)->pos].type = RESET; \
280 ensure_queue (struct bsod_state *bst)
283 if (bst->pos + 1 < bst->queue_size)
286 n = bst->queue_size + 10;
290 bst->queue = (struct bsod_event *)
291 realloc (bst->queue, n * sizeof(*bst->queue));
292 if (!bst->queue) abort();
293 memset (bst->queue + bst->queue_size, 0,
294 (n - bst->queue_size) * sizeof(*bst->queue));
300 position_for_text (struct bsod_state *bst, const char *line)
304 const char *start = line;
306 if (bst->queue[bst->pos].type != LEFT &&
307 bst->queue[bst->pos].type != LEFT_FULL)
310 int dir, ascent, descent;
312 const char *end = start;
313 while (*end && *end != '\r' && *end != '\n')
316 XTextExtents (bst->font, start, end-start,
317 &dir, &ascent, &descent, &ov);
318 if (ov.width > max_width)
319 max_width = ov.width;
324 switch (bst->queue[bst->pos].type) {
327 bst->current_left = bst->left_margin;
331 bst->x = max_width - bst->right_margin;
332 bst->current_left = bst->x;
337 int w = (bst->xgwa.width - bst->left_margin - bst->right_margin -
340 bst->x = bst->left_margin + (w / 2);
341 bst->current_left = bst->x;
351 bst_crlf (struct bsod_state *bst)
353 int lh = bst->font->ascent + bst->font->descent;
354 bst->x = bst->current_left;
355 if (!bst->scroll_p ||
356 bst->y + lh < bst->xgwa.height - bst->bottom_margin)
360 int w = bst->xgwa.width - bst->right_margin - bst->left_margin;
361 int h = bst->xgwa.height - bst->top_margin - bst->bottom_margin;
362 XCopyArea (bst->dpy, bst->window, bst->window, bst->gc,
364 bst->top_margin + lh,
368 XClearArea (bst->dpy, bst->window,
369 bst->left_margin, bst->top_margin + h - lh, w, lh, False);
375 draw_char (struct bsod_state *bst, char c)
381 bst->x = bst->current_left;
385 if (bst->macx_eol_kludge)
387 /* Special case for the weird way OSX crashes print newlines... */
388 XDrawImageString (bst->dpy, bst->window, bst->gc,
389 bst->x, bst->y, " ", 1);
390 XDrawImageString (bst->dpy, bst->window, bst->gc,
392 bst->y + bst->font->ascent + bst->font->descent,
397 else if (c == '\b') /* backspace */
399 int cw = (bst->font->per_char
400 ? bst->font->per_char['n'-bst->font->min_char_or_byte2].width
401 : bst->font->min_bounds.width);
403 if (bst->x < bst->left_margin)
404 bst->x = bst->left_margin;
408 int dir, ascent, descent;
410 XTextExtents (bst->font, &c, 1, &dir, &ascent, &descent, &ov);
413 bst->x + ov.width > bst->xgwa.width - bst->right_margin)
416 XDrawImageString (bst->dpy, bst->window, bst->gc,
417 bst->x, bst->y, &c, 1);
424 bsod_pop (struct bsod_state *bst)
426 bsod_event_type type = bst->queue[bst->pos].type;
429 return bst->draw_cb (bst);
431 if (bst->pos < 0) /* already done */
436 case LEFT: case LEFT_FULL:
437 case CENTER: case CENTER_FULL:
438 case RIGHT: case RIGHT_FULL:
440 const char *s = (const char *) bst->queue[bst->pos].arg2;
445 long delay = bst->line_delay;
447 bst->current_left = bst->left_margin;
451 if (! bst->queue[bst->pos].arg3) /* "done once" */
453 position_for_text (bst, s);
454 bst->queue[bst->pos].arg4 = (void *) bst->queue[bst->pos].type;
455 bst->queue[bst->pos].type = LEFT;
457 if (type == CENTER_FULL ||
461 XSetForeground (bst->dpy, bst->gc, bst->bg);
462 XFillRectangle (bst->dpy, bst->window, bst->gc,
464 bst->y - bst->font->ascent,
466 bst->font->ascent + bst->font->descent);
467 XSetForeground (bst->dpy, bst->gc, bst->fg);
473 bst->queue[bst->pos].arg2 = (void *) s;
474 bst->queue[bst->pos].arg3 = (void *) 1; /* "done once" */
476 return (c == '\r' || c == '\n'
482 unsigned long swap = bst->fg;
485 XSetForeground (bst->dpy, bst->gc, bst->fg);
486 XSetBackground (bst->dpy, bst->gc, bst->bg);
492 bst->fg = (unsigned long) bst->queue[bst->pos].arg1;
493 bst->bg = (unsigned long) bst->queue[bst->pos].arg2;
494 XSetForeground (bst->dpy, bst->gc, bst->fg);
495 XSetBackground (bst->dpy, bst->gc, bst->bg);
501 bst->x = (long) bst->queue[bst->pos].arg1;
502 bst->y = (long) bst->queue[bst->pos].arg2;
508 int f = (long) bst->queue[bst->pos].arg1;
509 int x = (long) bst->queue[bst->pos].arg2;
510 int y = (long) bst->queue[bst->pos].arg3;
511 int w = (long) bst->queue[bst->pos].arg4;
512 int h = (long) bst->queue[bst->pos].arg5;
514 XFillRectangle (bst->dpy, bst->window, bst->gc, x, y, w, h);
516 XDrawRectangle (bst->dpy, bst->window, bst->gc, x, y, w, h);
523 int srcx = (long) bst->queue[bst->pos].arg1;
524 int srcy = (long) bst->queue[bst->pos].arg2;
525 int w = (long) bst->queue[bst->pos].arg3;
526 int h = (long) bst->queue[bst->pos].arg4;
527 int tox = (long) bst->queue[bst->pos].arg5;
528 int toy = (long) bst->queue[bst->pos].arg6;
530 (type == PIXMAP ? bst->pixmap : bst->window),
531 bst->window, bst->gc,
532 srcx, srcy, w, h, tox, toy);
538 if (bst->img_loader) abort();
539 bst->img_loader = load_image_async_simple (0, bst->xgwa.screen,
540 bst->window, bst->window,
547 long delay = (long) bst->queue[bst->pos].arg1;
553 bst->char_delay = (long) bst->queue[bst->pos].arg1;
559 bst->line_delay = (long) bst->queue[bst->pos].arg1;
565 bst->left_margin = (long) bst->queue[bst->pos].arg1;
566 bst->right_margin = (long) bst->queue[bst->pos].arg2;
573 long delay = (long) bst->queue[bst->pos].arg1;
574 long count = (long) bst->queue[bst->pos].arg2;
577 if (type == CURSOR_BLOCK)
579 unsigned long swap = bst->fg;
582 XSetForeground (bst->dpy, bst->gc, bst->fg);
583 XSetBackground (bst->dpy, bst->gc, bst->bg);
584 draw_char (bst, ' ');
588 draw_char (bst, (count & 1 ? ' ' : '_'));
589 draw_char (bst, ' ');
595 bst->queue[bst->pos].arg2 = (void *) count;
603 long off = (long) bst->queue[bst->pos].arg1;
605 if (bst->pos < 0 || bst->pos >= bst->queue_size)
612 for (i = 0; i < bst->queue_size; i++)
613 switch (bst->queue[i].type) {
614 case LEFT: case LEFT_FULL:
615 case CENTER: case CENTER_FULL:
616 case RIGHT: case RIGHT_FULL:
617 bst->queue[i].arg2 = bst->queue[i].arg1;
618 bst->queue[i].arg3 = 0;
619 bst->queue[i].type = (bsod_event_type) bst->queue[i].arg4;
638 static struct bsod_state *
639 make_bsod_state (Display *dpy, Window window,
640 const char *name, const char *class)
643 struct bsod_state *bst;
644 char buf1[1024], buf2[1024];
645 char buf3[1024], buf4[1024];
646 const char *font1, *font2;
648 bst = (struct bsod_state *) calloc (1, sizeof (*bst));
649 bst->queue_size = 10;
650 bst->queue = (struct bsod_event *) calloc (bst->queue_size,
651 sizeof (*bst->queue));
653 bst->window = window;
654 XGetWindowAttributes (dpy, window, &bst->xgwa);
656 /* If the window is small:
657 use ".font" if it is loadable, else use ".font2".
659 If the window is big:
660 use ".bigFont" if it is loadable, else use ".bigFont2".
666 bst->xgwa.height < 640
670 sprintf (buf1, "%.100s.font", name);
671 sprintf (buf2, "%.100s.font", class);
672 sprintf (buf3, "%.100s.font2", name);
673 sprintf (buf4, "%.100s.font2", class);
677 sprintf (buf1, "%.100s.bigFont", name);
678 sprintf (buf2, "%.100s.bigFont", class);
679 sprintf (buf3, "%.100s.bigFont2", name);
680 sprintf (buf4, "%.100s.bigFont2", class);
683 font1 = get_string_resource (dpy, buf1, buf2);
684 font2 = get_string_resource (dpy, buf3, buf4);
687 bst->font = XLoadQueryFont (dpy, font1);
688 if (! bst->font && font2)
689 bst->font = XLoadQueryFont (dpy, font2);
691 /* If neither of those worked, try some defaults. */
694 bst->font = XLoadQueryFont (dpy,"-*-courier-bold-r-*-*-*-120-*-*-m-*-*-*");
696 bst->font = XLoadQueryFont (dpy, "fixed");
700 gcv.font = bst->font->fid;
702 sprintf (buf1, "%.100s.foreground", name);
703 sprintf (buf2, "%.100s.Foreground", class);
704 bst->fg = gcv.foreground = get_pixel_resource (dpy, bst->xgwa.colormap,
706 sprintf (buf1, "%.100s.background", name);
707 sprintf (buf2, "%.100s.Background", class);
708 bst->bg = gcv.background = get_pixel_resource (dpy, bst->xgwa.colormap,
710 bst->gc = XCreateGC (dpy, window, GCFont|GCForeground|GCBackground, &gcv);
713 jwxyz_XSetAntiAliasing (dpy, bst->gc, False);
716 bst->left_margin = bst->right_margin = 10;
717 bst->x = bst->left_margin;
718 bst->y = bst->font->ascent + bst->left_margin;
720 XSetWindowBackground (dpy, window, gcv.background);
726 free_bsod_state (struct bsod_state *bst)
733 XFreePixmap(bst->dpy, bst->pixmap);
735 XFreeFont (bst->dpy, bst->font);
736 XFreeGC (bst->dpy, bst->gc);
738 for (i = 0; i < bst->queue_size; i++)
739 switch (bst->queue[i].type) {
740 case LEFT: case LEFT_FULL:
741 case RIGHT: case RIGHT_FULL:
742 case CENTER: case CENTER_FULL:
743 free ((char *) bst->queue[i].arg1);
755 double_pixmap (Display *dpy, GC gc, Visual *visual, int depth, Pixmap pixmap,
756 int pix_w, int pix_h)
759 Pixmap p2 = XCreatePixmap(dpy, pixmap, pix_w*2, pix_h*2, depth);
760 XImage *i1 = XGetImage(dpy, pixmap, 0, 0, pix_w, pix_h, ~0L, ZPixmap);
761 XImage *i2 = XCreateImage(dpy, visual, depth, ZPixmap, 0, 0,
762 pix_w*2, pix_h*2, 8, 0);
763 i2->data = (char *) calloc(i2->height, i2->bytes_per_line);
764 for (y = 0; y < pix_h; y++)
765 for (x = 0; x < pix_w; x++)
767 unsigned long p = XGetPixel(i1, x, y);
768 XPutPixel(i2, x*2, y*2, p);
769 XPutPixel(i2, x*2+1, y*2, p);
770 XPutPixel(i2, x*2, y*2+1, p);
771 XPutPixel(i2, x*2+1, y*2+1, p);
773 free(i1->data); i1->data = 0;
775 XPutImage(dpy, p2, gc, i2, 0, 0, 0, 0, i2->width, i2->height);
776 free(i2->data); i2->data = 0;
778 XFreePixmap(dpy, pixmap);
783 /*****************************************************************************
784 *****************************************************************************/
786 static struct bsod_state *
787 windows_31 (Display *dpy, Window window)
789 struct bsod_state *bst = make_bsod_state (dpy, window, "windows", "Windows");
791 BSOD_TEXT (bst, CENTER, "Windows\n");
793 BSOD_TEXT (bst, CENTER,
794 "A fatal exception 0E has occured at F0AD:42494C4C\n"
795 "the current application will be terminated.\n"
797 "* Press any key to terminate the current application.\n"
798 "* Press CTRL+ALT+DELETE again to restart your computer.\n"
799 " You will lose any unsaved information in all applications.\n"
802 BSOD_TEXT (bst, CENTER, "Press any key to continue");
804 bst->y = ((bst->xgwa.height -
805 ((bst->font->ascent + bst->font->descent) * 9))
808 XClearWindow (dpy, window);
813 static struct bsod_state *
814 windows_nt (Display *dpy, Window window)
816 struct bsod_state *bst = make_bsod_state (dpy, window, "windows", "Windows");
818 BSOD_TEXT (bst, LEFT,
819 "*** STOP: 0x0000001E (0x80000003,0x80106fc0,0x8025ea21,0xfd6829e8)\n"
820 "Unhandled Kernel exception c0000047 from fa8418b4 (8025ea21,fd6829e8)\n"
822 "Dll Base Date Stamp - Name Dll Base Date Stamp - Name\n"
823 "80100000 2be154c9 - ntoskrnl.exe 80400000 2bc153b0 - hal.dll\n"
824 "80258000 2bd49628 - ncrc710.sys 8025c000 2bd49688 - SCSIPORT.SYS \n"
825 "80267000 2bd49683 - scsidisk.sys 802a6000 2bd496b9 - Fastfat.sys\n"
826 "fa800000 2bd49666 - Floppy.SYS fa810000 2bd496db - Hpfs_Rec.SYS\n"
827 "fa820000 2bd49676 - Null.SYS fa830000 2bd4965a - Beep.SYS\n"
828 "fa840000 2bdaab00 - i8042prt.SYS fa850000 2bd5a020 - SERMOUSE.SYS\n"
829 "fa860000 2bd4966f - kbdclass.SYS fa870000 2bd49671 - MOUCLASS.SYS\n"
830 "fa880000 2bd9c0be - Videoprt.SYS fa890000 2bd49638 - NCC1701E.SYS\n"
831 "fa8a0000 2bd4a4ce - Vga.SYS fa8b0000 2bd496d0 - Msfs.SYS\n"
832 "fa8c0000 2bd496c3 - Npfs.SYS fa8e0000 2bd496c9 - Ntfs.SYS\n"
833 "fa940000 2bd496df - NDIS.SYS fa930000 2bd49707 - wdlan.sys\n"
834 "fa970000 2bd49712 - TDI.SYS fa950000 2bd5a7fb - nbf.sys\n"
835 "fa980000 2bd72406 - streams.sys fa9b0000 2bd4975f - ubnb.sys\n"
836 "fa9c0000 2bd5bfd7 - usbser.sys fa9d0000 2bd4971d - netbios.sys\n"
837 "fa9e0000 2bd49678 - Parallel.sys fa9f0000 2bd4969f - serial.SYS\n"
838 "faa00000 2bd49739 - mup.sys faa40000 2bd4971f - SMBTRSUP.SYS\n"
839 "faa10000 2bd6f2a2 - srv.sys faa50000 2bd4971a - afd.sys\n"
840 "faa60000 2bd6fd80 - rdr.sys faaa0000 2bd49735 - bowser.sys\n"
842 "Address dword dump Dll Base - Name\n"
843 "801afc20 80106fc0 80106fc0 00000000 00000000 80149905 : "
844 "fa840000 - i8042prt.SYS\n"
845 "801afc24 80149905 80149905 ff8e6b8c 80129c2c ff8e6b94 : "
846 "8025c000 - SCSIPORT.SYS\n"
847 "801afc2c 80129c2c 80129c2c ff8e6b94 00000000 ff8e6b94 : "
848 "80100000 - ntoskrnl.exe\n"
849 "801afc34 801240f2 80124f02 ff8e6df4 ff8e6f60 ff8e6c58 : "
850 "80100000 - ntoskrnl.exe\n"
851 "801afc54 80124f16 80124f16 ff8e6f60 ff8e6c3c 8015ac7e : "
852 "80100000 - ntoskrnl.exe\n"
853 "801afc64 8015ac7e 8015ac7e ff8e6df4 ff8e6f60 ff8e6c58 : "
854 "80100000 - ntoskrnl.exe\n"
855 "801afc70 80129bda 80129bda 00000000 80088000 80106fc0 : "
856 "80100000 - ntoskrnl.exe\n"
858 "Kernel Debugger Using: COM2 (Port 0x2f8, Baud Rate 19200)\n"
859 "Restart and set the recovery options in the system control panel\n"
860 "or the /CRASHDEBUG system start option. If this message reappears,\n"
861 "contact your system administrator or technical support group."
864 bst->line_delay = 750;
866 XClearWindow (dpy, window);
871 static struct bsod_state *
872 windows_2k (Display *dpy, Window window)
874 struct bsod_state *bst = make_bsod_state (dpy, window, "windows", "Windows");
876 BSOD_TEXT (bst, LEFT,
877 "*** STOP: 0x000000D1 (0xE1D38000,0x0000001C,0x00000000,0xF09D42DA)\n"
878 "DRIVER_IRQL_NOT_LESS_OR_EQUAL \n"
880 "*** Address F09D42DA base at F09D4000, DateStamp 39f459ff - CRASHDD.SYS\n"
882 "Beginning dump of physical memory\n");
883 BSOD_PAUSE (bst, 4000000);
884 BSOD_TEXT (bst, LEFT,
885 "Physical memory dump complete. Contact your system administrator or\n"
886 "technical support group.\n");
888 bst->left_margin = 40;
889 bst->y = (bst->font->ascent + bst->font->descent) * 10;
890 bst->line_delay = 750;
892 XClearWindow (dpy, window);
897 static struct bsod_state *
898 windows_me (Display *dpy, Window window)
900 struct bsod_state *bst = make_bsod_state (dpy, window, "windows", "Windows");
902 BSOD_TEXT (bst, LEFT,
903 "Windows protection error. You need to restart your computer.\n\n"
905 BSOD_CURSOR (bst, CURSOR_LINE, 120000, 999999);
907 bst->left_margin = 40;
908 bst->y = ((bst->xgwa.height -
909 ((bst->font->ascent + bst->font->descent) * 3))
912 XClearWindow (dpy, window);
917 static struct bsod_state *
918 windows_xp (Display *dpy, Window window)
920 struct bsod_state *bst = make_bsod_state (dpy, window, "windows", "Windows");
922 BSOD_TEXT (bst, LEFT, /* From Wm. Rhodes <xscreensaver@27.org> */
923 "A problem has been detected and windows has been shut down to prevent "
925 "to your computer.\n"
927 "If this is the first time you've seen this Stop error screen,\n"
928 "restart your computer. If this screen appears again, follow\n"
931 "Check to be sure you have adequate disk space. If a driver is\n"
932 "identified in the Stop message, disable the driver or check\n"
933 "with the manufacturer for driver updates. Try changing video\n"
936 "Check with your hardware vendor for any BIOS updates. Disable\n"
937 "BIOS memory options such as caching or shadowing. If you need\n"
938 "to use Safe Mode to remove or disable components, restart your\n"
939 "computer, press F8 to select Advanced Startup Options, and then\n"
940 "select Safe Mode.\n"
942 "Technical information:\n"
944 "*** STOP: 0x0000007E (0xC0000005,0xF88FF190,0x0xF8975BA0,0xF89758A0)\n"
947 "*** EPUSBDSK.sys - Address F88FF190 base at FF88FE000, datestamp "
950 "Beginning dump of physical memory\n");
951 BSOD_PAUSE (bst, 4000000);
952 BSOD_TEXT (bst, LEFT,
953 "Physical memory dump complete.\n"
954 "Contact your system administrator or technical support group for "
958 XClearWindow (dpy, window);
963 static struct bsod_state *
964 windows_lh (Display *dpy, Window window)
966 struct bsod_state *bst =
967 make_bsod_state (dpy, window, "windowslh", "WindowsLH");
969 unsigned long fg = bst->fg;
970 unsigned long bg = bst->bg;
971 unsigned long bg2 = get_pixel_resource (dpy, bst->xgwa.colormap,
972 "windowslh.background2",
973 "WindowsLH.Background");
975 /* The "RSOD" that appeared with "Windows Longhorn 5048.050401-0536_x86fre"
976 As reported by http://joi.ito.com/RedScreen.jpg
978 BSOD_COLOR (bst, bg, bg2);
979 BSOD_TEXT (bst, CENTER_FULL, "Windows Boot Error\n");
980 BSOD_COLOR (bst, fg, bg);
981 BSOD_TEXT (bst, CENTER,
983 "Windows Boot Manager has experienced a problem.\n"
986 " Status: 0xc000000f\n"
990 " Info: An error occurred transferring exectuion." /* (sic) */
994 "You can try to recover the system with the Microsoft Windows "
996 "Tools. (You might need to restart the system manually.)\n"
998 "If the problem continues, please contact your system administrator "
1002 BSOD_MOVETO (bst, bst->left_margin, bst->xgwa.height - bst->font->descent);
1003 BSOD_COLOR (bst, bg, bg2);
1004 BSOD_TEXT (bst, LEFT_FULL, " SPACE=Continue\n");
1006 bst->y = bst->font->ascent;
1008 XClearWindow (dpy, window);
1013 static struct bsod_state *
1014 windows_other (Display *dpy, Window window)
1016 /* Lump all of the 2K-ish crashes together and select them randomly...
1018 int which = (random() % 4);
1020 case 0: return windows_2k (dpy, window); break;
1021 case 1: return windows_me (dpy, window); break;
1022 case 2: return windows_xp (dpy, window); break;
1023 case 3: return windows_lh (dpy, window); break;
1024 default: abort(); break;
1029 /* As seen in Portal 2. By jwz.
1031 static struct bsod_state *
1032 glados (Display *dpy, Window window)
1034 struct bsod_state *bst = make_bsod_state (dpy, window, "glaDOS", "GlaDOS");
1035 const char * panicstr[] = {
1037 "MOLTEN CORE WARNING\n",
1039 "An operator error exception has occurred at FISSREAC0020093:09\n",
1040 "FISSREAC0020077:14 FISSREAC0020023:17 FISSREAC0020088:22\n",
1041 "neutron multiplication rate at spikevalue 99999999\n",
1043 "* Press any key to vent radiological emissions into atmosphere.\n",
1044 "* Consult reactor core manual for instructions on proper reactor core\n",
1045 "maintenance and repair.\n",
1047 "Press any key to continue\n",
1052 bst->y = ((bst->xgwa.height -
1053 ((bst->font->ascent + bst->font->descent) * countof(panicstr)))
1056 BSOD_MOVETO (bst, 0, bst->y);
1058 BSOD_TEXT (bst, CENTER, "OPERATOR ERROR\n");
1060 for (i = 0; i < countof(panicstr); i++)
1061 BSOD_TEXT (bst, CENTER, panicstr[i]);
1062 BSOD_PAUSE (bst, 1000000);
1064 BSOD_RECT (bst, True, 0, 0, bst->xgwa.width, bst->xgwa.height);
1066 BSOD_PAUSE (bst, 250000);
1069 XClearWindow (dpy, window);
1075 /* SCO OpenServer 5 panic, by Tom Kelly <tom@ancilla.toronto.on.ca>
1077 static struct bsod_state *
1078 sco (Display *dpy, Window window)
1080 struct bsod_state *bst = make_bsod_state (dpy, window, "sco", "SCO");
1082 BSOD_TEXT (bst, LEFT,
1083 "Unexpected trap in kernel mode:\n"
1085 "cr0 0x80010013 cr2 0x00000014 cr3 0x00000000 tlb 0x00000000\n"
1086 "ss 0x00071054 uesp 0x00012055 efl 0x00080888 ipl 0x00000005\n"
1087 "cs 0x00092585 eip 0x00544a4b err 0x004d4a47 trap 0x0000000E\n"
1088 "eax 0x0045474b ecx 0x0042544b edx 0x57687920 ebx 0x61726520\n"
1089 "esp 0x796f7520 ebp 0x72656164 esi 0x696e6720 edi 0x74686973\n"
1090 "ds 0x3f000000 es 0x43494c48 fs 0x43525343 gs 0x4f4d4b53\n"
1092 "PANIC: k_trap - kernel mode trap type 0x0000000E\n"
1093 "Trying to dump 5023 pages to dumpdev hd (1/41), 63 pages per '.'\n"
1095 BSOD_CHAR_DELAY (bst, 100000);
1096 BSOD_TEXT (bst, LEFT,
1097 "................................................................."
1100 BSOD_CHAR_DELAY (bst, 0);
1101 BSOD_TEXT (bst, LEFT,
1102 "5023 pages dumped\n"
1106 BSOD_PAUSE (bst, 2000000);
1107 BSOD_TEXT (bst, LEFT,
1108 "** Safe to Power Off **\n"
1110 "** Press Any Key to Reboot **\n"
1113 bst->y = ((bst->xgwa.height -
1114 ((bst->font->ascent + bst->font->descent) * 18)));
1116 XClearWindow (dpy, window);
1121 /* Linux (sparc) panic, by Tom Kelly <tom@ancilla.toronto.on.ca>
1123 static struct bsod_state *
1124 sparc_linux (Display *dpy, Window window)
1126 struct bsod_state *bst = make_bsod_state (dpy, window, "sco", "SCO");
1127 bst->scroll_p = True;
1128 bst->y = bst->xgwa.height - bst->font->ascent - bst->font->descent;
1130 BSOD_TEXT (bst, LEFT,
1131 "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
1132 "Unable to handle kernel paging request at virtual address f0d4a000\n"
1133 "tsk->mm->context = 00000014\n"
1134 "tsk->mm->pgd = f26b0000\n"
1136 " \"@'/ ,. \\`@\"\n"
1139 "gawk(22827): Oops\n"
1140 "PSR: 044010c1 PC: f001c2cc NPC: f001c2d0 Y: 00000000\n"
1141 "g0: 00001000 g1: fffffff7 g2: 04401086 g3: 0001eaa0\n"
1142 "g4: 000207dc g5: f0130400 g6: f0d4a018 g7: 00000001\n"
1143 "o0: 00000000 o1: f0d4a298 o2: 00000040 o3: f1380718\n"
1144 "o4: f1380718 o5: 00000200 sp: f1b13f08 ret_pc: f001c2a0\n"
1145 "l0: efffd880 l1: 00000001 l2: f0d4a230 l3: 00000014\n"
1146 "l4: 0000ffff l5: f0131550 l6: f012c000 l7: f0130400\n"
1147 "i0: f1b13fb0 i1: 00000001 i2: 00000002 i3: 0007c000\n"
1148 "i4: f01457c0 i5: 00000004 i6: f1b13f70 i7: f0015360\n"
1149 "Instruction DUMP:\n"
1152 XClearWindow (dpy, window);
1157 /* BSD Panic by greywolf@starwolf.com - modeled after the Linux panic above.
1158 By Grey Wolf <greywolf@siteROCK.com>
1160 static struct bsod_state *
1161 bsd (Display *dpy, Window window)
1163 struct bsod_state *bst = make_bsod_state (dpy, window, "bsd", "BSD");
1165 const char * const panicstr[] = {
1166 "panic: ifree: freeing free inode\n",
1167 "panic: blkfree: freeing free block\n",
1168 "panic: improbability coefficient below zero\n",
1169 "panic: cgsixmmap\n",
1170 "panic: crazy interrupts\n",
1172 "panic: attempted windows install\n",
1174 "panic: free inode isn't\n",
1175 "panic: cpu_fork: curproc\n",
1176 "panic: malloc: out of space in kmem_map\n",
1177 "panic: vogon starship detected\n",
1178 "panic: teleport chamber: out of order\n",
1179 "panic: Brain fried - core dumped\n"
1182 char syncing[80], bbuf[5];
1184 for (i = 0; i < sizeof(syncing); i++)
1187 i = (random() % (sizeof(panicstr) / sizeof(*panicstr)));
1188 BSOD_TEXT (bst, LEFT, panicstr[i]);
1189 BSOD_TEXT (bst, LEFT, "Syncing disks: ");
1191 b = (random() % 40);
1192 for (n = 0; (n < 20) && (b > 0); n++)
1196 i = (random() & 0x7);
1197 b -= (random() & 0xff) % 20;
1201 sprintf (bbuf, "%d ", b);
1202 BSOD_TEXT (bst, LEFT, bbuf);
1203 BSOD_PAUSE (bst, 1000000);
1206 BSOD_TEXT (bst, LEFT, "\n");
1207 BSOD_TEXT (bst, LEFT, (b ? "damn!" : "sunk!"));
1208 BSOD_TEXT (bst, LEFT, "\nRebooting\n");
1210 bst->y = ((bst->xgwa.height -
1211 ((bst->font->ascent + bst->font->descent) * 4)));
1213 XClearWindow (dpy, window);
1218 static struct bsod_state *
1219 amiga (Display *dpy, Window window)
1221 struct bsod_state *bst = make_bsod_state (dpy, window, "amiga", "Amiga");
1224 int pix_w = 0, pix_h = 0;
1228 unsigned long bg2 = get_pixel_resource (dpy, bst->xgwa.colormap,
1229 "amiga.background2",
1230 "Amiga.Background");
1233 pixmap = xpm_data_to_pixmap (dpy, window, (char **) amiga_hand,
1235 # endif /* DO_XPM */
1237 if (pixmap && bst->xgwa.height > 600) /* scale up the bitmap */
1239 pixmap = double_pixmap (dpy, bst->gc, bst->xgwa.visual, bst->xgwa.depth,
1240 pixmap, pix_w, pix_h);
1245 XSetLineAttributes (dpy, bst->gc, lw, LineSolid, CapButt, JoinMiter);
1247 height = (bst->font->ascent + bst->font->descent) * 6;
1249 BSOD_PAUSE (bst, 2000000);
1250 BSOD_COPY (bst, 0, 0, bst->xgwa.width, bst->xgwa.height - height, 0, height);
1253 BSOD_RECT (bst, True, 0, 0, bst->xgwa.width, height);
1255 BSOD_TEXT (bst, CENTER,
1257 "Software failure. Press left mouse button to continue.\n"
1258 "Guru Meditation #00000003.00C01570"
1260 BSOD_RECT (bst, False, lw/2, lw/2, bst->xgwa.width - lw, height);
1261 BSOD_PAUSE (bst, 1000000);
1263 BSOD_LOOP (bst, -3);
1265 XSetWindowBackground (dpy, window, bg2);
1266 XClearWindow (dpy, window);
1267 XSetWindowBackground (dpy, window, bst->bg);
1271 int x = (bst->xgwa.width - pix_w) / 2;
1272 int y = ((bst->xgwa.height - pix_h) / 2);
1273 XCopyArea (dpy, pixmap, bst->window, bst->gc, 0, 0, pix_w, pix_h, x, y);
1283 /* Atari ST, by Marcus Herbert <rhoenie@nobiscum.de>
1284 Marcus had this to say:
1286 Though I still have my Atari somewhere, I hardly remember
1287 the meaning of the bombs. I think 9 bombs was "bus error" or
1288 something like that. And you often had a few bombs displayed
1289 quickly and then the next few ones coming up step by step.
1290 Perhaps somebody else can tell you more about it.. its just
1293 static struct bsod_state *
1294 atari (Display *dpy, Window window)
1296 struct bsod_state *bst = make_bsod_state (dpy, window, "atari", "Atari");
1299 int pix_w = atari_width;
1300 int pix_h = atari_height;
1304 pixmap = XCreatePixmapFromBitmapData (dpy, window, (char *) atari_bits,
1306 bst->fg, bst->bg, bst->xgwa.depth);
1307 pixmap = double_pixmap (dpy, bst->gc, bst->xgwa.visual, bst->xgwa.depth,
1308 pixmap, pix_w, pix_h);
1314 y = bst->xgwa.height/2;
1317 for (i = 1; i< 7; i++)
1318 BSOD_COPY (bst, x, y, pix_w, pix_h, (x + (i*offset)), y);
1322 BSOD_PAUSE (bst, 1000000);
1323 BSOD_COPY (bst, x, y, pix_w, pix_h, (x + (i*offset)), y);
1326 XClearWindow (dpy, window);
1327 XCopyArea (dpy, pixmap, window, bst->gc, 0, 0, pix_w, pix_h, x, y);
1328 XFreePixmap (dpy, pixmap);
1334 static struct bsod_state *
1335 mac (Display *dpy, Window window)
1337 struct bsod_state *bst = make_bsod_state (dpy, window, "mac", "Mac");
1340 int pix_w = mac_width;
1341 int pix_h = mac_height;
1342 int offset = mac_height * 4;
1345 const char *string = ("0 0 0 0 0 0 0 F\n"
1348 pixmap = XCreatePixmapFromBitmapData(dpy, window, (char *) mac_bits,
1349 mac_width, mac_height,
1350 bst->fg, bst->bg, bst->xgwa.depth);
1352 for (i = 0; i < 2; i++)
1354 pixmap = double_pixmap (dpy, bst->gc, bst->xgwa.visual, bst->xgwa.depth,
1355 pixmap, pix_w, pix_h);
1356 pix_w *= 2; pix_h *= 2;
1359 bst->x = (bst->xgwa.width - pix_w) / 2;
1360 bst->y = (((bst->xgwa.height + offset) / 2) -
1362 (bst->font->ascent + bst->font->descent) * 2);
1363 if (bst->y < 0) bst->y = 0;
1365 XClearWindow (dpy, window);
1366 XCopyArea (dpy, pixmap, window, bst->gc, 0, 0, pix_w, pix_h, bst->x, bst->y);
1367 XFreePixmap (dpy, pixmap);
1369 bst->y += offset + bst->font->ascent + bst->font->descent;
1370 BSOD_TEXT (bst, CENTER, string);
1376 static struct bsod_state *
1377 macsbug (Display *dpy, Window window)
1379 struct bsod_state *bst = make_bsod_state (dpy, window, "macsbug", "MacsBug");
1382 const char *left = (" SP \n"
1429 const char *bottom = (" _A09D\n"
1430 " +00884 40843714 #$0700,SR "
1432 " +00886 40843765 *+$0400 "
1434 " +00888 40843718 $0004(A7),([0,A7[)"
1435 " ; 04E8D0AE | 66B8");
1437 const char * body = ("PowerPC unmapped memory exception at 003AFDAC "
1438 "BowelsOfTheMemoryMgr+04F9C\n"
1439 " Calling chain using A6/R1 links\n"
1440 " Back chain ISA Caller\n"
1441 " 00000000 PPC 28C5353C __start+00054\n"
1442 " 24DB03C0 PPC 28B9258C main+0039C\n"
1443 " 24DB0350 PPC 28B9210C MainEvent+00494\n"
1444 " 24DB02B0 PPC 28B91B40 HandleEvent+00278\n"
1445 " 24DB0250 PPC 28B83DAC DoAppleEvent+00020\n"
1446 " 24DB0210 PPC FFD3E5D0 "
1447 "AEProcessAppleEvent+00020\n"
1448 " 24DB0132 68K 00589468\n"
1449 " 24DAFF8C 68K 00589582\n"
1450 " 24DAFF26 68K 00588F70\n"
1451 " 24DAFEB3 PPC 00307098 "
1452 "EmToNatEndMoveParams+00014\n"
1453 " 24DAFE40 PPC 28B9D0B0 DoScript+001C4\n"
1454 " 24DAFDD0 PPC 28B9C35C RunScript+00390\n"
1455 " 24DAFC60 PPC 28BA36D4 run_perl+000E0\n"
1456 " 24DAFC10 PPC 28BC2904 perl_run+002CC\n"
1457 " 24DAFA80 PPC 28C18490 Perl_runops+00068\n"
1458 " 24DAFA30 PPC 28BE6CC0 Perl_pp_backtick+000FC\n"
1459 " 24DAF9D0 PPC 28BA48B8 Perl_my_popen+00158\n"
1460 " 24DAF980 PPC 28C5395C sfclose+00378\n"
1461 " 24DAF930 PPC 28BA568C free+0000C\n"
1462 " 24DAF8F0 PPC 28BA6254 pool_free+001D0\n"
1463 " 24DAF8A0 PPC FFD48F14 DisposePtr+00028\n"
1464 " 24DAF7C9 PPC 00307098 "
1465 "EmToNatEndMoveParams+00014\n"
1466 " 24DAF780 PPC 003AA180 __DisposePtr+00010");
1471 int char_width, line_height;
1472 int col_right, row_top, row_bottom, page_right, page_bottom, body_top;
1475 unsigned long fg = bst->fg;
1476 unsigned long bg = bst->bg;
1477 unsigned long bc = get_pixel_resource (dpy, bst->xgwa.colormap,
1478 "macsbug.borderColor",
1479 "MacsBug.BorderColor");
1481 for (s = body; *s; s++) if (*s == '\n') body_lines++;
1483 char_width = (bst->font->per_char
1484 ? bst->font->per_char['n'-bst->font->min_char_or_byte2].width
1485 : bst->font->min_bounds.width);
1486 line_height = bst->font->ascent + bst->font->descent;
1488 col_right = char_width * 12; /* number of columns in `left' */
1489 page_bottom = line_height * 47; /* number of lines in `left' */
1491 if (page_bottom > bst->xgwa.height)
1492 page_bottom = bst->xgwa.height;
1494 row_bottom = page_bottom - line_height;
1495 row_top = row_bottom - (line_height * 4);
1496 page_right = col_right + (char_width * 88);
1497 body_top = row_top - (line_height * body_lines);
1506 xoff = (bst->xgwa.width - page_right) / 2;
1507 yoff = (bst->xgwa.height - page_bottom) / 2;
1509 if (xoff < 0) xoff = 0;
1510 if (yoff < 0) yoff = 0;
1512 BSOD_MARGINS (bst, xoff, yoff);
1514 BSOD_COLOR (bst, bc, bg);
1515 BSOD_RECT (bst, True, 0, 0, bst->xgwa.width, bst->xgwa.height);
1516 BSOD_COLOR (bst, bg, bg);
1517 BSOD_RECT (bst, True, xoff-2, yoff, page_right+4, page_bottom);
1518 BSOD_COLOR (bst, fg, bg);
1520 BSOD_MOVETO (bst, xoff, yoff + line_height);
1521 BSOD_TEXT (bst, LEFT, left);
1522 BSOD_MOVETO (bst, xoff+col_right, yoff + row_top + line_height);
1523 BSOD_TEXT (bst, LEFT, bottom);
1525 BSOD_RECT (bst, True, xoff + col_right, yoff, 2, page_bottom);
1526 BSOD_RECT (bst, True, xoff + col_right, yoff + row_top,
1527 page_right - col_right, 1);
1528 BSOD_RECT (bst, True, xoff + col_right, yoff + row_bottom,
1529 page_right - col_right, 1);
1530 BSOD_RECT (bst, False, xoff-2, yoff, page_right+4, page_bottom);
1532 BSOD_LINE_DELAY (bst, 500);
1534 xoff + col_right + char_width,
1535 yoff + body_top + line_height);
1536 BSOD_MARGINS (bst, xoff + col_right + char_width, yoff);
1537 BSOD_TEXT (bst, LEFT, body);
1539 BSOD_RECT (bst, False, xoff-2, yoff, page_right+4, page_bottom); /* again */
1541 BSOD_RECT (bst, False,
1542 xoff + col_right + (char_width/2)+2,
1543 yoff + row_bottom + 2,
1545 page_bottom - row_bottom - 4);
1547 BSOD_PAUSE (bst, 666666);
1549 BSOD_LOOP (bst, -3);
1551 XClearWindow (dpy, window);
1556 static struct bsod_state *
1557 mac1 (Display *dpy, Window window)
1559 struct bsod_state *bst = make_bsod_state (dpy, window, "mac1", "Mac1");
1562 int pix_w = macbomb_width;
1563 int pix_h = macbomb_height;
1566 pixmap = XCreatePixmapFromBitmapData (dpy, window, (char *) macbomb_bits,
1567 macbomb_width, macbomb_height,
1568 bst->fg, bst->bg, bst->xgwa.depth);
1570 x = (bst->xgwa.width - pix_w) / 2;
1571 y = (bst->xgwa.height - pix_h) / 2;
1574 XClearWindow (dpy, window);
1575 XCopyArea (dpy, pixmap, window, bst->gc, 0, 0, pix_w, pix_h, x, y);
1581 /* This is what kernel panics looked like on MacOS X 10.0 through 10.1.5.
1582 In later releases, it's a graphic of a power button with text in
1583 English, French, German, and Japanese overlayed transparently.
1585 static struct bsod_state *
1586 macx_10_0 (Display *dpy, Window window)
1588 struct bsod_state *bst = make_bsod_state (dpy, window, "macx", "MacX");
1590 XClearWindow (dpy, window);
1591 XSetForeground (dpy, bst->gc,
1592 get_pixel_resource (dpy, bst->xgwa.colormap,
1593 "macx.textForeground",
1594 "MacX.TextForeground"));
1595 XSetBackground (dpy, bst->gc,
1596 get_pixel_resource (dpy, bst->xgwa.colormap,
1597 "macx.textBackground",
1598 "MacX.TextBackground"));
1604 int x, y, pix_w, pix_h;
1605 pixmap = xpm_data_to_pixmap (dpy, window, (char **) happy_mac,
1606 &pix_w, &pix_h, &mask);
1611 pixmap = double_pixmap (dpy, bst->gc, bst->xgwa.visual,
1612 bst->xgwa.depth, pixmap, pix_w, pix_h);
1613 mask = double_pixmap (dpy, bst->gc, bst->xgwa.visual,
1614 1, mask, pix_w, pix_h);
1620 x = (bst->xgwa.width - pix_w) / 2;
1621 y = (bst->xgwa.height - pix_h) / 2;
1623 XSetClipMask (dpy, bst->gc, mask);
1624 XSetClipOrigin (dpy, bst->gc, x, y);
1625 XCopyArea (dpy, pixmap, window, bst->gc, 0, 0, pix_w, pix_h, x, y);
1626 XSetClipMask (dpy, bst->gc, None);
1627 XFreePixmap (dpy, pixmap);
1631 bst->left_margin = 0;
1632 bst->right_margin = 0;
1633 bst->y = bst->font->ascent;
1634 bst->macx_eol_kludge = True;
1637 BSOD_PAUSE (bst, 3000000);
1638 BSOD_TEXT (bst, LEFT,
1639 "panic(cpu 0): Unable to find driver for this platform: "
1640 "\"PowerMac 3,5\".\n"
1642 "backtrace: 0x0008c2f4 0x0002a7a0 0x001f0204 0x001d4e4c 0x001d4c5c "
1643 "0x001a56cc 0x01d5dbc 0x001c621c 0x00037430 0x00037364\n"
1647 "No debugger configured - dumping debug information\n"
1649 "version string : Darwin Kernel Version 1.3:\n"
1650 "Thu Mar 1 06:56:40 PST 2001; root:xnu/xnu-123.5.obj~1/RELEASE_PPC\n"
1655 "DBAT0: 00000000 00000000\n"
1656 "DBAT1: 00000000 00000000\n"
1657 "DBAT2: 80001FFE 8000003A\n"
1658 "DBAT3: 90001FFE 9000003A\n"
1660 "backtrace: 0x0008c2f4 0x0002a7a0 0x001f0204 0x001d4e4c 0x001d4c5c "
1661 "0x001a56cc 0x01d5dbc 0x001c621c 0x00037430 0x00037364\n"
1663 "panic: We are hanging here...\n");
1670 static struct bsod_state *
1671 macx_10_2 (Display *dpy, Window window, Bool v10_3_p)
1673 struct bsod_state *bst = make_bsod_state (dpy, window, "macx", "MacX");
1676 int pix_w = 0, pix_h = 0;
1679 pixmap = xpm_data_to_pixmap (dpy, window,
1680 (char **) (v10_3_p ? osx_10_3 : osx_10_2),
1682 if (! pixmap) abort();
1685 if (bst->xgwa.height > 600) /* scale up the bitmap */
1687 pixmap = double_pixmap (dpy, bst->gc, bst->xgwa.visual, bst->xgwa.depth,
1688 pixmap, pix_w, pix_h);
1689 if (! pixmap) abort();
1696 BSOD_PAUSE (bst, 2000000);
1698 bst->pixmap = pixmap;
1700 x = (bst->xgwa.width - pix_w) / 2;
1701 y = ((bst->xgwa.height - pix_h) / 2);
1702 BSOD_PIXMAP (bst, 0, 0, pix_w, pix_h, x, y);
1706 # endif /* DO_XPM */
1709 /* 2006 Mac Mini with MacOS 10.6 failing with a bad boot drive. By jwz.
1711 static struct bsod_state *
1712 mac_diskfail (Display *dpy, Window window)
1714 struct bsod_state *bst = make_bsod_state (dpy, window, "macdisk", "Mac");
1715 int cw = (bst->font->per_char
1716 ? bst->font->per_char['n'-bst->font->min_char_or_byte2].width
1717 : bst->font->min_bounds.width);
1718 int h = bst->font->ascent + bst->font->descent;
1719 int L = (bst->xgwa.width - (cw * 80)) / 2;
1720 int T = (bst->xgwa.height - (h * 10)) / 2;
1722 unsigned long fg = bst->fg;
1723 unsigned long bg = bst->bg;
1724 unsigned long bg2 = get_pixel_resource (dpy, bst->xgwa.colormap,
1731 bst->scroll_p = True;
1733 BSOD_COLOR(bst, bg2, bg);
1734 BSOD_RECT (bst, True, 0, 0, bst->xgwa.width, bst->xgwa.height);
1735 BSOD_PAUSE (bst, 3000000);
1737 BSOD_COLOR(bst, bg, fg);
1738 BSOD_RECT (bst, True, 0, 0, bst->xgwa.width, bst->xgwa.height);
1739 BSOD_COLOR(bst, fg, bg);
1741 BSOD_MARGINS (bst, L, L);
1742 BSOD_MOVETO (bst, L, T);
1744 BSOD_TEXT (bst, LEFT,
1745 "efiboot loaded from device: Acpi(PNP0A03,0)/Pci*1F|2)/Ata"
1746 "(Primary,Slave)/HD(Part\n"
1747 "2,Sig8997E427-064E-4FE7-8CB9-F27A784B232C)\n"
1748 "boot file path: \\System\\Library\\CoreServices\\boot.efi\n"
1749 ".Loading kernel cache file 'System\\Library\\Caches\\"
1750 "com.apple.kext.caches\\Startup\\\n"
1751 "kernelcache_i386.2A14EC2C'\n"
1752 "Loading 'mach_kernel'...\n"
1754 BSOD_CHAR_DELAY (bst, 7000);
1755 BSOD_TEXT (bst, LEFT,
1756 ".....................\n"
1758 BSOD_CHAR_DELAY (bst, 0);
1759 BSOD_TEXT (bst, LEFT,
1760 "root device uuid is 'B62181B4-6755-3C27-BFA1-49A0E053DBD6\n"
1761 "Loading drivers...\n"
1762 "Loading System\\Library\\Caches\\com.apple.kext.caches\\"
1763 "Startup\\Extensions.mkext....\n"
1765 BSOD_CHAR_DELAY (bst, 7000);
1766 BSOD_TEXT (bst, LEFT,
1767 "..............................................................."
1768 ".................\n"
1769 "..............................................................."
1770 ".................\n"
1774 BSOD_RECT (bst, True, 0, 0, bst->xgwa.width, bst->xgwa.height);
1777 BSOD_MARGINS (bst, 0, 0);
1778 BSOD_MOVETO (bst, 0, h);
1780 BSOD_CHAR_DELAY (bst, 0);
1781 BSOD_LINE_DELAY (bst, 5000);
1782 BSOD_TEXT (bst, LEFT,
1785 "Darwin Kernel Version 10.8.9: Tue Jun 7 16:33:36 PDT 2011;"
1786 " root:xnu-1504.15.3~1/RELEASE_I386\n"
1787 "vm_page_bootstrap: 508036 free pages and 16252 wired pages\n"
1788 "standard timeslicing quantum is 10000 us\n"
1789 "mig_table_max_displ = 73\n"
1790 "AppleACPICPU: ProcessorId=0 LocalApicId=0 Enabled\n"
1791 "AppleACPICPU: ProcessorId=1 LocalApicId=1 Enabled\n"
1792 "calling npo_policy_init for Quarantine\n"
1793 "Security policy loaded: Quaantine policy (Quarantine)\n"
1794 "calling npo_policy_init for Sandbox\n"
1795 "Security policy loaded: Seatbelt sandbox policy (Sandbox)\n"
1796 "calling npo_policy_init for TMSafetyNet\n"
1797 "Security policy loaded: Safety net for Time Machine "
1799 "Copyright (c) 1982, 1986, 1989, 1991, 1993\n"
1800 "The Regents of the University of California. All rights "
1803 "MAC Framework successfully initialized\n"
1804 "using 10485 buffer headers and 4096 cluster IO buffer headers\n"
1805 "IOAPIC: Version 0x20 Vectors 64:87\n"
1806 "ACPI: System State [S0 S3 S4 S5] (S3)\n"
1807 "PFM64 0x10000000, 0xf0000000\n"
1808 "[ PCI configuration begin ]\n"
1809 "PCI configuration changed (bridge=1 device=1 cardbus=0)\n"
1810 "[ PCI configuration end, bridges 4 devices 17 ]\n"
1811 "nbinit: done (64 MB memory set for nbuf pool)\n"
1812 "rooting via boot-uuid from /chosen: "
1813 "B62181B4-6755-3C27-BFA1-49A0E053DBD6\n"
1814 "Waiting on <dict ID=\"0\"><key>IOProviderClass</key>"
1815 "<string ID=\"1\">IOResources</string><key>IOResourceMatch</key>"
1816 "<string ID=\"2\">boot-uuid-nedia</string></dict>\n"
1817 "com.apple.AppleFSCCompressionTypeZlib kmod start\n"
1818 "com.apple.AppleFSCCompressionTypeZlib kmod succeeded\n"
1819 "AppleIntelCPUPowerManagementClient: ready\n"
1820 "FireWire (OHCI) Lucent ID 5811 built-in now active, GUID "
1821 "0019e3fffe97f8b4; max speed s400.\n"
1822 "Got boot device = IOService:/AppleACPIPlatformExpert/PCI000/"
1823 "AppleACPIPCI/SATA@1F,2/AppleAHCI/PRI202/IOAHCIDevice@0/"
1824 "AppleAHCIDiskDriver/IOAHCIBlockStorageDevice/"
1825 "IOBlockStorageDriver/ST96812AS Media/IOGUIDPartitionScheme/"
1828 BSOD_PAUSE (bst, 1000000);
1829 BSOD_TEXT (bst, LEFT,
1830 "BSD root: Disk0s, major 14, minor 2\n"
1831 "[Bluetooth::CSRHIDTransition] switchtoHCIMode (legacy)\n"
1832 "[Bluetooth::CSRHIDTransition] transition complete.\n"
1833 "CSRUSBBluetoothHCIController::setupHardware super returned 0\n"
1835 BSOD_PAUSE (bst, 3000000);
1836 BSOD_TEXT (bst, LEFT,
1837 "disk0s2: I/O error.\n"
1838 "0 [Level 3] [ReadUID 0] [Facility com.apple.system.fs] "
1839 "[ErrType IO] [ErrNo 5] [IOType Read] [PBlkNum 48424] "
1840 "[LBlkNum 1362] [FSLogMsgID 2009724291] [FSLogMsgOrder First]\n"
1841 "0 [Level 3] [ReadUID 0] [Facility com.apple.system.fs] "
1842 "[DevNode root_device] [MountPt /] [FSLogMsgID 2009724291] "
1843 "[FSLogMsgOrder Last]\n"
1844 "panic(cpu 0 caller 0x47f5ad): \"Process 1 exec of /sbin/launchd"
1845 " failed, errno 5\\n\"0/SourceCache/xnu/xnu-1504.15.3/bsd/kern/"
1846 "kern_exec.c:3145\n"
1847 "Debugger called: <panic>\n"
1848 "Backtrace (CPU 0), Frame : Return Address (4 potential args "
1850 "0x34bf3e48 : 0x21b837 (0x5dd7fc 0x34bf3e7c 0x223ce1 0x0)\n"
1851 "0x34bf3e98 : 0x47f5ad (0x5cf950 0x831c08 0x5 0x0)\n"
1852 "0x34bf3ef8 : 0x4696d2 (0x4800d20 0x1fe 0x45a69a0 0x80000001)\n"
1853 "0x34bf3f38 : 0x48fee5 (0x46077a8 0x84baa0 0x34bf3f88 "
1855 "0x34bf3f68 : 0x219432 (0x46077a8 0xffffff7f 0x0 0x227c4b)\n"
1856 "0x34bf3fa8 : 0x2aacb4 (0xffffffff 0x1 0x22f8f5 0x227c4b)\n"
1857 "0x34bf3fc8 : 0x2a1976 (0x0 0x0 0x2a17ab 0x4023ef0)\n"
1859 "BSD process name corresponding to current thread: init\n"
1865 "Darwin Kernel version 10.8.0: Tue Jun 7 16:33:36 PDT 2011; "
1866 "root:xnu-1504.15-3~1/RELEASE_I386\n"
1867 "System model name: Macmini1,1 (Mac-F4208EC0)\n"
1869 "System uptime in nanoseconds: 13239332027\n"
1871 BSOD_CURSOR (bst, CURSOR_BLOCK, 500000, 999999);
1873 XClearWindow (dpy, window);
1880 static struct bsod_state *
1881 macx (Display *dpy, Window window)
1884 switch (random() % 4) {
1885 case 0: return macx_10_0 (dpy, window); break;
1886 case 1: return macx_10_2 (dpy, window, False); break;
1887 case 2: return macx_10_2 (dpy, window, True); break;
1888 case 3: return mac_diskfail (dpy, window); break;
1891 # else /* !DO_XPM */
1892 switch (random() % 2) {
1893 case 0: return macx_10_0 (dpy, window); break;
1894 default: return mac_diskfail (dpy, window); break;
1896 # endif /* !DO_XPM */
1900 #ifndef HAVE_COCOA /* #### I have no idea how to implement this without
1901 real plane-masks. I don't think it would look
1902 right if done with alpha-transparency... */
1905 * by Martin Pool <mbp@samba.org>, Feb 2000.
1907 * This is meant to look like the preferred failure mode of NCD
1908 * Xterms. The parameters for choosing what to copy where might not
1909 * be quite right, but it looks about ugly enough.
1911 static struct bsod_state *
1912 blitdamage (Display *dpy, Window window)
1914 struct bsod_state *bst =
1915 make_bsod_state (dpy, window, "blitdamage", "BlitDamage");
1918 int delta_x = 0, delta_y = 0;
1920 int chunk_h, chunk_w;
1926 w = bst->xgwa.width;
1927 h = bst->xgwa.height;
1929 gc_mask = GCForeground;
1931 XSetPlaneMask (dpy, bst->gc, random());
1934 chunk_w = w / (random() % 1 + 1);
1935 chunk_h = h / (random() % 1 + 1);
1936 if (random() & 0x1000)
1937 delta_y = random() % 600;
1938 if (!delta_y || (random() & 0x2000))
1939 delta_x = random() % 600;
1946 for (i = 0; i < steps; i++) {
1947 if (x + chunk_w > w)
1952 if (y + chunk_h > h)
1957 BSOD_COPY (bst, src_x, src_y, chunk_w, chunk_h, x, y);
1958 BSOD_PAUSE (bst, 1000);
1963 #endif /* !HAVE_COCOA */
1967 * OS/2 panics, by Knut St. Osmundsen <bird-xscreensaver@anduin.net>
1969 * All but one messages are real ones, some are from my test machines
1970 * and system dumps, others are reconstructed from google results.
1971 * Please, don't be to hard if the formatting of the earlier systems
1972 * aren't 100% correct.
1974 static struct bsod_state *
1975 os2 (Display *dpy, Window window)
1977 struct bsod_state *bst = make_bsod_state (dpy, window, "os2", "OS2");
1980 static const char * const os2_panics[] =
1981 { /* OS/2 2.0 trap - details are bogus (CR0++). */
1982 "TRAP 0002 ERRCD=0000 ERACC=**** ERLIM=********\n"
1983 "EAX=7d240a58 EBX=ff202fdc ECX=00064423 EDX=00003624\n"
1984 "ESI=fff3272c EDI=7d240004 EBP=00004a44 FLG=00003202\n"
1985 "CS:EIP=0160:fff702a6 CSACC=c09d CSLIM=ffffffff\n"
1986 "SS:ESP=0030:00004a38 SSACC=1097 SSLIM=00003fff\n"
1987 "DS=0158 DSACC=c0f3 DSLIM=ffffffff CR0=fffffffb\n"
1988 "ES=0158 ESACC=c0f3 ESLIM=ffffffff CR2=1a060014\n"
1989 "FS=0000 FSACC=**** FSLIM=********\n"
1990 "GS=0000 GSACC=**** GSLIM=********\n"
1992 "The system detected an internal processing error\n"
1993 "at location ##0160:fff6453f - 000d:a53f\n"
1997 "Internal revision 6.307, 92/03/01\n"
2000 /* warp 3 (early) */
2001 "TRAP 000e ERRCD=0000 ERACC=**** ERLIM=********\n"
2002 "EAX=ff050c20 EBX=000000bb ECX=ffff00c1 EDx=fff379b8\n"
2003 "ESI=ffe55a3c EDI=00000000 EBP=00004eb8 FLG=00013282\n"
2004 "CS:EIP=0160:fff8dbb8 CSACC=c09b CSLIM=ffffffff\n"
2005 "SS:EIP=0030:00004eb4 SSACC=1097 SSLIM=00003fff\n"
2006 "DS=0158 DSACC=c0f3 DSLIM=ffffffff CR0=8001001b\n"
2007 "ES=0158 DSACC=c0f3 DSLIM=ffffffff CR2=000000c7\n"
2008 "FS=0000 FSACC=**** FSLIM=********\n"
2009 "GS=0000 GSACC=**** GSLIM=********\n"
2011 "The system detected an internal processing error\n"
2012 "at location ##0160:fff66bf0 - 000d:9bf0.\n"
2016 "Internal revision 8.125, 94/02/16\n"
2018 "The system is stopped. Record the location number of the error\n"
2019 "and contact your service representative.\n",
2022 "TRAP 000e ERRCD=0002 ERACC=**** ERLIM=********\n"
2023 "EAX=00000000 EBX=fdef1e0c ECX=00003824 EDX=0000edf9\n"
2024 "ESI=fdf30e80 EDI=fc8b0000 EBP=00005658 FLG=00012246\n"
2025 "CS:EIP=0160:fff8ada3 CSACC=c09b CSLIM=ffffffff\n"
2026 "SS:ESP=0030:000055d4 SSACC=1097 SSLIM=0000480f\n"
2027 "DS=0158 DSACC=c093 DSLIM=ffffffff CR0=8001001b\n"
2028 "ES=0158 ESACC=c093 ESLIM=ffffffff CR2=fc8b0000\n"
2029 "FS=03b8 FSACC=0093 FSLIM=00000023\n"
2030 "GS=0000 GSACC=**** GSLIM=********\n"
2032 "The system detected an internal processing error\n"
2033 "at location ##0160:fff5c364 - 000d:a364.\n"
2037 "Internal revision 8200,94/11/07\n"
2039 "The system is stopped. Record all of the above information and\n"
2040 "contact your service representative.\n",
2043 "TRAP 000d ERRCD=2200 ERACC=1092 ERLIM=00010fff\n"
2044 "EAX=0000802e EBX=fff001c8 ECX=9bd80000 EDX=00000000\n"
2045 "ESI=fff09bd8 EDI=fdeb001b EBP=00000000 FLG=00012012\n"
2046 "CS:EIP=0168:fff480a2 CSACC=c09b CSLIM=ffffffff\n"
2047 "SS:ESP=00e8:00001f32 SSACC=0093 SSLIM=00001fff\n"
2048 "DS=0940 DSACC=0093 DSLIM=00000397 CR0=8001001b\n"
2049 "ES=00e8 ESACC=0093 ESLIM=00001fff CR2=15760008\n"
2050 "FS=0000 FSACC=**** FSLIM=****\n"
2051 "GS=0000 GSACC=**** GSLIM=****\n"
2053 "The system detected an internal processing error\n"
2054 "at location ##0168:fff4b06e - 000e:c06e\n"
2058 "Internal revision 8.259_uni,98/01/07\n"
2060 "The system is stopped. Record all of the above information and\n"
2061 "contact your service representative.\n",
2063 /* Warp 4.52+ - the official r0trap.exe from the debugging classes */
2064 "Exception in module: OS2KRNL\n"
2065 "TRAP 000e ERRCD=0002 ERACC=**** ERLIM=********\n"
2066 "EAX=00000001 EBX=80010002 ECX=ffed4638 EDX=0003f17b\n"
2067 "ESI=00000001 EDI=00000002 EBP=00005408 FLG=00012202\n"
2068 "CS:EIP=0168:fff3cd2e CSACC=c09b CSLIM=ffffffff\n"
2069 "SS:ESP=0030:000053ec SSACC=1097 SSLIM=000044ff\n"
2070 "DS=0160 DSACC=c093 DSLIM=ffffffff CR0=8001001b\n"
2071 "ES=0160 ESACC=c093 ESLIM=ffffffff CR2=00000001\n"
2072 "FS=0000 FSACC=**** FSLIM=********\n"
2073 "GS=0000 GSACC=**** GSLIM=********\n"
2075 "The system detected an internal processing error at\n"
2076 "location ##0168:fff1e3f3 - 000e:c3f3.\n"
2080 "Internal revision 14.097_UNI\n"
2082 "The system is stopped. Record all of the above information and\n"
2083 "contact your service representative.\n",
2085 /* Warp 4.52+, typical JFS problem. */
2086 "Exeption in module: JFS\n"
2087 "TRAP 0003 ERRCD=0000 ERACC=**** ERLIM=********\n"
2088 "EAX=00000000 EBX=ffffff05 ECX=00000001 EDX=f5cd8010\n"
2089 "ESI=000000e6 EDI=000000e7 EBP=f9c7378e FLG=00002296\n"
2090 "CS:EIP=0168:f8df3250 CSACC=c09b CSLIM=ffffffff\n"
2091 "SS:ESP=1550:fdc73778 SSACC=c093 SSLIM=ffffffff\n"
2092 "DS=0160 DSACC=c093 DSLIM=ffffffff CR0=80010016\n"
2093 "ES=0160 ESACC=c093 DSLIM=ffffffff CR2=05318000\n"
2094 "FS=03c0 FSACC=0093 DSLIM=00000023\n"
2095 "GS=0160 GSACC=c093 DSLIM=ffffffff\n"
2097 "The system detected an internal processing error\n"
2098 "at location ##0168:fff1e2ab - 000e:c2ab.\n"
2103 "Internal revision 14.100c_UNI\n"
2105 "The system is stopped. Record all of the above information and\n"
2106 "contact your service representative.\n"
2109 BSOD_TEXT (bst, LEFT, os2_panics[random() % countof(os2_panics)]);
2110 BSOD_CURSOR (bst, CURSOR_LINE, 240000, 999999);
2112 XClearWindow (dpy, window);
2117 /* SPARC Solaris panic. Should look pretty authentic on Solaris boxes.
2118 * Anton Solovyev <solovam@earthlink.net>
2120 static struct bsod_state *
2121 sparc_solaris (Display *dpy, Window window)
2123 struct bsod_state *bst = make_bsod_state (dpy, window, "solaris", "Solaris");
2126 bst->scroll_p = True;
2128 bst->left_margin = bst->right_margin = bst->xgwa.width * 0.07;
2129 bst->top_margin = bst->bottom_margin = bst->xgwa.height * 0.07;
2130 bst->y = bst->top_margin + bst->font->ascent;
2133 BSOD_PAUSE (bst, 3000000);
2136 BSOD_RECT (bst, True,
2137 bst->left_margin, bst->top_margin,
2138 bst->xgwa.width - bst->left_margin - bst->right_margin,
2139 bst->xgwa.height - bst->top_margin - bst->bottom_margin);
2142 BSOD_TEXT (bst, LEFT,
2143 "BAD TRAP: cpu=0 type=0x31 rp=0x2a10043b5e0 addr=0xf3880 mmu_fsr=0x0\n"
2144 "BAD TRAP occurred in module \"unix\" due to an illegal access to a"
2146 "adb: trap type = 0x31\n"
2148 "pid=307, pc=0x100306e4, sp=0x2a10043ae81, tstate=0x4480001602,"
2150 "g1-g7: 1045b000, 32f, 10079440, 180, 300000ebde8, 0, 30000953a20\n"
2151 "Begin traceback... sp = 2a10043ae81\n"
2152 "Called from 100bd060, fp=2a10043af31, args=f3700 300008cc988 f3880 0"
2154 "Called from 101fe1bc, fp=2a10043b011, args=3000045a240 104465a0"
2155 " 300008e47d0 300008e48fa 300008ae350 300008ae410\n"
2156 "Called from 1007c520, fp=2a10043b0c1, args=300008e4878 300003596e8 0"
2157 " 3000045a320 0 3000045a220\n"
2158 "Called from 1007c498, fp=2a10043b171, args=1045a000 300007847f0 20"
2159 " 3000045a240 1 0\n"
2160 "Called from 1007972c, fp=2a10043b221, args=1 300009517c0 30000951e58 1"
2162 "Called from 10031e10, fp=2a10043b2d1, args=3000095b0c8 0 300009396a8"
2163 " 30000953a20 0 1\n"
2164 "Called from 10000bdd8, fp=ffffffff7ffff1c1, args=0 57 100131480"
2165 " 100131480 10012a6e0 0\n"
2166 "End traceback...\n"
2167 "panic[cpu0]/thread=30000953a20: trap\n"
2168 "syncing file systems...");
2170 BSOD_PAUSE (bst, 3000000);
2172 BSOD_TEXT (bst, LEFT, " 1 done\n");
2173 BSOD_TEXT (bst, LEFT, "dumping to /dev/dsk/c0t0d0s3, offset 26935296\n");
2174 BSOD_PAUSE (bst, 2000000);
2177 for (i = 1; i <= 100; ++i)
2180 sprintf (buf, "\b\b\b\b\b\b\b\b\b\b\b%3d%% done", i);
2181 BSOD_TEXT (bst, LEFT, buf);
2182 BSOD_PAUSE (bst, 100000);
2185 BSOD_TEXT (bst, LEFT,
2186 ": 2803 pages dumped, compression ratio 2.88, dump succeeded\n");
2187 BSOD_PAUSE (bst, 2000000);
2189 BSOD_TEXT (bst, LEFT,
2197 /* Linux panic and fsck, by jwz
2199 static struct bsod_state *
2200 linux_fsck (Display *dpy, Window window)
2202 struct bsod_state *bst = make_bsod_state (dpy, window, "linux", "Linux");
2205 const char *sysname;
2208 const char *linux_panic[] = {
2209 " kernel: Unable to handle kernel paging request at virtual "
2210 "address 0000f0ad\n",
2211 " kernel: printing eip:\n",
2212 " kernel: c01becd7\n",
2213 " kernel: *pde = 00000000\n",
2214 " kernel: Oops: 0000\n",
2215 " kernel: CPU: 0\n",
2216 " kernel: EIP: 0010:[<c01becd7>] Tainted: P \n",
2217 " kernel: EFLAGS: 00010286\n",
2218 " kernel: eax: 0000ff00 ebx: ca6b7e00 ecx: ce1d7a60 edx: ce1d7a60\n",
2219 " kernel: esi: ca6b7ebc edi: 00030000 ebp: d3655ca0 esp: ca6b7e5c\n",
2220 " kernel: ds: 0018 es: 0018 ss: 0018\n",
2221 " kernel: Process crond (pid: 1189, stackpage=ca6b7000)\n",
2222 " kernel: Stack: d3655ca0 ca6b7ebc 00030054 ca6b7e7c c01c1e5b "
2223 "00000287 00000020 c01c1fbf \n",
2225 " kernel: 00005a36 000000dc 000001f4 00000000 00000000 "
2226 "ce046d40 00000001 00000000 \n",
2228 " kernel: ffffffff d3655ca0 d3655b80 00030054 c01bef93 "
2229 "d3655ca0 ca6b7ebc 00030054 \n",
2231 " kernel: Call Trace: [<c01c1e5b>] [<c01c1fbf>] [<c01bef93>] "
2232 "[<c01bf02b>] [<c0134c4f>]\n",
2234 " kernel: [<c0142562>] [<c0114f8c>] [<c0134de3>] [<c010891b>]\n",
2236 " kernel: Code: 2a 00 75 08 8b 44 24 2c 85 c0 74 0c 8b 44 24 58 83 48 18 "
2241 bst->scroll_p = True;
2243 bst->left_margin = bst->right_margin = 10;
2244 bst->top_margin = bst->bottom_margin = 10;
2251 if (uname (&uts) >= 0)
2252 sysname = uts.nodename;
2253 s = strchr (sysname, '.');
2256 # endif /* !HAVE_UNAME */
2259 BSOD_TEXT (bst, LEFT, "waiting for X server to shut down ");
2260 BSOD_PAUSE (bst, 100000);
2261 BSOD_TEXT (bst, LEFT,
2262 "XIO: fatal IO error 2 (broken pipe) on X server \":0.0\"\n"
2263 " after 339471 requests (339471 known processed) "
2264 "with 0 events remaining\n");
2265 BSOD_CHAR_DELAY (bst, 300000);
2266 BSOD_TEXT (bst, LEFT, ".........\n");
2267 BSOD_CHAR_DELAY (bst, 0);
2268 BSOD_TEXT (bst, LEFT,
2269 "xinit: X server slow to shut down, sending KILL signal.\n"
2270 "waiting for server to die ");
2271 BSOD_CHAR_DELAY (bst, 300000);
2272 BSOD_TEXT (bst, LEFT, "...\n");
2273 BSOD_CHAR_DELAY (bst, 0);
2274 BSOD_TEXT (bst, LEFT, "xinit: Can't kill server\n");
2275 BSOD_PAUSE (bst, 2000000);
2277 sprintf (buf, "\n%s Login: ", sysname);
2278 BSOD_TEXT (bst, LEFT, buf);
2279 BSOD_PAUSE (bst, 1000000);
2280 BSOD_TEXT (bst, LEFT,
2282 "Parallelizing fsck version 1.22 (22-Jun-2001)\n"
2283 "e2fsck 1.22, 22-Jun-2001 for EXT2 FS 0.5b, 95/08/09\n"
2284 "Warning! /dev/hda1 is mounted.\n"
2285 "/dev/hda1 contains a file system with errors, check forced.\n");
2286 BSOD_PAUSE (bst, 1000000);
2288 if (0 == random() % 2)
2289 BSOD_TEXT (bst, LEFT,
2290 "Couldn't find ext2 superblock, trying backup blocks...\n"
2291 "The filesystem size (according to the superblock) is 3644739 blocks\n"
2292 "The physical size of the device is 3636706 blocks\n"
2293 "Either the superblock or the partition table is likely to be corrupt!\n"
2295 BSOD_PAUSE (bst, 1000000);
2299 BSOD_TEXT (bst, LEFT, "Pass 1: Checking inodes, blocks, and sizes\n");
2300 BSOD_PAUSE (bst, 2000000);
2302 i = (random() % 60) - 20;
2305 int b = random() % 0xFFFF;
2306 sprintf (buf, "Deleted inode %d has zero dtime. Fix<y>? yes\n\n", b);
2307 BSOD_TEXT (bst, LEFT, buf);
2308 BSOD_PAUSE (bst, 1000);
2311 i = (random() % 40) - 10;
2314 int g = random() % 0xFFFF;
2315 int b = random() % 0xFFFFFFF;
2317 BSOD_PAUSE (bst, 1000000);
2319 sprintf (buf, "Warning: Group %d's copy of the group descriptors "
2320 "has a bad block (%d).\n", g, b);
2321 BSOD_TEXT (bst, LEFT, buf);
2323 b = random() % 0x3FFFFF;
2326 b += random() % 0xFFFF;
2328 "Error reading block %d (Attempt to read block "
2329 "from filesystem resulted in short read) while doing "
2330 "inode scan. Ignore error<y>?",
2332 BSOD_TEXT (bst, LEFT, buf);
2333 BSOD_PAUSE (bst, 10000);
2334 BSOD_TEXT (bst, LEFT, " yes\n\n");
2338 if (0 == (random() % 10))
2340 BSOD_PAUSE (bst, 1000000);
2342 i = 3 + (random() % 10);
2345 BSOD_TEXT (bst, LEFT,
2346 "Could not allocate 256 block(s) for inode table: "
2347 "No space left on device\n");
2348 BSOD_PAUSE (bst, 1000);
2350 BSOD_TEXT (bst, LEFT, "Restarting e2fsck from the beginning...\n");
2351 BSOD_PAUSE (bst, 2000000);
2356 i = (random() % 20) - 5;
2359 BSOD_PAUSE (bst, 1000000);
2363 int j = 5 + (random() % 10);
2364 int w = random() % 4;
2368 int b = random() % 0xFFFFF;
2369 int g = random() % 0xFFF;
2371 if (0 == (random() % 10))
2373 else if (0 == (random() % 10))
2378 "Inode table for group %d not in group. (block %d)\n"
2379 "WARNING: SEVERE DATA LOSS POSSIBLE.\n"
2384 "Block bitmap for group %d not in group. (block %d)\n"
2389 "Inode bitmap %d for group %d not in group.\n"
2392 else /* if (w == 3) */
2394 "Bad block %d in group %d's inode table.\n"
2395 "WARNING: SEVERE DATA LOSS POSSIBLE.\n"
2399 BSOD_TEXT (bst, LEFT, buf);
2400 BSOD_TEXT (bst, LEFT, " yes\n\n");
2401 BSOD_PAUSE (bst, 1000);
2406 if (0 == random() % 10) goto PANIC;
2407 BSOD_TEXT (bst, LEFT, "Pass 2: Checking directory structure\n");
2408 BSOD_PAUSE (bst, 2000000);
2410 i = (random() % 20) - 5;
2413 int n = random() % 0xFFFFF;
2414 int o = random() % 0xFFF;
2415 sprintf (buf, "Directory inode %d, block 0, offset %d: "
2416 "directory corrupted\n"
2419 BSOD_TEXT (bst, LEFT, buf);
2420 BSOD_PAUSE (bst, 1000);
2421 BSOD_TEXT (bst, LEFT, " yes\n\n");
2423 if (0 == (random() % 100))
2425 sprintf (buf, "Missing '.' in directory inode %d.\nFix<y>?", n);
2426 BSOD_TEXT (bst, LEFT, buf);
2427 BSOD_PAUSE (bst, 1000);
2428 BSOD_TEXT (bst, LEFT, " yes\n\n");
2432 if (0 == random() % 10)
2435 BSOD_TEXT (bst, LEFT,
2436 "Pass 3: Checking directory connectivity\n"
2437 "/lost+found not found. Create? yes\n");
2438 BSOD_PAUSE (bst, 2000000);
2440 /* Unconnected directory inode 4949 (/var/spool/squid/06/???)
2441 Connect to /lost+found<y>? yes
2443 '..' in /var/spool/squid/06/08 (20351) is <The NULL inode> (0), should be
2444 /var/spool/squid/06 (20350).
2447 Unconnected directory inode 128337 (/var/spool/squid/06/???)
2448 Connect to /lost+found<y>? yes
2452 if (0 == random() % 10) goto PANIC;
2453 BSOD_TEXT (bst, LEFT, "Pass 4: Checking reference counts\n");
2454 BSOD_PAUSE (bst, 2000000);
2456 /* Inode 2 ref count is 19, should be 20. Fix<y>? yes
2458 Inode 4949 ref count is 3, should be 2. Fix<y>? yes
2462 Inode 128336 ref count is 3, should be 2. Fix<y>? yes
2464 Inode 128337 ref count is 3, should be 2. Fix<y>? yes
2469 if (0 == random() % 10) goto PANIC;
2470 BSOD_TEXT (bst, LEFT, "Pass 5: Checking group summary information\n");
2471 BSOD_PAUSE (bst, 2000000);
2473 i = (random() % 200) - 50;
2476 BSOD_TEXT (bst, LEFT, "Block bitmap differences: ");
2479 sprintf (buf, " %d", -(random() % 0xFFF));
2480 BSOD_TEXT (bst, LEFT, buf);
2481 BSOD_PAUSE (bst, 1000);
2483 BSOD_TEXT (bst, LEFT, "\nFix? yes\n\n");
2487 i = (random() % 100) - 50;
2490 BSOD_TEXT (bst, LEFT, "Inode bitmap differences: ");
2493 sprintf (buf, " %d", -(random() % 0xFFF));
2494 BSOD_TEXT (bst, LEFT, buf);
2495 BSOD_PAUSE (bst, 1000);
2497 BSOD_TEXT (bst, LEFT, "\nFix? yes\n\n");
2500 i = (random() % 20) - 5;
2503 int g = random() % 0xFFFF;
2504 int c = random() % 0xFFFF;
2506 "Free blocks count wrong for group #0 (%d, counted=%d).\nFix? ",
2508 BSOD_TEXT (bst, LEFT, buf);
2509 BSOD_PAUSE (bst, 1000);
2510 BSOD_TEXT (bst, LEFT, " yes\n\n");
2516 BSOD_TEXT (bst, LEFT, "\n\n");
2517 while (linux_panic[i])
2519 time_t t = time ((time_t *) 0);
2520 struct tm *tm = localtime (&t);
2523 if (*linux_panic[i])
2525 strftime (prefix, sizeof(prefix)-1, "%b %d %H:%M:%S ", tm);
2526 BSOD_TEXT (bst, LEFT, prefix);
2527 BSOD_TEXT (bst, LEFT, sysname);
2528 BSOD_TEXT (bst, LEFT, linux_panic[i]);
2529 BSOD_PAUSE (bst, 1000);
2532 BSOD_PAUSE (bst, 300000);
2536 BSOD_PAUSE (bst, 4000000);
2538 XClearWindow(dpy, window);
2544 * Linux (hppa) panic, by Stuart Brady <sdbrady@ntlworld.com>
2545 * Output courtesy of M. Grabert
2547 static struct bsod_state *
2548 hppa_linux (Display *dpy, Window window)
2550 struct bsod_state *bst =
2551 make_bsod_state (dpy, window, "hppalinux", "HPPALinux");
2554 const char *release, *sysname, *gccversion, *version;
2555 long int linedelay = 0;
2558 struct { long int delay; const char *string; } linux_panic[] =
2559 {{ 0, "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
2560 "\n\n\n\n\n\n\n\n\n\n\n\n\n" },
2561 { 0, "Linux version %s (root@%s) (gcc version %s) %s\n" },
2562 { 4000, "FP[0] enabled: Rev 1 Model 16\n" },
2563 { 10, "The 32-bit Kernel has started...\n" },
2564 { -1, "Determining PDC firmware type: System Map.\n" },
2565 { -1, "model 00005bb0 00000481 00000000 00000002 7778df9f 100000f0 "
2566 "00000008 000000b2 000000b2\n" },
2567 { -1, "vers 00000203\n" },
2568 { -1, "CPUID vers 17 rev 7 (0x00000227)\n" },
2569 { -1, "capabilities 0x3\n" },
2570 { -1, "model 9000/785/C3000\n" },
2571 { -1, "Total Memory: 1024 Mb\n" },
2572 { -1, "On node 0 totalpages: 262144\n" },
2573 { -1, " DMA zone: 262144 pages, LIFO batch:16\n" },
2574 { -1, " Normal zone: 0 pages, LIFO batch:1\n" },
2575 { -1, " HighMem zone: 0 pages, LIFO batch:1\n" },
2576 { -1, "LCD display at f05d0008,f05d0000 registered\n" },
2577 { -1, "Building zonelist for node : 0\n" },
2578 { -1, "Kernel command line: ide=nodma root=/dev/sda3 HOME=/ ip=off "
2579 "console=ttyS0 TERM=vt102 palo_kernel=2/vmlinux-2.6\n" },
2580 { -1, "ide_setup: ide=nodmaIDE: Prevented DMA\n" },
2581 { -1, "PID hash table entries: 16 (order 4: 128 bytes)\n" },
2582 {500, "Console: colour dummy device 160x64\n" },
2583 { 10, "Memory: 1034036k available\n" },
2584 { -1, "Calibrating delay loop... 796.67 BogoMIPS\n" },
2585 { -1, "Dentry cache hash table entries: 131072 (order: 7, 524288 "
2587 { -1, "Inode-cache hash table entries: 65536 (order: 6, 262144 "
2589 { -1, "Mount-cache hash table entries: 512 (order: 0, 4096 bytes)\n" },
2590 { -1, "POSIX conformance testing by UNIFIX\n" },
2591 { -1, "NET: Registered protocol family 16\n" },
2592 { 100, "Searching for devices...\n" },
2593 { 25, "Found devices:\n" },
2594 { 10, "1. Astro BC Runway Port at 0xfed00000 [10] "
2595 "{ 12, 0x0, 0x582, 0x0000b }\n" },
2596 { -1, "2. Elroy PCI Bridge at 0xfed30000 [10/0] "
2597 "{ 13, 0x0, 0x782, 0x0000a }\n" },
2598 { -1, "3. Elroy PCI Bridge at 0xfed32000 [10/1] "
2599 "{ 13, 0x0, 0x782, 0x0000a }\n" },
2600 { -1, "4. Elroy PCI Bridge at 0xfed38000 [10/4] "
2601 "{ 13, 0x0, 0x782, 0x0000a }\n" },
2602 { -1, "5. Elroy PCI Bridge at 0xfed3c000 [10/6] "
2603 "{ 13, 0x0, 0x782, 0x0000a }\n" },
2604 { -1, "6. AllegroHigh W at 0xfffa0000 [32] "
2605 "{ 0, 0x0, 0x5bb, 0x00004 }\n" },
2606 { -1, "7. Memory at 0xfed10200 [49] { 1, 0x0, 0x086, 0x00009 }\n" },
2607 { -1, "CPU(s): 1 x PA8500 (PCX-W) at 400.000000 MHz\n" },
2608 { -1, "SBA found Astro 2.1 at 0xfed00000\n" },
2609 { -1, "lba version TR2.1 (0x2) found at 0xfed30000\n" },
2610 { -1, "lba version TR2.1 (0x2) found at 0xfed32000\n" },
2611 { -1, "lba version TR2.1 (0x2) found at 0xfed38000\n" },
2612 { -1, "lba version TR2.1 (0x2) found at 0xfed3c000\n" },
2613 { 100, "SCSI subsystem initialized\n" },
2614 { 10, "drivers/usb/core/usb.c: registered new driver usbfs\n" },
2615 { -1, "drivers/usb/core/usb.c: registered new driver hub\n" },
2616 { -1, "ikconfig 0.7 with /proc/config*\n" },
2617 { -1, "Initializing Cryptographic API\n" },
2618 { 250, "SuperIO: probe of 0000:00:0e.0 failed with error -1\n" },
2619 { 20, "SuperIO: Found NS87560 Legacy I/O device at 0000:00:0e.1 "
2621 { -1, "SuperIO: Serial port 1 at 0x3f8\n" },
2622 { -1, "SuperIO: Serial port 2 at 0x2f8\n" },
2623 { -1, "SuperIO: Parallel port at 0x378\n" },
2624 { -1, "SuperIO: Floppy controller at 0x3f0\n" },
2625 { -1, "SuperIO: ACPI at 0x7e0\n" },
2626 { -1, "SuperIO: USB regulator enabled\n" },
2627 { -1, "SuperIO: probe of 0000:00:0e.2 failed with error -1\n" },
2628 { -1, "Soft power switch enabled, polling @ 0xf0400804.\n" },
2629 { -1, "pty: 256 Unix98 ptys configured\n" },
2630 { -1, "Generic RTC Driver v1.07\n" },
2631 { -1, "Serial: 8250/16550 driver $Revision: 1.101 $ 13 ports, "
2632 "IRQ sharing disabled\n" },
2633 { -1, "ttyS0 at I/O 0x3f8 (irq = 0) is a 16550A\n" },
2634 { -1, "ttyS1 at I/O 0x2f8 (irq = 0) is a 16550A\n" },
2635 { -1, "Linux Tulip driver version 1.1.13 (May 11, 2002)\n" },
2636 { 150, "tulip0: no phy info, aborting mtable build\n" },
2637 { 10, "tulip0: MII transceiver #1 config 1000 status 782d "
2638 "advertising 01e1.\n" },
2639 { -1, "eth0: Digital DS21143 Tulip rev 65 at 0xf4008000, "
2640 "00:10:83:F9:B4:34, IRQ 66.\n" },
2641 { -1, "Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2\n" },
2642 { -1, "ide: Assuming 33MHz system bus speed for PIO modes; "
2643 "override with idebus=xx\n" },
2644 { 100, "SiI680: IDE controller at PCI slot 0000:01:06.0\n" },
2645 { 10, "SiI680: chipset revision 2\n" },
2646 { -1, "SiI680: BASE CLOCK == 133\n" },
2647 { -1, "SiI680: 100% native mode on irq 128\n" },
2648 { -1, " ide0: MMIO-DMA at 0xf4800000-0xf4800007 -- "
2649 "Error, MMIO ports already in use.\n" },
2650 { -1, " ide1: MMIO-DMA at 0xf4800008-0xf480000f -- "
2651 "Error, MMIO ports already in use.\n" },
2652 { 5, "hda: TS130220A2, ATA DISK drive\n" },
2653 { -1, " _______________________________\n" },
2654 { -1, " < Your System ate a SPARC! Gah! >\n" },
2655 { -1, " -------------------------------\n" },
2656 { -1, " \\ ^__^\n" },
2657 { -1, " \\ (xx)\\_______\n" },
2658 { -1, " (__)\\ )\\/\\\n" },
2659 { -1, " U ||----w |\n" },
2661 { -1, "swapper (pid 1): Breakpoint (code 0)\n" },
2663 { -1, " YZrvWESTHLNXBCVMcbcbcbcbOGFRQPDI\n" },
2664 { -1, "PSW: 00000000000001001111111100001111 Not tainted\n" },
2665 { -1, "r00-03 4d6f6f21 1032f010 10208f34 103fc2e0\n" },
2666 { -1, "r04-07 103fc230 00000001 00000001 0000000f\n" },
2667 { -1, "r08-11 103454f8 000f41fa 372d3980 103ee404\n" },
2668 { -1, "r12-15 3ccbf700 10344810 103ee010 f0400004\n" },
2669 { -1, "r16-19 f00008c4 f000017c f0000174 00000000\n" },
2670 { -1, "r20-23 fed32840 fed32800 00000000 0000000a\n" },
2671 { -1, "r24-27 0000ffa0 000000ff 103fc2e0 10326010\n" },
2672 { -1, "r28-31 00000000 00061a80 4ff98340 10208f34\n" },
2673 { -1, "sr0-3 00000000 00000000 00000000 00000000\n" },
2674 { -1, "sr4-7 00000000 00000000 00000000 00000000\n" },
2676 { -1, "IASQ: 00000000 00000000 IAOQ: 00000000 00000004\n" },
2677 { -1, " IIR: 00000000 ISR: 00000000 IOR: 00000000\n" },
2678 { -1, " CPU: 0 CR30: 4ff98000 CR31: 1037c000\n" },
2679 { -1, " ORIG_R28: 55555555\n" },
2680 { -1, " IAOQ[0]: 0x0\n" },
2681 { -1, " IAOQ[1]: 0x4\n" },
2682 { -1, " RP(r2): probe_hwif+0x218/0x44c\n" },
2683 { -1, "Kernel panic: Attempted to kill init!\n" },
2686 bst->scroll_p = True;
2688 bst->left_margin = bst->right_margin = 10;
2689 bst->top_margin = bst->bottom_margin = 10;
2691 release = "2.6.0-test11-pa2";
2693 version = "#2 Mon Dec 8 06:09:27 GMT 2003";
2698 if (uname (&uts) >= 0)
2700 sysname = uts.nodename;
2701 if (!strcmp (uts.sysname, "Linux"))
2703 release = uts.release;
2704 version = uts.version;
2707 s = strchr (sysname, '.');
2710 # endif /* !HAVE_UNAME */
2712 # if (defined (__GNUC__) && defined (__VERSION__))
2713 gccversion = __VERSION__;
2714 # else /* !(defined (__GNUC__) && defined (__VERSION__)) */
2715 gccversion = "3.3.2 (Debian)";
2716 # endif /* !(defined (__GNUC__) && defined (__VERSION__)) */
2718 /* Insert current host name into banner on line 2 */
2721 snprintf (ss, 1024, linux_panic[1].string,
2722 release, sysname, gccversion, version);
2723 linux_panic[1].string = ss;
2726 BSOD_PAUSE (bst, 100000);
2727 while (linux_panic[i].string)
2729 if (linux_panic[i].delay != -1)
2730 linedelay = linux_panic[i].delay * 1000;
2731 BSOD_PAUSE (bst, linedelay);
2732 BSOD_TEXT (bst, LEFT, linux_panic[i].string);
2736 bst->y = bst->xgwa.height - bst->font->ascent - bst->font->descent;
2738 XClearWindow(dpy, window);
2743 /* VMS by jwz (text sent by Roland Barmettler <roli@barmettler.net>)
2745 static struct bsod_state *
2746 vms (Display *dpy, Window window)
2748 struct bsod_state *bst = make_bsod_state (dpy, window, "vms", "VMS");
2750 const char *sysname;
2752 int dot_delay = 40000;
2753 int chunk_delay = 500000;
2760 const char *lines[] = {
2761 "%CNXMAN, Lost connection to system #\n"
2762 "%SHADOW-I-VOLPROC, DSA0: shadow master has changed. "
2763 "Dump file WILL be written if system crashes.\n"
2767 "%CNXMAN, Quorum lost, blocking activity\n"
2768 "%CNXMAN, Timed-out lost connection to system #\n"
2769 "%CNXMAN, Timed-out lost connection to system #\n"
2770 "%CNXMAN, Timed-out lost connection to system #\n"
2771 "%CNXMAN, Proposing reconfiguration of the VMScluster\n",
2774 "%CNXMAN, Removed from VMScluster system #\n"
2775 "%CNXMAN, Removed from VMScluster system #\n"
2776 "%CNXMAN, Removed from VMScluster system #\n"
2777 "%CNXMAN, Completing VMScluster state transition\n",
2780 "**** OpenVMS (TM) Alpha Operating system V7.3-1 - BUGCHECK ****\n"
2782 "** Bugcheck code = 000005DC: CLUEXIT, Node voluntarily exiting "
2784 "** Crash CPU: 00 Primary CPU: 00 Active CPUs: 00000001\n"
2785 "** Current Process = NULL\n"
2786 "** Current PSB ID = 00000001\n"
2789 "** Dumping error log buffers to HBVS unit 0\n"
2790 "**** Unable to dump error log buffers to remaining shadow set members\n"
2791 "** Error log buffers not dumped to HBVS unit 200\n"
2793 "** Dumping memory to HBVS unit 0\n"
2794 "**** Starting compressed selective memory dump at #...\n",
2799 "**** Memory dump complete - not all processes or global pages saved\n",
2807 "HALT instruction executed\n"
2808 "PC = ffffffff800c3884\n",
2814 "resetting all I/O buses\n"
2821 bst->scroll_p = True;
2823 bst->left_margin = bst->right_margin = 10;
2824 bst->top_margin = bst->bottom_margin = 10;
2830 if (uname (&uts) >= 0)
2831 sysname = uts.nodename;
2832 s = strchr (sysname, '.');
2835 # endif /* !HAVE_UNAME */
2837 args[0] = malloc (strlen(sysname) + 7);
2838 strcpy (args[0], sysname);
2841 /* Pick three numbers, 1-9, no overlaps. */
2842 ids[0] = 1 + (random() % 9);
2843 do { ids[1] = 1 + (random() % 9); } while (ids[1]==ids[0]);
2844 do { ids[2] = 1 + (random() % 9); } while (ids[2]==ids[0] || ids[2]==ids[1]);
2846 i = strlen(args[0])-1;
2848 args[0][i] = '0' + ids[0];
2851 for (s = args[0]; *s; s++)
2852 if (isalpha(*s)) *s = toupper (*s);
2854 args[1] = strdup (args[0]);
2855 args[2] = strdup (args[0]); args[2][i] = '0' + ids[1];
2856 args[3] = strdup (args[0]); args[3][i] = '0' + ids[2];
2858 args[4] = strdup (args[1]);
2859 args[5] = strdup (args[2]);
2860 args[6] = strdup (args[3]);
2863 time_t t = time ((time_t *) 0);
2864 struct tm *tm = localtime (&t);
2865 args[7] = malloc (30);
2866 strftime (args[7], 29, "%d-%b-%Y %H:%M", tm);
2867 for (s = args[7]; *s; s++)
2868 if (isalpha(*s)) *s = toupper (*s);
2872 for (i = 0; i < countof(lines); i++)
2874 const char *fmt = lines[i];
2875 if (! strcmp (fmt, "..."))
2877 int steps = 180 + (random() % 60);
2878 while (--steps >= 0)
2880 BSOD_TEXT (bst, LEFT, ".");
2881 BSOD_PAUSE (bst, dot_delay);
2886 char *fmt2 = malloc (strlen (fmt) * 2 + 1);
2887 for (s = (char *) fmt, s1 = fmt2; *s; s++)
2891 strcpy (s1, args[arg_count++]);
2898 BSOD_CHAR_DELAY (bst, char_delay);
2899 BSOD_TEXT (bst, LEFT, fmt2);
2901 BSOD_CHAR_DELAY (bst, 0);
2902 BSOD_PAUSE (bst, chunk_delay);
2906 for (i = 0; i < countof (args); i++)
2909 XClearWindow(dpy, window);
2914 /* HVX (formerly GCOS6) and TPS6 crash
2915 by Brian Garratt <brian-m.garratt@bull.co.uk>
2917 GCOS6 is a Unix-like operating system developed by Honeywell in the
2918 1970s in collaboration with MIT and AT&T (who called their version
2919 UNIX). Both are very much like MULTICS which Honeywell got from GE.
2921 HVX ("High-performance Virtual System on Unix") is an AIX application
2922 which emulates GCOS6 hardware on RS6000-like machines.
2924 static struct bsod_state *
2925 hvx (Display *dpy, Window window)
2927 struct bsod_state *bst = make_bsod_state (dpy, window, "hvx", "HVX");
2929 bst->scroll_p = True;
2931 bst->y = bst->xgwa.height - bst->bottom_margin - bst->font->ascent;
2933 BSOD_CHAR_DELAY (bst, 10000);
2934 BSOD_TEXT (bst, LEFT,
2935 "(TP) Trap no E Effective address 00000000 Instruction D7DE\n"
2936 "(TP) Registers :\n"
2937 "(TP) B1 -> B7 03801B02 00000000 03880D45 038BABDB 0388AFFD"
2938 " 0389B3F8 03972317\n"
2939 "(TP) R1 -> R7 0001 0007 F10F 090F 0020 0106 0272\n"
2940 "(TP) P I Z M1 0388A18B 3232 0000 FF00\n"
2941 "(TP) Program counter is at offset 0028 from string YTPAD\n"
2942 "(TP) User id of task which trapped is LT 626\n"
2945 BSOD_PAUSE (bst, 1000000);
2947 BSOD_CHAR_DELAY (bst, 100000);
2948 BSOD_TEXT (bst, LEFT, " TP CLOSE ALL");
2950 BSOD_CHAR_DELAY (bst, 10000);
2951 BSOD_TEXT (bst, LEFT, "\n(TP)?\n");
2952 BSOD_PAUSE (bst, 1000000);
2954 BSOD_CHAR_DELAY (bst, 100000);
2955 BSOD_TEXT (bst, LEFT, " TP ABORT -LT ALL");
2957 BSOD_CHAR_DELAY (bst, 10000);
2958 BSOD_TEXT (bst, LEFT, "\n(TP)?\n");
2959 BSOD_PAUSE (bst, 1000000);
2961 BSOD_CHAR_DELAY (bst, 100000);
2962 BSOD_TEXT (bst, LEFT, " TP STOP KILL");
2964 BSOD_CHAR_DELAY (bst, 10000);
2965 BSOD_TEXT (bst, LEFT,
2968 "Core dumps initiated for selected HVX processes ...\n"
2969 "Core dumps complete.\n"
2970 "Fri Jul 19 15:53:09 2002\n"
2971 "Live registers for cp 0:\n"
2972 " P = 7de3 IW=0000 I=32 CI=30000000 S=80006013"
2973 " IV=aa0 Level=13\n"
2974 " R1-7 = 1f 913 13 4 8 0 0\n"
2975 " B1-7 = 64e71b a93 50e 64e73c 6c2c 7000 b54\n"
2976 "Memory dump starting to file /var/hvx/dp01/diag/Level2 ...\n"
2977 "Memory dump complete.\n"
2980 XClearWindow(dpy, window);
2985 /* HPUX panic, by Tobias Klausmann <klausman@schwarzvogel.de>
2987 static struct bsod_state *
2988 hpux (Display *dpy, Window window)
2990 struct bsod_state *bst = make_bsod_state (dpy, window, "hvx", "HVX");
2991 const char *sysname;
2994 bst->scroll_p = True;
2995 bst->y = bst->xgwa.height - bst->bottom_margin - bst->font->ascent;
3002 if (uname (&uts) >= 0)
3003 sysname = uts.nodename;
3004 s = strchr (sysname, '.');
3007 # endif /* !HAVE_UNAME */
3009 BSOD_TEXT (bst, LEFT,
3013 sprintf (buf, "%.100s [HP Release B.11.00] (see /etc/issue)\n", sysname);
3014 BSOD_TEXT (bst, LEFT, buf);
3015 BSOD_PAUSE (bst, 1000000);
3016 BSOD_TEXT (bst, LEFT,
3019 " ******* Unexpected HPMC/TOC. Processor HPA FFFFFFFF'"
3020 "FFFA0000 *******\n"
3021 " GENERAL REGISTERS:\n"
3022 "r00/03 00000000'00000000 00000000'00000000 00000000'00000000 00000000'"
3024 "r04/07 00000000'00000001 00000000'0126E328 00000000'00000000 00000000'"
3026 "r08/11 00000000'00000000 00000000'0198CFC0 00000000'000476FE 00000000'"
3028 "r12/15 00000000'40013EE8 00000000'08000080 00000000'4002530C 00000000'"
3030 "r16/19 00000000'7F7F2A00 00000000'00000001 00000000'00000000 00000000'"
3032 "r20/23 00000000'006C8048 00000000'00000001 00000000'00000000 00000000'"
3034 "r24/27 00000000'00000000 00000000'00000000 00000000'00000000 00000000'"
3036 "r28/31 00000000'00000000 00000000'007DD628 00000000'0199F2B0 00000000'"
3038 " CONTROL REGISTERS:\n"
3039 "sr0/3 00000000'0F3B4000 00000000'0C2A2000 00000000'016FF800 00000000'"
3041 "sr4/7 00000000'00000000 00000000'016FF800 00000000'0DBF1400 00000000'"
3043 "pcq = 00000000'00000000.00000000'00104950 00000000'00000000.00000000'"
3045 "isr = 00000000'10240006 ior = 00000000'67D9E220 iir = 08000240 rctr = "
3048 "pid reg cr8/cr9 00007700'0000B3A9 00000000'0000C5D8\n"
3049 "pid reg cr12/cr13 00000000'00000000 00000000'00000000\n"
3050 "ipsw = 000000FF'080CFF1F iva = 00000000'0002C000 sar = 3A ccr = C0\n"
3051 "tr0/3 00000000'006C76C0 00000000'00000001 00000000'00000000 00000000'"
3053 "tr4/7 00000000'03790000 0000000C'4FB68340 00000000'C07EE13F 00000000'"
3055 "eiem = FFFFFFF0'FFFFFFFF eirr = 80000000'00000000 itmr = 0000000C'"
3057 "cr1/4 00000000'00000000 00000000'00000000 00000000'00000000 00000000'"
3059 "cr5/7 00000000'00000000 00000000'00000000 00000000'"
3061 " MACHINE CHECK PARAMETERS:\n"
3062 "Check Type = 00000000 CPU STATE = 9E000001 Cache Check = 00000000\n"
3063 "TLB Check = 00000000 Bus Check = 00000000 PIM State = ? SIU "
3064 "Status = ????????\n"
3065 "Assists = 00000000 Processor = 00000000\n"
3066 "Slave Addr = 00000000'00000000 Master Addr = 00000000'00000000\n"
3069 "TOC, pcsq.pcoq = 0'0.0'104950 , isr.ior = 0'10240006.0'67d9e220\n"
3070 "@(#)B2352B/9245XB HP-UX (B.11.00) #1: Wed Nov 5 22:38:19 PST 1997\n"
3071 "Transfer of control: (display==0xd904, flags==0x0)\n"
3075 "*** A system crash has occurred. (See the above messages for details.)\n"
3076 "*** The system is now preparing to dump physical memory to disk, for use\n"
3077 "*** in debugging the crash.\n"
3079 "*** The dump will be a SELECTIVE dump: 40 of 256 megabytes.\n"
3080 "*** To change this dump type, press any key within 10 seconds.\n"
3081 "*** Proceeding with selective dump.\n"
3083 "*** The dump may be aborted at any time by pressing ESC.\n");
3089 for (i = 0; i <= steps; i++)
3091 if (i > steps) i = steps;
3093 "*** Dumping: %3d%% complete (%d of 40 MB) (device 64:0x2)\r",
3096 BSOD_TEXT (bst, LEFT, buf);
3097 BSOD_PAUSE (bst, 1500000);
3101 BSOD_TEXT (bst, LEFT, "\n*** System rebooting.\n");
3103 XClearWindow(dpy, window);
3108 /* IBM OS/390 aka MVS aka z/OS.
3109 Text from Dan Espen <dane@mk.telcordia.com>.
3110 Apparently this isn't actually a crash, just a random session...
3113 static struct bsod_state *
3114 os390 (Display *dpy, Window window)
3116 struct bsod_state *bst = make_bsod_state (dpy, window, "os390", "OS390");
3118 bst->scroll_p = True;
3119 bst->y = bst->xgwa.height - bst->bottom_margin - bst->font->ascent;
3121 BSOD_LINE_DELAY (bst, 100000);
3122 BSOD_TEXT (bst, LEFT,
3123 "\n*** System rebooting.\n"
3124 "* ISPF Subtask abend *\n"
3125 "SPF ENDED DUE TO ERROR+\n"
3128 "IEA995I SYMPTOM DUMP OUTPUT\n"
3129 " USER COMPLETION CODE=0222\n"
3130 " TIME=23.00.51 SEQ=03210 CPU=0000 ASID=00AE\n"
3131 " PSW AT TIME OF ERROR 078D1000 859DAF18 ILC 2 INTC 0D\n"
3132 " NO ACTIVE MODULE FOUND\n"
3134 " DATA AT PSW 059DAF12 - 00181610 0A0D9180 70644710\n"
3135 " AR/GR 0: 00000000/80000000 1: 00000000/800000DE\n"
3136 " 2: 00000000/196504DC 3: 00000000/00037A78\n"
3137 " 4: 00000000/00037B78 5: 00000000/0003351C\n"
3138 " 6: 00000000/0000F0AD 7: 00000000/00012000\n"
3139 " 8: 00000000/059DAF10 9: 00000000/0002D098\n"
3140 " A: 00000000/059D9F10 B: 00000000/059D8F10\n"
3141 " C: 00000000/859D7F10 D: 00000000/00032D60\n"
3142 " E: 00000000/00033005 F: 01000002/00000041\n"
3143 " END OF SYMPTOM DUMP\n"
3144 "ISPS014 - ** Logical screen request failed - abend 0000DE **\n"
3145 "ISPS015 - ** Contact your system programmer or dialog developer.**\n"
3146 "*** ISPF Main task abend ***\n"
3147 "IEA995I SYMPTOM DUMP OUTPUT\n"
3148 " USER COMPLETION CODE=0222\n"
3149 " TIME=23.00.52 SEQ=03211 CPU=0000 ASID=00AE\n"
3150 " PSW AT TIME OF ERROR 078D1000 8585713C ILC 2 INTC 0D\n"
3151 " ACTIVE LOAD MODULE ADDRESS=05855000 OFFSET=0000213C\n"
3153 " DATA AT PSW 05857136 - 00181610 0A0D9180 D3304770\n"
3154 " GR 0: 80000000 1: 800000DE\n"
3155 " 2: 00015260 3: 00000038\n"
3156 " 4: 00012508 5: 00000000\n"
3157 " 6: 000173AC 7: FFFFFFF8\n"
3158 " 8: 05858000 9: 00012CA0\n"
3159 " A: 05857000 B: 05856000\n"
3160 " C: 85855000 D: 00017020\n"
3161 " E: 85857104 F: 00000000\n"
3162 " END OF SYMPTOM DUMP\n"
3165 BSOD_CURSOR (bst, CURSOR_LINE, 240000, 999999);
3167 XClearWindow(dpy, window);
3172 /* Compaq Tru64 Unix panic, by jwz as described by
3173 Tobias Klausmann <klausman@schwarzvogel.de>
3175 static struct bsod_state *
3176 tru64 (Display *dpy, Window window)
3178 struct bsod_state *bst = make_bsod_state (dpy, window, "tru64", "Tru64");
3179 const char *sysname;
3182 bst->scroll_p = True;
3183 bst->y = bst->xgwa.height - bst->bottom_margin - bst->font->ascent;
3185 sysname = "127.0.0.1";
3189 if (uname (&uts) >= 0)
3190 sysname = uts.nodename;
3192 # endif /* !HAVE_UNAME */
3195 "Compaq Tru64 UNIX V5.1B (Rev. 2650) (%.100s) console\n"
3199 BSOD_TEXT (bst, LEFT, buf);
3200 BSOD_PAUSE (bst, 6000000);
3202 BSOD_TEXT (bst, LEFT,
3203 "panic (cpu 0): trap: illegal instruction\n"
3204 "kernel inst fault=gentrap, ps=0x5, pc=0xfffffc0000593878, inst=0xaa\n"
3205 "kernel inst fault=gentrap, ps=0x5, pc=0xfffffc0000593878, inst=0xaa\n"
3207 "DUMP: blocks available: 1571600\n"
3208 "DUMP: blocks wanted: 100802 (partial compressed dump) [OKAY]\n"
3209 "DUMP: Device Disk Blocks Available\n"
3210 "DUMP: ------ ---------------------\n"
3211 "DUMP: 0x1300023 1182795 - 1571597 (of 1571598) [primary swap]\n"
3212 "DUMP.prom: Open: dev 0x5100041, block 2102016: SCSI 0 11 0 2 200 0 0\n"
3213 "DUMP: Writing header... [1024 bytes at dev 0x1300023, block 1571598]\n"
3214 "DUMP: Writing data");
3218 int steps = 4 + (random() % 8);
3219 BSOD_CHAR_DELAY (bst, 1000000);
3220 for (i = 0; i < steps; i++)
3221 BSOD_TEXT (bst, LEFT, ".");
3222 BSOD_CHAR_DELAY (bst, 0);
3223 sprintf (buf, "[%dMB]\n", steps);
3224 BSOD_TEXT (bst, LEFT, buf);
3227 BSOD_TEXT (bst, LEFT,
3228 "DUMP: Writing header... [1024 bytes at dev 0x1300023, block 1571598]\n"
3229 "DUMP: crash dump complete.\n"
3230 "kernel inst fault=gentrap, ps=0x5, pc=0xfffffc0000593878, inst=0xaa\n"
3232 "DUMP: second crash dump skipped: 'dump_savecnt' enforced.\n");
3233 BSOD_PAUSE (bst, 4000000);
3235 BSOD_TEXT (bst, LEFT,
3240 "HALT instruction executed\n"
3241 "PC = fffffc00005863b0\n");
3242 BSOD_PAUSE (bst, 3000000);
3244 BSOD_TEXT (bst, LEFT,
3251 XClearWindow(dpy, window);
3258 static struct bsod_state *
3259 msdos (Display *dpy, Window window)
3261 struct bsod_state *bst = make_bsod_state (dpy, window, "msdos", "MSDOS");
3263 BSOD_CHAR_DELAY (bst, 10000);
3264 BSOD_TEXT (bst, LEFT, "C:\\WINDOWS>");
3265 BSOD_CURSOR (bst, CURSOR_LINE, 200000, 8);
3267 BSOD_CHAR_DELAY (bst, 200000);
3268 BSOD_TEXT (bst, LEFT, "dir a:");
3269 BSOD_PAUSE (bst, 1000000);
3271 BSOD_CHAR_DELAY (bst, 10000);
3272 BSOD_TEXT (bst, LEFT, "\nNot ready reading drive A\nAbort, Retry, Fail?");
3274 BSOD_CURSOR (bst, CURSOR_LINE, 200000, 10);
3275 BSOD_CHAR_DELAY (bst, 200000);
3276 BSOD_TEXT (bst, LEFT, "f");
3277 BSOD_PAUSE (bst, 1000000);
3279 BSOD_CHAR_DELAY (bst, 10000);
3280 BSOD_TEXT (bst, LEFT,
3281 "\n\n\nNot ready reading drive A\nAbort, Retry, Fail?");
3283 BSOD_CURSOR (bst, CURSOR_LINE, 200000, 10);
3284 BSOD_CHAR_DELAY (bst, 200000);
3285 BSOD_TEXT (bst, LEFT, "f");
3286 BSOD_PAUSE (bst, 1000000);
3288 BSOD_CHAR_DELAY (bst, 10000);
3289 BSOD_TEXT (bst, LEFT, "\nVolume in drive A has no label\n\n"
3290 "Not ready reading drive A\nAbort, Retry, Fail?");
3292 BSOD_CURSOR (bst, CURSOR_LINE, 200000, 12);
3293 BSOD_CHAR_DELAY (bst, 200000);
3294 BSOD_TEXT (bst, LEFT, "a");
3295 BSOD_PAUSE (bst, 1000000);
3297 BSOD_CHAR_DELAY (bst, 10000);
3298 BSOD_TEXT (bst, LEFT, "\n\nC:\\WINDOWS>");
3300 BSOD_CURSOR (bst, CURSOR_LINE, 200000, 999999);
3302 XClearWindow(dpy, window);
3309 * This is what happens if an Nvidia card goes into some crazy text mode.
3310 * Most often seen on the second screen of a dual-head system when the
3311 * proper driver isn't loaded.
3313 typedef struct { int fg; int bg; int bit; Bool blink; } nvcell;
3316 nvspatter (nvcell *grid, int rows, int cols, int ncolors, int nbits,
3319 int max = rows * cols;
3320 int from = fill_p ? 0 : random() % (max - 1);
3321 int len = fill_p ? max : random() % (cols * 4);
3322 int to = from + len;
3324 Bool noisy = ((random() % 4) == 0);
3325 Bool diag = (noisy || fill_p) ? 0 : ((random() % 4) == 0);
3327 int fg = random() % ncolors;
3328 int bg = random() % ncolors;
3329 int blink = ((random() % 4) == 0);
3330 int bit = (random() % nbits);
3332 if (to > max) to = max;
3336 int src = random() % (rows * cols);
3337 int len2 = (cols / 2) - (random() % 5);
3339 for (i = from; i < to; i++, j++)
3341 if (j > src + len2 || j >= max)
3343 if (i >= max) abort();
3344 if (j >= max) abort();
3349 for (i = from; i < to; i++)
3351 nvcell *cell = &grid[i];
3355 cell->blink = blink;
3359 fg = random() % ncolors;
3360 bg = random() % ncolors;
3361 blink = ((random() % 8) == 0);
3367 struct bsod_state *bst;
3374 unsigned long colors[256];
3380 nvidia_free (struct bsod_state *bst)
3382 nvstate *nvs = (nvstate *) bst->closure;
3384 XFreeColors (bst->dpy, bst->xgwa.colormap, nvs->colors, nvs->ncolors, 0);
3385 for (i = 0; i < countof(nvs->bits); i++)
3386 XFreePixmap (bst->dpy, nvs->bits[i]);
3387 XFreeGC (bst->dpy, nvs->gc1);
3393 nvidia_draw (struct bsod_state *bst)
3395 nvstate *nvs = (nvstate *) bst->closure;
3398 for (y = 0; y < nvs->rows; y++)
3399 for (x = 0; x < nvs->cols; x++)
3401 nvcell *cell = &nvs->grid[y * nvs->cols + x];
3402 unsigned long fg = nvs->colors[cell->fg];
3403 unsigned long bg = nvs->colors[cell->bg];
3404 Bool flip = cell->blink && (nvs->tick & 1);
3405 XSetForeground (bst->dpy, bst->gc, flip ? fg : bg);
3406 XSetBackground (bst->dpy, bst->gc, flip ? bg : fg);
3407 XCopyPlane (bst->dpy, nvs->bits[cell->bit], bst->window, bst->gc,
3408 0, 0, nvs->cellw, nvs->cellh,
3409 x * nvs->cellw, y * nvs->cellh, 1L);
3413 if ((random() % 5) == 0) /* change the display */
3414 nvspatter (nvs->grid, nvs->rows, nvs->cols, nvs->ncolors,
3415 countof(nvs->bits), False);
3421 static struct bsod_state *
3422 nvidia (Display *dpy, Window window)
3424 struct bsod_state *bst = make_bsod_state (dpy, window, "nvidia", "nVidia");
3425 nvstate *nvs = (nvstate *) calloc (1, sizeof (*nvs));
3432 bst->draw_cb = nvidia_draw;
3433 bst->free_cb = nvidia_free;
3437 nvs->cellw = bst->xgwa.width / nvs->cols;
3438 nvs->cellh = bst->xgwa.height / nvs->rows;
3439 if (nvs->cellw < 8 || nvs->cellh < 18)
3440 nvs->cellw = 8, nvs->cellh = 18;
3441 nvs->cols = (bst->xgwa.width / nvs->cellw) + 1;
3442 nvs->rows = (bst->xgwa.height / nvs->cellh) + 1;
3444 nvs->grid = (nvcell *) calloc (sizeof(*nvs->grid), nvs->rows * nvs->cols);
3449 for (i = 0; i < nvs->ncolors; i++)
3452 c.red = random() & 0xFFFF;
3453 c.green = random() & 0xFFFF;
3454 c.blue = random() & 0xFFFF;
3455 c.flags = DoRed|DoGreen|DoBlue;
3456 XAllocColor (dpy, bst->xgwa.colormap, &c);
3457 nvs->colors[i] = c.pixel;
3460 /* Construct corrupted character bitmaps
3462 for (i = 0; i < countof(nvs->bits); i++)
3466 nvs->bits[i] = XCreatePixmap (dpy, window, nvs->cellw, nvs->cellh, 1);
3467 if (!nvs->gc1) nvs->gc1 = XCreateGC (dpy, nvs->bits[i], 0, &gcv);
3469 XSetForeground (dpy, nvs->gc1, 0);
3470 XFillRectangle (dpy, nvs->bits[i], nvs->gc1, 0, 0,
3471 nvs->cellw, nvs->cellh);
3472 XSetForeground (dpy, nvs->gc1, 1);
3474 if ((random() % 40) != 0)
3475 for (j = 0; j < ((nvs->cellw * nvs->cellh) / 16); j++)
3476 XFillRectangle (dpy, nvs->bits[i], nvs->gc1,
3477 (random() % (nvs->cellw-2)) & ~1,
3478 (random() % (nvs->cellh-2)) & ~1,
3482 /* Randomize the grid
3484 nvspatter (nvs->grid, nvs->rows, nvs->cols, nvs->ncolors,
3485 countof(nvs->bits), True);
3486 for (i = 0; i < 20; i++)
3487 nvspatter (nvs->grid, nvs->rows, nvs->cols, nvs->ncolors,
3488 countof(nvs->bits), False);
3495 * Simulate various Apple ][ crashes. The memory map encouraged many programs
3496 * to use the primary hi-res video page for various storage, and the secondary
3497 * hi-res page for active display. When it crashed into Applesoft or the
3498 * monitor, it would revert to the primary page and you'd see memory garbage on
3499 * the screen. Also, it was common for copy-protected games to use the primary
3500 * text page for important code, because that made it really hard to
3501 * reverse-engineer them. The result often looked like what this generates.
3503 * The Apple ][ logic and video hardware is in apple2.c. The TV is emulated by
3504 * analogtv.c for maximum realism
3506 * Trevor Blackwell <tlb@tlb.org>
3509 static const char * const apple2_basic_errors[]={
3513 "RETURN WITHOUT GOSUB",
3517 "BAD SUBSCRIPT ERROR",
3520 "FORMULA TOO COMPLEX",
3525 "DEFAULT ARGUMENTS ARE NOT ALLOWED IN DECLARATION OF FRIEND "
3526 "TEMPLATE SPECIALIZATION"
3530 static const char * const apple2_dos_errors[]={
3534 "NO BUFFERS AVAILABLE",
3535 "PROGRAM TOO LARGE",
3538 static void a2controller_crash(apple2_sim_t *sim, int *stepno,
3539 double *next_actiontime)
3541 apple2_state_t *st=sim->st;
3550 if (!sim->controller_data)
3551 sim->controller_data = calloc(sizeof(struct mydata),1);
3552 mine=(struct mydata *) sim->controller_data;
3557 a2_init_memory_active(sim);
3558 sim->dec->powerup = 1000.0;
3560 if (random()%3==0) {
3562 *next_actiontime+=0.4;
3565 else if (random()%4==0) {
3566 st->gr_mode=A2_GR_LORES;
3567 if (random()%3==0) st->gr_mode |= A2_GR_FULL;
3568 *next_actiontime+=0.4;
3571 else if (random()%2==0) {
3572 st->gr_mode=A2_GR_HIRES;
3576 st->gr_mode=A2_GR_HIRES;
3577 *next_actiontime+=0.4;
3583 /* An illegal instruction or a reset caused it to drop into the
3584 assembly language monitor, where you could disassemble code & view
3586 if (random()%3==0) {
3589 int addr=0xd000+random()%0x3000;
3591 "%02X",random()%0xff);
3594 sprintf(sim->printing_buf,
3597 " A=%02X X=%02X Y=%02X S=%02X F=%02X\n"
3600 random()%0xff, random()%0xff,
3601 random()%0xff, random()%0xff,
3603 sim->printing=sim->printing_buf;
3611 *next_actiontime += 2.0 + (random()%1000)*0.0002;
3614 /* Lots of programs had at least their main functionality in
3615 Applesoft Basic, which had a lot of limits (memory, string
3616 length, etc) and would sometimes crash unexpectedly. */
3617 sprintf(sim->printing_buf,
3623 apple2_basic_errors[random() %
3624 (sizeof(apple2_basic_errors)
3626 (1000*(random()%(random()%59+1)) +
3627 100*(random()%(random()%9+1)) +
3628 5*(random()%(random()%199+1)) +
3629 1*(random()%(random()%(random()%2+1)+1))));
3630 sim->printing=sim->printing_buf;
3634 *next_actiontime += 2.0 + (random()%1000)*0.0002;
3639 if (random()%3==0) {
3640 /* This was how you reset the Basic interpreter. The sort of
3641 incantation you'd have on a little piece of paper taped to the
3642 side of your machine */
3643 sim->typing="CALL -1370";
3646 else if (random()%2==0) {
3647 sim->typing="CATALOG\n";
3651 *next_actiontime+=1.0;
3658 *next_actiontime += 0.5;
3665 for (s="APPLE ]["; *s; s++) a2_printc(st,*s);
3668 *next_actiontime+=1.0;
3673 if (random()%50==0) {
3674 sprintf(sim->printing_buf,
3675 "\nDISK VOLUME 254\n\n"
3679 sim->printing=sim->printing_buf;
3682 sprintf(sim->printing_buf,"\n?%s\n]",
3683 apple2_dos_errors[random()%
3684 (sizeof(apple2_dos_errors) /
3686 sim->printing=sim->printing_buf;
3689 *next_actiontime+=1.0;
3693 if (random()%2==0) {
3694 /* This was how you went back to text mode in the monitor */
3695 sim->typing="FB4BG";
3698 *next_actiontime+=1.0;
3709 *next_actiontime+=2.0;
3713 /* This reset things into Basic */
3714 if (random()%2==0) {
3715 sim->typing="FAA6G";
3720 *next_actiontime+=sim->delay;
3725 for (i=0; i<1500; i++) {
3726 a2_poke(st, mine->fillptr, mine->fillbyte);
3728 mine->fillbyte = (mine->fillbyte+1)&0xff;
3730 *next_actiontime += 0.08;
3731 /* When you hit c000, it changed video settings */
3732 if (mine->fillptr>=0xc000) {
3736 /* And it seemed to reset around here, I dunno why */
3737 if (mine->fillptr>=0xcf00) *stepno=130;
3743 case A2CONTROLLER_FREE:
3751 a2_draw (struct bsod_state *bst)
3753 apple2_sim_t *sim = (apple2_sim_t *) bst->closure;
3755 sim = apple2_start (bst->dpy, bst->window, 9999999, a2controller_crash);
3759 if (! apple2_one_frame (sim)) {
3767 a2_free (struct bsod_state *bst)
3769 apple2_sim_t *sim = (apple2_sim_t *) bst->closure;
3771 sim->stepno = A2CONTROLLER_DONE;
3772 a2_draw (bst); /* finish up */
3773 if (bst->closure) abort(); /* should have been freed by now */
3778 static struct bsod_state *
3779 apple2crash (Display *dpy, Window window)
3781 struct bsod_state *bst = make_bsod_state (dpy, window, "apple2", "Apple2");
3782 bst->draw_cb = a2_draw;
3783 bst->free_cb = a2_free;
3788 /* A crash spotted on a cash machine circa 2006, by jwz. I didn't note
3789 what model it was; probably a Tranax Mini-Bank 1000 or similar vintage.
3791 static struct bsod_state *
3792 atm (Display *dpy, Window window)
3794 struct bsod_state *bst = make_bsod_state (dpy, window, "atm", "ATM");
3797 int pix_w = atm_width;
3798 int pix_h = atm_height;
3802 XClearWindow (dpy, window);
3804 pixmap = XCreatePixmapFromBitmapData (dpy, window, (char *) atm_bits,
3805 atm_width, atm_height,
3806 bst->fg, bst->bg, bst->xgwa.depth);
3808 while (pix_w <= bst->xgwa.width * scale &&
3809 pix_h <= bst->xgwa.height * scale)
3811 pixmap = double_pixmap (dpy, bst->gc, bst->xgwa.visual, bst->xgwa.depth,
3812 pixmap, pix_w, pix_h);
3818 x = (bst->xgwa.width - pix_w) / 2;
3819 y = (bst->xgwa.height - pix_h) / 2;
3825 XSetForeground (dpy, bst->gc,
3826 get_pixel_resource (dpy, bst->xgwa.colormap,
3829 for (j = -1; j < pix_w; j += i+1)
3830 XDrawLine (bst->dpy, pixmap, bst->gc, j, 0, j, pix_h);
3831 for (j = -1; j < pix_h; j += i+1)
3832 XDrawLine (bst->dpy, pixmap, bst->gc, 0, j, pix_w, j);
3835 XCopyArea (dpy, pixmap, window, bst->gc, 0, 0, pix_w, pix_h, x, y);
3837 XFreePixmap (dpy, pixmap);
3843 /* An Android phone boot loader, by jwz.
3845 static struct bsod_state *
3846 android (Display *dpy, Window window)
3848 struct bsod_state *bst = make_bsod_state (dpy, window, "android", "Android");
3850 unsigned long bg = get_pixel_resource (dpy, bst->xgwa.colormap,
3851 "android.background",
3852 "Android.Background");
3853 unsigned long fg = get_pixel_resource (dpy, bst->xgwa.colormap,
3854 "android.foreground",
3855 "Android.Foreground");
3856 unsigned long c1 = get_pixel_resource (dpy, bst->xgwa.colormap,
3858 "Android.Foreground");
3859 unsigned long c2 = get_pixel_resource (dpy, bst->xgwa.colormap,
3861 "Android.Foreground");
3862 unsigned long c3 = get_pixel_resource (dpy, bst->xgwa.colormap,
3864 "Android.Foreground");
3865 unsigned long c4 = get_pixel_resource (dpy, bst->xgwa.colormap,
3867 "Android.Foreground");
3868 unsigned long c5 = get_pixel_resource (dpy, bst->xgwa.colormap,
3870 "Android.Foreground");
3871 unsigned long c6 = get_pixel_resource (dpy, bst->xgwa.colormap,
3873 "Android.Foreground");
3874 unsigned long c7 = get_pixel_resource (dpy, bst->xgwa.colormap,
3876 "Android.Foreground");
3878 const char *lines0[] = {
3879 "Calculating... please wait\n",
3880 "osbl: 0x499DF907\n",
3881 "amss: 0x73162409\n",
3882 "hboot: 0xE46C3327\n",
3883 "boot: 0xBA570E7A\n",
3884 "recovery: 0xC8BBA213\n",
3885 "system: 0x87C3B1F0\n",
3887 "Press power key to go back.\n",
3890 const char *lines1[] = {
3891 "Checking SD card update...\n",
3893 " SD Checking...\n",
3894 " Failed to open zipfile\n",
3895 " loading preload_content...\n",
3896 " [Caution] Preload Content Not Found\n",
3897 " loading HTCUpdateZipName image...\n",
3899 " Checking...[PG46IMG.zip]\n",
3900 "Please plug off USB\n",
3903 const char *lines2[] = {
3904 " SD Checking...\n",
3905 " Loading...[PK76DIAG.zip]\n",
3907 " Loading...[PK76DIAG.nbh]\n",
3908 " No image or wrong image!\n",
3909 " Loading...[PK76IMG.zip]\n",
3911 " Loading...[PK76IMG.nbh]\n",
3912 " No image or wrong image!\n",
3913 " Loading...[PK76IMG.tar]\n",
3915 " Loading...[PK76IMG.aes]\n",
3917 " Loading...[PK76IMG.enc]\n",
3921 int cw = (bst->font->per_char
3922 ? bst->font->per_char['n'-bst->font->min_char_or_byte2].width
3923 : bst->font->min_bounds.width);
3924 int line_height = bst->font->ascent + bst->font->descent;
3929 int pix_w = 0, pix_h = 0;
3932 pixmap = xpm_data_to_pixmap (dpy, window, (char **) android_skate,
3934 if (! pixmap) abort();
3935 bst->pixmap = pixmap;
3936 # endif /* DO_XPM */
3938 bst->left_margin = (bst->xgwa.width - (cw * 40)) / 2;
3939 if (bst->left_margin < 0) bst->left_margin = 0;
3942 unsigned long delay =
3944 state == countof(lines0) ||
3945 state == countof(lines0) + countof(lines1) ||
3946 state == countof(lines0) + countof(lines1) + countof(lines2))
3948 BSOD_LINE_DELAY (bst, delay);
3950 if (state <= countof(lines0) + countof(lines1) + countof(lines2))
3952 BSOD_COLOR (bst, bg, bg);
3953 BSOD_RECT (bst, True, 0, 0, bst->xgwa.width, bst->xgwa.height);
3954 BSOD_COLOR (bst, bg, c1);
3955 BSOD_MOVETO (bst, bst->left_margin, bst->top_margin + line_height);
3956 BSOD_TEXT (bst, LEFT, "*** UNLOCKED ***\n");
3957 BSOD_COLOR (bst, c2, bg);
3958 BSOD_TEXT (bst, LEFT,
3959 "PRIMOU PVT SHIP S-OFF RL\n"
3963 "RADIO-3831.17.00.23_2\n"
3964 "eMMC-bootmode: disabled\n"
3965 "CPU-bootmode : disabled\n"
3966 "HW Secure boot: enabled\n"
3967 "MODEM PATH : OFF\n"
3968 "May 15 2012, 10:28:15\n"
3970 BSOD_COLOR (bst, bg, c3);
3974 int x = (bst->xgwa.width - pix_w) / 2;
3975 int y = bst->xgwa.height - pix_h;
3976 BSOD_PIXMAP (bst, 0, 0, pix_w, pix_h, x, y);
3980 if (state == countof(lines0) ||
3981 state == countof(lines0) + countof(lines1) ||
3982 state == countof(lines0) + countof(lines1) + countof(lines2))
3984 BSOD_TEXT (bst, LEFT, "HBOOT USB\n");
3985 BSOD_COLOR (bst, c4, bg);
3986 BSOD_TEXT (bst, LEFT,
3988 "<VOL UP> to previous item\n"
3989 "<VOL DOWN> to next item\n"
3990 "<POWER> to select item\n"
3992 BSOD_COLOR (bst, c5, bg); BSOD_TEXT (bst, LEFT, "FASTBOOT\n");
3993 BSOD_COLOR (bst, c6, bg); BSOD_TEXT (bst, LEFT, "RECOVERY\n");
3994 BSOD_COLOR (bst, c7, bg); BSOD_TEXT (bst, LEFT, "FACTORY RESET\n");
3995 BSOD_COLOR (bst, c3, bg); BSOD_TEXT (bst, LEFT, "SIMLOCK\n");
3996 BSOD_COLOR (bst, bg, c3); BSOD_TEXT (bst, LEFT, "HBOOT USB\n");
3997 BSOD_COLOR (bst, fg, bg); BSOD_TEXT (bst, LEFT, "IMAGE CRC\n");
3998 BSOD_COLOR (bst, c3, bg); BSOD_TEXT (bst, LEFT, "SHOW BARCODE\n");
3999 BSOD_PAUSE (bst, 3000000);
4001 else if (state < countof(lines0))
4003 BSOD_TEXT (bst, LEFT, "IMAGE CRC\n\n");
4004 BSOD_COLOR (bst, c5, bg);
4007 for (i = 0; i <= state; i++) {
4008 const char *s = lines0[i];
4009 BSOD_COLOR (bst, (strchr(s, ':') ? c7 : c3), bg);
4010 BSOD_TEXT (bst, LEFT, s);
4013 BSOD_PAUSE (bst, 500000);
4014 if (state == countof(lines0)-1)
4015 BSOD_PAUSE (bst, 2000000);
4017 else if (state < countof(lines0) + countof(lines1))
4019 BSOD_TEXT (bst, LEFT, "HBOOT\n\n");
4020 BSOD_COLOR (bst, c5, bg);
4023 for (i = countof(lines0); i <= state; i++) {
4024 const char *s = lines1[i - countof(lines0)];
4025 BSOD_COLOR (bst, (*s == ' ' ? c6 : c3), bg);
4026 BSOD_TEXT (bst, LEFT, s);
4029 BSOD_PAUSE (bst, 500000);
4030 if (state == countof(lines0) + countof(lines1) - 1)
4031 BSOD_PAUSE (bst, 2000000);
4033 else if (state < countof(lines0) + countof(lines1) + countof(lines2))
4035 BSOD_TEXT (bst, LEFT, "HBOOT USB\n\n");
4036 BSOD_COLOR (bst, c5, bg);
4039 for (i = countof(lines0) + countof(lines1); i <= state; i++) {
4040 const char *s = lines2[i - countof(lines0) - countof(lines1)];
4041 BSOD_COLOR (bst, (*s == ' ' ? c6 : c3), bg);
4042 BSOD_TEXT (bst, LEFT, s);
4045 BSOD_PAUSE (bst, 500000);
4046 if (state == countof(lines0) + countof(lines1) + countof(lines2)-1)
4047 BSOD_PAUSE (bst, 2000000);
4055 XClearWindow (dpy, window);
4063 /*****************************************************************************
4064 *****************************************************************************/
4067 static const struct {
4069 struct bsod_state * (*fn) (Display *, Window);
4071 { "Windows", windows_31 },
4072 { "NT", windows_nt },
4073 { "Win2K", windows_other },
4076 { "MacsBug", macsbug },
4081 { "HPPALinux", hppa_linux },
4082 { "SparcLinux", sparc_linux },
4086 { "BlitDamage", blitdamage },
4088 { "Solaris", sparc_solaris },
4089 { "Linux", linux_fsck },
4096 { "Nvidia", nvidia },
4097 { "Apple2", apple2crash },
4099 { "GLaDOS", glados },
4100 { "Android", android },
4104 struct driver_state {
4109 Bool debug_p, cycle_p;
4110 struct bsod_state *bst;
4115 hack_title (struct driver_state *dst)
4119 XFetchName (dst->bst->dpy, dst->bst->window, &oname);
4120 if (oname && !strncmp (oname, "BSOD: ", 6)) {
4121 char *tail = oname + 4;
4122 char *s = strchr (tail+1, ':');
4125 nname = malloc (strlen (tail) + strlen (dst->name) + 20);
4126 sprintf (nname, "BSOD: %s%s", dst->name, tail);
4127 XStoreName (dst->bst->dpy, dst->bst->window, nname);
4130 # endif /* !HAVE_COCOA */
4134 bsod_init (Display *dpy, Window window)
4136 struct driver_state *dst = (struct driver_state *) calloc (1, sizeof(*dst));
4139 dst->delay = get_integer_resource (dpy, "delay", "Integer");
4140 if (dst->delay < 3) dst->delay = 3;
4142 dst->debug_p = get_boolean_resource (dpy, "debug", "Boolean");
4145 s = get_string_resource(dpy, "doOnly", "DoOnly");
4146 if (s && !strcasecmp (s, "cycle"))
4149 dst->cycle_p = True;
4153 int count = countof(all_modes);
4154 for (dst->only = 0; dst->only < count; dst->only++)
4155 if (!strcasecmp (s, all_modes[dst->only].name))
4157 if (dst->only >= count)
4159 fprintf (stderr, "%s: unknown -only mode: \"%s\"\n", progname, s);
4171 static unsigned long
4172 bsod_draw (Display *dpy, Window window, void *closure)
4174 struct driver_state *dst = (struct driver_state *) closure;
4179 now = time ((time_t *) 0);
4180 time_left = dst->start + dst->delay - now;
4182 if (dst->bst && dst->bst->img_loader) /* still loading */
4184 dst->bst->img_loader =
4185 load_image_async_simple (dst->bst->img_loader, 0, 0, 0, 0, 0);
4189 if (! dst->bst && time_left > 0) /* run completed; wait out the delay */
4192 fprintf (stderr, "%s: %s: %d left\n", progname, dst->name, time_left);
4196 else if (dst->bst) /* sub-mode currently running */
4198 int this_delay = -1;
4201 this_delay = bsod_pop (dst->bst);
4203 /* XSync (dpy, False); slows down char drawing too much on HAVE_COCOA */
4205 if (this_delay == 0)
4206 goto AGAIN; /* no delay, not expired: stay here */
4207 else if (this_delay >= 0)
4208 return this_delay; /* return; time to sleep */
4210 { /* sub-mode run completed or expired */
4212 fprintf (stderr, "%s: %s: done\n", progname, dst->name);
4213 free_bsod_state (dst->bst);
4218 else /* launch a new sub-mode */
4221 dst->which = (dst->which + 1) % countof(all_modes);
4222 else if (dst->only >= 0)
4223 dst->which = dst->only;
4226 int count = countof(all_modes);
4229 for (i = 0; i < 200; i++)
4231 char name[100], class[100];
4232 int new_mode = (random() & 0xFF) % count;
4234 if (i < 100 && new_mode == dst->which)
4237 sprintf (name, "do%s", all_modes[new_mode].name);
4238 sprintf (class, "Do%s", all_modes[new_mode].name);
4240 if (get_boolean_resource (dpy, name, class))
4242 dst->which = new_mode;
4249 fprintf (stderr, "%s: no display modes enabled?\n", progname);
4251 dst->which = dst->only = 0;
4256 fprintf (stderr, "%s: %s: launch\n", progname,
4257 all_modes[dst->which].name);
4259 /* Run the mode setup routine...
4261 if (dst->bst) abort();
4262 dst->name = all_modes[dst->which].name;
4263 dst->bst = all_modes[dst->which].fn (dpy, window);
4264 dst->start = (dst->bst ? time ((time_t *) 0) : 0);
4266 /* Reset the structure run state to the beginning,
4267 and do some sanitization of the cursor position
4268 before the first run.
4273 fprintf (stderr, "%s: %s: queue size: %d (%d)\n", progname,
4274 dst->name, dst->bst->pos, dst->bst->queue_size);
4278 dst->bst->x = dst->bst->current_left = dst->bst->left_margin;
4280 if (dst->bst->y < dst->bst->top_margin + dst->bst->font->ascent)
4281 dst->bst->y = dst->bst->top_margin + dst->bst->font->ascent;
4290 bsod_reshape (Display *dpy, Window window, void *closure,
4291 unsigned int w, unsigned int h)
4293 struct driver_state *dst = (struct driver_state *) closure;
4296 w == dst->bst->xgwa.width &&
4297 h == dst->bst->xgwa.height)
4301 fprintf (stderr, "%s: %s: reshape reset\n", progname, dst->name);
4303 /* just pick a new mode and restart when the window is resized. */
4305 free_bsod_state (dst->bst);
4309 XClearWindow (dpy, window);
4314 bsod_event (Display *dpy, Window window, void *closure, XEvent *event)
4316 struct driver_state *dst = (struct driver_state *) closure;
4317 Bool reset_p = False;
4319 /* pick a new mode and restart when mouse clicked, or certain keys typed. */
4321 if (screenhack_event_helper (dpy, window, event))
4327 fprintf (stderr, "%s: %s: manual reset\n", progname, dst->name);
4329 free_bsod_state (dst->bst);
4333 XClearWindow (dpy, window);
4342 bsod_free (Display *dpy, Window window, void *closure)
4344 struct driver_state *dst = (struct driver_state *) closure;
4346 free_bsod_state (dst->bst);
4351 static const char *bsod_defaults [] = {
4365 "*doAtari: False", /* boring */
4366 "*doBSD: False", /* boring */
4368 "*doSparcLinux: False", /* boring */
4369 "*doHPPALinux: True",
4370 "*doBlitDamage: True",
4386 "*font2: -*-courier-bold-r-*-*-*-120-*-*-m-*-*-*",
4387 "*bigFont: -*-courier-bold-r-*-*-*-180-*-*-m-*-*-*",
4388 "*bigFont2: -*-courier-bold-r-*-*-*-180-*-*-m-*-*-*",
4390 ".foreground: White",
4391 ".background: Black",
4393 ".windows.foreground: White",
4394 ".windows.background: #0000AA", /* EGA color 0x01. */
4396 ".windowslh.foreground: White",
4397 ".windowslh.background: #AA0000", /* EGA color 0x04. */
4398 ".windowslh.background2: #AAAAAA", /* EGA color 0x07. */
4400 ".glaDOS.foreground: White",
4401 ".glaDOS.background: #0000AA", /* EGA color 0x01. */
4403 ".amiga.foreground: #FF0000",
4404 ".amiga.background: Black",
4405 ".amiga.background2: White",
4407 ".mac.foreground: #BBFFFF",
4408 ".mac.background: Black",
4410 ".atari.foreground: Black",
4411 ".atari.background: White",
4413 ".macsbug.font: -*-courier-medium-r-*-*-*-80-*-*-m-*-*-*",
4414 ".macsbug.bigFont: -*-courier-bold-r-*-*-*-140-*-*-m-*-*-*",
4415 ".macsbug.foreground: Black",
4416 ".macsbug.background: White",
4417 ".macsbug.borderColor: #AAAAAA",
4419 ".mac1.foreground: Black",
4420 ".mac1.background: White",
4422 ".macx.foreground: White",
4423 ".macx.textForeground: White",
4424 ".macx.textBackground: Black",
4425 ".macx.background: #888888",
4427 ".macdisk.font: -*-courier-bold-r-*-*-*-80-*-*-m-*-*-*",
4428 ".macdisk.bigFont: -*-courier-bold-r-*-*-*-100-*-*-m-*-*-*",
4430 ".sco.font: -*-courier-bold-r-*-*-*-140-*-*-m-*-*-*",
4431 ".sco.foreground: White",
4432 ".sco.background: Black",
4434 ".hvx.font: -*-courier-bold-r-*-*-*-140-*-*-m-*-*-*",
4435 ".hvx.foreground: White",
4436 ".hvx.background: Black",
4438 ".linux.foreground: White",
4439 ".linux.background: Black",
4441 ".hppalinux.bigFont: -*-courier-bold-r-*-*-*-140-*-*-m-*-*-*",
4442 ".hppalinux.foreground: White",
4443 ".hppalinux.background: Black",
4445 ".sparclinux.bigFont: -*-courier-bold-r-*-*-*-140-*-*-m-*-*-*",
4446 ".sparclinux.foreground: White",
4447 ".sparclinux.background: Black",
4450 ".bsd.bigFont: -sun-console-medium-r-*-*-22-*-*-*-m-*-*-*",
4451 ".bsd.bigFont2: -*-courier-bold-r-*-*-*-140-*-*-m-*-*-*",
4452 ".bsd.foreground: #c0c0c0",
4453 ".bsd.background: Black",
4455 ".solaris.font: -sun-gallant-*-*-*-*-19-*-*-*-*-120-*-*",
4456 ".solaris.foreground: Black",
4457 ".solaris.background: White",
4459 ".hpux.bigFont: -*-courier-bold-r-*-*-*-140-*-*-m-*-*-*",
4460 ".hpux.foreground: White",
4461 ".hpux.background: Black",
4463 ".os390.bigFont: -*-courier-bold-r-*-*-*-140-*-*-m-*-*-*",
4464 ".os390.background: Black",
4465 ".os390.foreground: Red",
4467 ".tru64.bigFont: -*-courier-bold-r-*-*-*-140-*-*-m-*-*-*",
4468 ".tru64.foreground: White",
4469 ".tru64.background: #0000AA", /* EGA color 0x01. */
4471 ".vms.bigFont: -*-courier-bold-r-*-*-*-140-*-*-m-*-*-*",
4472 ".vms.foreground: White",
4473 ".vms.background: Black",
4475 ".msdos.bigFont: -*-courier-bold-r-*-*-*-140-*-*-m-*-*-*",
4476 ".msdos.foreground: White",
4477 ".msdos.background: Black",
4479 ".os2.foreground: White",
4480 ".os2.background: Black",
4482 ".atm.foreground: Black",
4483 ".atm.background: #FF6600",
4485 ".android.foreground: Black",
4486 ".android.background: White",
4487 ".android.color1: #AA00AA", /* violet */
4488 ".android.color2: #336633", /* green1 */
4489 ".android.color3: #0000FF", /* blue */
4490 ".android.color4: #CC7744", /* orange */
4491 ".android.color5: #99AA55", /* green2 */
4492 ".android.color6: #66AA33", /* green3 */
4493 ".android.color7: #FF0000", /* red */
4495 "*dontClearRoot: True",
4499 #ifdef HAVE_XSHM_EXTENSION
4504 "*font: Courier-Bold 9",
4505 ".amiga.font: Courier-Bold 12",
4506 ".macsbug.font: Courier-Bold 5",
4507 ".sco.font: Courier-Bold 9",
4508 ".hvx.font: Courier-Bold 9",
4509 ".bsd.font: Courier-Bold 9",
4510 ".solaris.font: Courier-Bold 6",
4511 ".macdisk.font: Courier-Bold 6",
4517 static const XrmOptionDescRec bsod_options [] = {
4518 { "-delay", ".delay", XrmoptionSepArg, 0 },
4519 { "-only", ".doOnly", XrmoptionSepArg, 0 },
4520 { "-debug", ".debug", XrmoptionNoArg, "True" },
4521 { "-windows", ".doWindows", XrmoptionNoArg, "True" },
4522 { "-no-windows", ".doWindows", XrmoptionNoArg, "False" },
4523 { "-nt", ".doNT", XrmoptionNoArg, "True" },
4524 { "-no-nt", ".doNT", XrmoptionNoArg, "False" },
4525 { "-2k", ".doWin2K", XrmoptionNoArg, "True" },
4526 { "-no-2k", ".doWin2K", XrmoptionNoArg, "False" },
4527 { "-amiga", ".doAmiga", XrmoptionNoArg, "True" },
4528 { "-no-amiga", ".doAmiga", XrmoptionNoArg, "False" },
4529 { "-mac", ".doMac", XrmoptionNoArg, "True" },
4530 { "-no-mac", ".doMac", XrmoptionNoArg, "False" },
4531 { "-mac1", ".doMac1", XrmoptionNoArg, "True" },
4532 { "-no-mac1", ".doMac1", XrmoptionNoArg, "False" },
4533 { "-macx", ".doMacX", XrmoptionNoArg, "True" },
4534 { "-no-macx", ".doMacX", XrmoptionNoArg, "False" },
4535 { "-atari", ".doAtari", XrmoptionNoArg, "True" },
4536 { "-no-atari", ".doAtari", XrmoptionNoArg, "False" },
4537 { "-macsbug", ".doMacsBug", XrmoptionNoArg, "True" },
4538 { "-no-macsbug", ".doMacsBug", XrmoptionNoArg, "False" },
4539 { "-apple2", ".doApple2", XrmoptionNoArg, "True" },
4540 { "-no-apple2", ".doApple2", XrmoptionNoArg, "False" },
4541 { "-sco", ".doSCO", XrmoptionNoArg, "True" },
4542 { "-no-sco", ".doSCO", XrmoptionNoArg, "False" },
4543 { "-hvx", ".doHVX", XrmoptionNoArg, "True" },
4544 { "-no-hvx", ".doHVX", XrmoptionNoArg, "False" },
4545 { "-bsd", ".doBSD", XrmoptionNoArg, "True" },
4546 { "-no-bsd", ".doBSD", XrmoptionNoArg, "False" },
4547 { "-linux", ".doLinux", XrmoptionNoArg, "True" },
4548 { "-no-linux", ".doLinux", XrmoptionNoArg, "False" },
4549 { "-hppalinux", ".doHPPALinux", XrmoptionNoArg, "True" },
4550 { "-no-hppalinux", ".doHPPALinux", XrmoptionNoArg, "False" },
4551 { "-sparclinux", ".doSparcLinux", XrmoptionNoArg, "True" },
4552 { "-no-sparclinux", ".doSparcLinux", XrmoptionNoArg, "False" },
4553 { "-blitdamage", ".doBlitDamage", XrmoptionNoArg, "True" },
4554 { "-no-blitdamage", ".doBlitDamage", XrmoptionNoArg, "False" },
4555 { "-nvidia", ".doNvidia", XrmoptionNoArg, "True" },
4556 { "-no-nvidia", ".doNvidia", XrmoptionNoArg, "False" },
4557 { "-solaris", ".doSolaris", XrmoptionNoArg, "True" },
4558 { "-no-solaris", ".doSolaris", XrmoptionNoArg, "False" },
4559 { "-hpux", ".doHPUX", XrmoptionNoArg, "True" },
4560 { "-no-hpux", ".doHPUX", XrmoptionNoArg, "False" },
4561 { "-os390", ".doOS390", XrmoptionNoArg, "True" },
4562 { "-no-os390", ".doOS390", XrmoptionNoArg, "False" },
4563 { "-tru64", ".doHPUX", XrmoptionNoArg, "True" },
4564 { "-no-tru64", ".doTru64", XrmoptionNoArg, "False" },
4565 { "-vms", ".doVMS", XrmoptionNoArg, "True" },
4566 { "-no-vms", ".doVMS", XrmoptionNoArg, "False" },
4567 { "-msdos", ".doMSDOS", XrmoptionNoArg, "True" },
4568 { "-no-msdos", ".doMSDOS", XrmoptionNoArg, "False" },
4569 { "-os2", ".doOS2", XrmoptionNoArg, "True" },
4570 { "-no-os2", ".doOS2", XrmoptionNoArg, "False" },
4571 { "-atm", ".doATM", XrmoptionNoArg, "True" },
4572 { "-no-atm", ".doATM", XrmoptionNoArg, "False" },
4573 { "-glados", ".doGLaDOS", XrmoptionNoArg, "True" },
4574 { "-no-glados", ".doGLaDOS", XrmoptionNoArg, "False" },
4575 { "-android", ".doAndroid", XrmoptionNoArg, "True" },
4576 { "-no-android", ".doAndroid", XrmoptionNoArg, "False" },
4582 XSCREENSAVER_MODULE ("BSOD", bsod)