1 /* xscreensaver, Copyright (c) 1998-2006 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"
62 #include "images/atari.xbm"
63 #include "images/mac.xbm"
64 #include "images/macbomb.xbm"
67 #define countof(x) (sizeof((x))/sizeof((*x)))
72 LEFT_FULL, CENTER_FULL, RIGHT_FULL,
73 COLOR, INVERT, MOVETO, MARGINS,
74 CURSOR_BLOCK, CURSOR_LINE, RECT, COPY, PIXMAP, IMG,
75 PAUSE, CHAR_DELAY, LINE_DELAY,
81 void *arg1, *arg2, *arg3, *arg4, *arg5, *arg6;
87 XWindowAttributes xgwa;
91 int left_margin, right_margin; /* for text wrapping */
92 int top_margin, bottom_margin; /* for text scrolling */
96 Pixmap pixmap; /* Source image used by BSOD_PIXMAP */
98 int x, y; /* current text-drawing position */
99 int current_left; /* don't use this */
101 int pos; /* position in queue */
103 struct bsod_event *queue;
105 unsigned long char_delay; /* delay between printing characters */
106 unsigned long line_delay; /* delay between printing lines */
108 Bool macx_eol_kludge;
111 int (*draw_cb) (struct bsod_state *);
112 void (*free_cb) (struct bsod_state *);
114 async_load_state *img_loader;
118 # if !defined(__GNUC__) && !defined(__extension__)
119 /* don't warn about "string length is greater than the length ISO C89
120 compilers are required to support" in these string constants... */
121 # define __extension__ /**/
125 /* Draw text at the current position; align is LEFT, CENTER, RIGHT, or *_FULL
126 (meaning to clear the whole line margin to margin).
128 #define BSOD_TEXT(bst,align,string) do { \
129 ensure_queue (bst); \
130 (bst)->queue[(bst)->pos].type = (align); \
131 (bst)->queue[(bst)->pos].arg1 = (void *) strdup (__extension__ (string)); \
132 (bst)->queue[(bst)->pos].arg2 = (bst)->queue[(bst)->pos].arg1; \
133 (bst)->queue[(bst)->pos].arg3 = (void *) 0; \
137 /* Flip the foreground and background colors
139 #define BSOD_INVERT(bst) do { \
140 ensure_queue (bst); \
141 (bst)->queue[(bst)->pos].type = INVERT; \
145 /* Set the foreground and background colors to the given pixels
147 #define BSOD_COLOR(bst,fg,bg) do { \
148 ensure_queue (bst); \
149 (bst)->queue[(bst)->pos].type = COLOR; \
150 (bst)->queue[(bst)->pos].arg1 = (void *) fg; \
151 (bst)->queue[(bst)->pos].arg2 = (void *) bg; \
155 /* Set the position of the next text.
156 Note that this is the baseline: lower left corner of next char printed.
158 #define BSOD_MOVETO(bst,x,y) do { \
159 ensure_queue (bst); \
160 (bst)->queue[(bst)->pos].type = MOVETO; \
161 (bst)->queue[(bst)->pos].arg1 = (void *) ((long) (x)); \
162 (bst)->queue[(bst)->pos].arg2 = (void *) ((long) (y)); \
166 /* Delay for at least the given number of microseconds.
168 #define BSOD_PAUSE(bst,usec) do { \
169 ensure_queue (bst); \
170 (bst)->queue[(bst)->pos].type = PAUSE; \
171 (bst)->queue[(bst)->pos].arg1 = (void *) ((long) (usec)); \
175 /* Set the delay after each character is printed.
177 #define BSOD_CHAR_DELAY(bst,usec) do { \
178 ensure_queue (bst); \
179 (bst)->queue[(bst)->pos].type = CHAR_DELAY; \
180 (bst)->queue[(bst)->pos].arg1 = (void *) ((long) (usec)); \
184 /* Set the delay after each newline.
186 #define BSOD_LINE_DELAY(bst,usec) do { \
187 ensure_queue (bst); \
188 (bst)->queue[(bst)->pos].type = LINE_DELAY; \
189 (bst)->queue[(bst)->pos].arg1 = (void *) (usec); \
193 /* Set the prevailing left/right margins (used when strings have
194 embedded newlines, and when centering or right-justifying text.)
196 #define BSOD_MARGINS(bst,left,right) do { \
197 ensure_queue (bst); \
198 (bst)->queue[(bst)->pos].type = MARGINS; \
199 (bst)->queue[(bst)->pos].arg1 = (void *) ((long) (left)); \
200 (bst)->queue[(bst)->pos].arg2 = (void *) ((long) (right)); \
204 /* Draw a blinking cursor; type is CURSOR_BLOCK or CURSOR_LINE.
205 usec is how long 1/2 of a cycle is. count is how many times to blink.
206 (You can pass a gigantic number if this is the last thing in your mode.)
208 #define BSOD_CURSOR(bst,ctype,usec,count) do { \
209 ensure_queue (bst); \
210 (bst)->queue[(bst)->pos].type = (ctype); \
211 (bst)->queue[(bst)->pos].arg1 = (void *) (usec); \
212 (bst)->queue[(bst)->pos].arg2 = (void *) (count); \
216 /* Draw or fill a rectangle. You can set line-width in the GC.
218 #define BSOD_RECT(bst,fill,x,y,w,h) do { \
219 ensure_queue (bst); \
220 (bst)->queue[(bst)->pos].type = RECT; \
221 (bst)->queue[(bst)->pos].arg1 = (void *) ((long) (fill)); \
222 (bst)->queue[(bst)->pos].arg2 = (void *) ((long) (x)); \
223 (bst)->queue[(bst)->pos].arg3 = (void *) ((long) (y)); \
224 (bst)->queue[(bst)->pos].arg4 = (void *) ((long) (w)); \
225 (bst)->queue[(bst)->pos].arg5 = (void *) ((long) (h)); \
229 /* Copy a rect from the window, to the window.
231 #define BSOD_COPY(bst,srcx,srcy,w,h,tox,toy) do { \
232 ensure_queue (bst); \
233 (bst)->queue[(bst)->pos].type = COPY; \
234 (bst)->queue[(bst)->pos].arg1 = (void *) ((long) (srcx)); \
235 (bst)->queue[(bst)->pos].arg2 = (void *) ((long) (srcy)); \
236 (bst)->queue[(bst)->pos].arg3 = (void *) ((long) (w)); \
237 (bst)->queue[(bst)->pos].arg4 = (void *) ((long) (h)); \
238 (bst)->queue[(bst)->pos].arg5 = (void *) ((long) (tox)); \
239 (bst)->queue[(bst)->pos].arg6 = (void *) ((long) (toy)); \
243 /* Copy a rect from bst->pixmap to the window.
245 #define BSOD_PIXMAP(bst,srcx,srcy,w,h,tox,toy) do { \
246 BSOD_COPY(bst,srcx,srcy,w,h,tox,toy); \
247 (bst)->queue[(bst)->pos-1].type = PIXMAP; \
250 /* Load a random image (or the desktop) onto the window.
252 #define BSOD_IMG(bst) do { \
253 ensure_queue (bst); \
254 (bst)->queue[(bst)->pos].type = IMG; \
258 /* Jump around in the state table. You can use this as the last thing
259 in your state table to repeat the last N elements forever.
261 #define BSOD_LOOP(bst,off) do { \
262 ensure_queue (bst); \
263 (bst)->queue[(bst)->pos].type = LOOP; \
264 (bst)->queue[(bst)->pos].arg1 = (void *) (off); \
270 ensure_queue (struct bsod_state *bst)
273 if (bst->pos + 1 < bst->queue_size)
276 n = bst->queue_size + 10;
280 bst->queue = (struct bsod_event *)
281 realloc (bst->queue, n * sizeof(*bst->queue));
282 if (!bst->queue) abort();
283 memset (bst->queue + bst->queue_size, 0,
284 (n - bst->queue_size) * sizeof(*bst->queue));
290 position_for_text (struct bsod_state *bst, const char *line)
294 const char *start = line;
296 if (bst->queue[bst->pos].type != LEFT &&
297 bst->queue[bst->pos].type != LEFT_FULL)
300 int dir, ascent, descent;
302 const char *end = start;
303 while (*end && *end != '\r' && *end != '\n')
306 XTextExtents (bst->font, start, end-start,
307 &dir, &ascent, &descent, &ov);
308 if (ov.width > max_width)
309 max_width = ov.width;
314 switch (bst->queue[bst->pos].type) {
317 bst->current_left = bst->left_margin;
321 bst->x = max_width - bst->right_margin;
322 bst->current_left = bst->x;
327 int w = (bst->xgwa.width - bst->left_margin - bst->right_margin -
330 bst->x = bst->left_margin + (w / 2);
331 bst->current_left = bst->x;
341 bst_crlf (struct bsod_state *bst)
343 int lh = bst->font->ascent + bst->font->descent;
344 bst->x = bst->current_left;
345 if (!bst->scroll_p ||
346 bst->y + lh < bst->xgwa.height - bst->bottom_margin)
350 int w = bst->xgwa.width - bst->right_margin - bst->left_margin;
351 int h = bst->xgwa.height - bst->top_margin - bst->bottom_margin;
352 XCopyArea (bst->dpy, bst->window, bst->window, bst->gc,
354 bst->top_margin + lh,
358 XClearArea (bst->dpy, bst->window,
359 bst->left_margin, bst->top_margin + h - lh, w, lh, False);
365 draw_char (struct bsod_state *bst, char c)
371 bst->x = bst->current_left;
375 if (bst->macx_eol_kludge)
377 /* Special case for the weird way OSX crashes print newlines... */
378 XDrawImageString (bst->dpy, bst->window, bst->gc,
379 bst->x, bst->y, " ", 1);
380 XDrawImageString (bst->dpy, bst->window, bst->gc,
382 bst->y + bst->font->ascent + bst->font->descent,
387 else if (c == '\b') /* backspace */
389 int cw = (bst->font->per_char
390 ? bst->font->per_char['n'-bst->font->min_char_or_byte2].width
391 : bst->font->min_bounds.width);
393 if (bst->x < bst->left_margin)
394 bst->x = bst->left_margin;
398 int dir, ascent, descent;
400 XTextExtents (bst->font, &c, 1, &dir, &ascent, &descent, &ov);
403 bst->x + ov.width > bst->xgwa.width - bst->right_margin)
406 XDrawImageString (bst->dpy, bst->window, bst->gc,
407 bst->x, bst->y, &c, 1);
414 bsod_pop (struct bsod_state *bst)
416 bsod_event_type type = bst->queue[bst->pos].type;
419 return bst->draw_cb (bst);
421 if (bst->pos < 0) /* already done */
426 case LEFT: case LEFT_FULL:
427 case CENTER: case CENTER_FULL:
428 case RIGHT: case RIGHT_FULL:
430 const char *s = (const char *) bst->queue[bst->pos].arg2;
435 long delay = bst->line_delay;
437 bst->current_left = bst->left_margin;
441 if (! bst->queue[bst->pos].arg3) /* "done once" */
443 position_for_text (bst, s);
444 bst->queue[bst->pos].type = LEFT;
446 if (type == CENTER_FULL ||
450 XSetForeground (bst->dpy, bst->gc, bst->bg);
451 XFillRectangle (bst->dpy, bst->window, bst->gc,
453 bst->y - bst->font->ascent,
455 bst->font->ascent + bst->font->descent);
456 XSetForeground (bst->dpy, bst->gc, bst->fg);
462 bst->queue[bst->pos].arg2 = (void *) s;
463 bst->queue[bst->pos].arg3 = (void *) 1; /* "done once" */
465 return (c == '\r' || c == '\n'
471 unsigned long swap = bst->fg;
474 XSetForeground (bst->dpy, bst->gc, bst->fg);
475 XSetBackground (bst->dpy, bst->gc, bst->bg);
481 bst->fg = (unsigned long) bst->queue[bst->pos].arg1;
482 bst->bg = (unsigned long) bst->queue[bst->pos].arg2;
483 XSetForeground (bst->dpy, bst->gc, bst->fg);
484 XSetBackground (bst->dpy, bst->gc, bst->bg);
490 bst->x = (long) bst->queue[bst->pos].arg1;
491 bst->y = (long) bst->queue[bst->pos].arg2;
497 int f = (long) bst->queue[bst->pos].arg1;
498 int x = (long) bst->queue[bst->pos].arg2;
499 int y = (long) bst->queue[bst->pos].arg3;
500 int w = (long) bst->queue[bst->pos].arg4;
501 int h = (long) bst->queue[bst->pos].arg5;
503 XFillRectangle (bst->dpy, bst->window, bst->gc, x, y, w, h);
505 XDrawRectangle (bst->dpy, bst->window, bst->gc, x, y, w, h);
512 int srcx = (long) bst->queue[bst->pos].arg1;
513 int srcy = (long) bst->queue[bst->pos].arg2;
514 int w = (long) bst->queue[bst->pos].arg3;
515 int h = (long) bst->queue[bst->pos].arg4;
516 int tox = (long) bst->queue[bst->pos].arg5;
517 int toy = (long) bst->queue[bst->pos].arg6;
519 (type == PIXMAP ? bst->pixmap : bst->window),
520 bst->window, bst->gc,
521 srcx, srcy, w, h, tox, toy);
527 if (bst->img_loader) abort();
528 bst->img_loader = load_image_async_simple (0, bst->xgwa.screen,
529 bst->window, bst->window,
536 long delay = (long) bst->queue[bst->pos].arg1;
542 bst->char_delay = (long) bst->queue[bst->pos].arg1;
548 bst->line_delay = (long) bst->queue[bst->pos].arg1;
554 bst->left_margin = (long) bst->queue[bst->pos].arg1;
555 bst->right_margin = (long) bst->queue[bst->pos].arg2;
562 long delay = (long) bst->queue[bst->pos].arg1;
563 long count = (long) bst->queue[bst->pos].arg2;
566 if (type == CURSOR_BLOCK)
568 unsigned long swap = bst->fg;
571 XSetForeground (bst->dpy, bst->gc, bst->fg);
572 XSetBackground (bst->dpy, bst->gc, bst->bg);
573 draw_char (bst, ' ');
577 draw_char (bst, (count & 1 ? ' ' : '_'));
578 draw_char (bst, ' ');
584 bst->queue[bst->pos].arg2 = (void *) count;
592 long off = (long) bst->queue[bst->pos].arg1;
594 if (bst->pos < 0 || bst->pos >= bst->queue_size)
610 static struct bsod_state *
611 make_bsod_state (Display *dpy, Window window,
612 const char *name, const char *class)
615 struct bsod_state *bst;
616 char buf1[1024], buf2[1024];
617 char buf3[1024], buf4[1024];
618 const char *font1, *font2;
620 bst = (struct bsod_state *) calloc (1, sizeof (*bst));
621 bst->queue_size = 10;
622 bst->queue = (struct bsod_event *) calloc (bst->queue_size,
623 sizeof (*bst->queue));
625 bst->window = window;
626 XGetWindowAttributes (dpy, window, &bst->xgwa);
628 /* If the window is small:
629 use ".font" if it is loadable, else use ".font2".
631 If the window is big:
632 use ".bigFont" if it is loadable, else use ".bigFont2".
634 if (bst->xgwa.height < 640)
636 sprintf (buf1, "%.100s.font", name);
637 sprintf (buf2, "%.100s.font", class);
638 sprintf (buf3, "%.100s.font2", name);
639 sprintf (buf4, "%.100s.font2", class);
643 sprintf (buf1, "%.100s.bigFont", name);
644 sprintf (buf2, "%.100s.bigFont", class);
645 sprintf (buf3, "%.100s.bigFont2", name);
646 sprintf (buf4, "%.100s.bigFont2", class);
649 font1 = get_string_resource (dpy, buf1, buf2);
650 font2 = get_string_resource (dpy, buf3, buf4);
653 bst->font = XLoadQueryFont (dpy, font1);
654 if (! bst->font && font2)
655 bst->font = XLoadQueryFont (dpy, font2);
657 /* If neither of those worked, try some defaults. */
660 bst->font = XLoadQueryFont (dpy,"-*-courier-bold-r-*-*-*-120-*-*-m-*-*-*");
662 bst->font = XLoadQueryFont (dpy, "fixed");
666 gcv.font = bst->font->fid;
668 sprintf (buf1, "%.100s.foreground", name);
669 sprintf (buf2, "%.100s.Foreground", class);
670 bst->fg = gcv.foreground = get_pixel_resource (dpy, bst->xgwa.colormap,
672 sprintf (buf1, "%.100s.background", name);
673 sprintf (buf2, "%.100s.Background", class);
674 bst->bg = gcv.background = get_pixel_resource (dpy, bst->xgwa.colormap,
676 bst->gc = XCreateGC (dpy, window, GCFont|GCForeground|GCBackground, &gcv);
679 jwxyz_XSetAntiAliasing (dpy, bst->gc, False);
682 bst->left_margin = bst->right_margin = 10;
683 bst->x = bst->left_margin;
684 bst->y = bst->font->ascent + bst->left_margin;
686 XSetWindowBackground (dpy, window, gcv.background);
692 free_bsod_state (struct bsod_state *bst)
699 XFreePixmap(bst->dpy, bst->pixmap);
701 XFreeFont (bst->dpy, bst->font);
702 XFreeGC (bst->dpy, bst->gc);
704 for (i = 0; i < bst->queue_size; i++)
705 switch (bst->queue[i].type) {
706 case LEFT: case LEFT_FULL:
707 case RIGHT: case RIGHT_FULL:
708 case CENTER: case CENTER_FULL:
709 free ((char *) bst->queue[i].arg1);
721 double_pixmap (Display *dpy, GC gc, Visual *visual, int depth, Pixmap pixmap,
722 int pix_w, int pix_h)
725 Pixmap p2 = XCreatePixmap(dpy, pixmap, pix_w*2, pix_h*2, depth);
726 XImage *i1 = XGetImage(dpy, pixmap, 0, 0, pix_w, pix_h, ~0L, ZPixmap);
727 XImage *i2 = XCreateImage(dpy, visual, depth, ZPixmap, 0, 0,
728 pix_w*2, pix_h*2, 8, 0);
729 i2->data = (char *) calloc(i2->height, i2->bytes_per_line);
730 for (y = 0; y < pix_h; y++)
731 for (x = 0; x < pix_w; x++)
733 unsigned long p = XGetPixel(i1, x, y);
734 XPutPixel(i2, x*2, y*2, p);
735 XPutPixel(i2, x*2+1, y*2, p);
736 XPutPixel(i2, x*2, y*2+1, p);
737 XPutPixel(i2, x*2+1, y*2+1, p);
739 free(i1->data); i1->data = 0;
741 XPutImage(dpy, p2, gc, i2, 0, 0, 0, 0, i2->width, i2->height);
742 free(i2->data); i2->data = 0;
744 XFreePixmap(dpy, pixmap);
749 /*****************************************************************************
750 *****************************************************************************/
752 static struct bsod_state *
753 windows_31 (Display *dpy, Window window)
755 struct bsod_state *bst = make_bsod_state (dpy, window, "windows", "Windows");
757 BSOD_TEXT (bst, CENTER, "Windows\n");
759 BSOD_TEXT (bst, CENTER,
760 "A fatal exception 0E has occured at F0AD:42494C4C\n"
761 "the current application will be terminated.\n"
763 "* Press any key to terminate the current application.\n"
764 "* Press CTRL+ALT+DELETE again to restart your computer.\n"
765 " You will lose any unsaved information in all applications.\n"
768 BSOD_TEXT (bst, CENTER, "Press any key to continue");
770 bst->y = ((bst->xgwa.height -
771 ((bst->font->ascent + bst->font->descent) * 9))
774 XClearWindow (dpy, window);
779 static struct bsod_state *
780 windows_nt (Display *dpy, Window window)
782 struct bsod_state *bst = make_bsod_state (dpy, window, "windows", "Windows");
784 BSOD_TEXT (bst, LEFT,
785 "*** STOP: 0x0000001E (0x80000003,0x80106fc0,0x8025ea21,0xfd6829e8)\n"
786 "Unhandled Kernel exception c0000047 from fa8418b4 (8025ea21,fd6829e8)\n"
788 "Dll Base Date Stamp - Name Dll Base Date Stamp - Name\n"
789 "80100000 2be154c9 - ntoskrnl.exe 80400000 2bc153b0 - hal.dll\n"
790 "80258000 2bd49628 - ncrc710.sys 8025c000 2bd49688 - SCSIPORT.SYS \n"
791 "80267000 2bd49683 - scsidisk.sys 802a6000 2bd496b9 - Fastfat.sys\n"
792 "fa800000 2bd49666 - Floppy.SYS fa810000 2bd496db - Hpfs_Rec.SYS\n"
793 "fa820000 2bd49676 - Null.SYS fa830000 2bd4965a - Beep.SYS\n"
794 "fa840000 2bdaab00 - i8042prt.SYS fa850000 2bd5a020 - SERMOUSE.SYS\n"
795 "fa860000 2bd4966f - kbdclass.SYS fa870000 2bd49671 - MOUCLASS.SYS\n"
796 "fa880000 2bd9c0be - Videoprt.SYS fa890000 2bd49638 - NCC1701E.SYS\n"
797 "fa8a0000 2bd4a4ce - Vga.SYS fa8b0000 2bd496d0 - Msfs.SYS\n"
798 "fa8c0000 2bd496c3 - Npfs.SYS fa8e0000 2bd496c9 - Ntfs.SYS\n"
799 "fa940000 2bd496df - NDIS.SYS fa930000 2bd49707 - wdlan.sys\n"
800 "fa970000 2bd49712 - TDI.SYS fa950000 2bd5a7fb - nbf.sys\n"
801 "fa980000 2bd72406 - streams.sys fa9b0000 2bd4975f - ubnb.sys\n"
802 "fa9c0000 2bd5bfd7 - usbser.sys fa9d0000 2bd4971d - netbios.sys\n"
803 "fa9e0000 2bd49678 - Parallel.sys fa9f0000 2bd4969f - serial.SYS\n"
804 "faa00000 2bd49739 - mup.sys faa40000 2bd4971f - SMBTRSUP.SYS\n"
805 "faa10000 2bd6f2a2 - srv.sys faa50000 2bd4971a - afd.sys\n"
806 "faa60000 2bd6fd80 - rdr.sys faaa0000 2bd49735 - bowser.sys\n"
808 "Address dword dump Dll Base - Name\n"
809 "801afc20 80106fc0 80106fc0 00000000 00000000 80149905 : "
810 "fa840000 - i8042prt.SYS\n"
811 "801afc24 80149905 80149905 ff8e6b8c 80129c2c ff8e6b94 : "
812 "8025c000 - SCSIPORT.SYS\n"
813 "801afc2c 80129c2c 80129c2c ff8e6b94 00000000 ff8e6b94 : "
814 "80100000 - ntoskrnl.exe\n"
815 "801afc34 801240f2 80124f02 ff8e6df4 ff8e6f60 ff8e6c58 : "
816 "80100000 - ntoskrnl.exe\n"
817 "801afc54 80124f16 80124f16 ff8e6f60 ff8e6c3c 8015ac7e : "
818 "80100000 - ntoskrnl.exe\n"
819 "801afc64 8015ac7e 8015ac7e ff8e6df4 ff8e6f60 ff8e6c58 : "
820 "80100000 - ntoskrnl.exe\n"
821 "801afc70 80129bda 80129bda 00000000 80088000 80106fc0 : "
822 "80100000 - ntoskrnl.exe\n"
824 "Kernel Debugger Using: COM2 (Port 0x2f8, Baud Rate 19200)\n"
825 "Restart and set the recovery options in the system control panel\n"
826 "or the /CRASHDEBUG system start option. If this message reappears,\n"
827 "contact your system administrator or technical support group."
830 bst->line_delay = 750;
832 XClearWindow (dpy, window);
837 static struct bsod_state *
838 windows_2k (Display *dpy, Window window)
840 struct bsod_state *bst = make_bsod_state (dpy, window, "windows", "Windows");
842 BSOD_TEXT (bst, LEFT,
843 "*** STOP: 0x000000D1 (0xE1D38000,0x0000001C,0x00000000,0xF09D42DA)\n"
844 "DRIVER_IRQL_NOT_LESS_OR_EQUAL \n"
846 "*** Address F09D42DA base at F09D4000, DateStamp 39f459ff - CRASHDD.SYS\n"
848 "Beginning dump of physical memory\n");
849 BSOD_PAUSE (bst, 4000000);
850 BSOD_TEXT (bst, LEFT,
851 "Physical memory dump complete. Contact your system administrator or\n"
852 "technical support group.\n");
854 bst->left_margin = 40;
855 bst->y = (bst->font->ascent + bst->font->descent) * 10;
856 bst->line_delay = 750;
858 XClearWindow (dpy, window);
863 static struct bsod_state *
864 windows_me (Display *dpy, Window window)
866 struct bsod_state *bst = make_bsod_state (dpy, window, "windows", "Windows");
868 BSOD_TEXT (bst, LEFT,
869 "Windows protection error. You need to restart your computer.\n\n"
871 BSOD_CURSOR (bst, CURSOR_LINE, 120000, 999999);
873 bst->left_margin = 40;
874 bst->y = ((bst->xgwa.height -
875 ((bst->font->ascent + bst->font->descent) * 3))
878 XClearWindow (dpy, window);
883 static struct bsod_state *
884 windows_xp (Display *dpy, Window window)
886 struct bsod_state *bst = make_bsod_state (dpy, window, "windows", "Windows");
888 BSOD_TEXT (bst, LEFT, /* From Wm. Rhodes <xscreensaver@27.org> */
889 "A problem has been detected and windows has been shut down to prevent "
891 "to your computer.\n"
893 "If this is the first time you've seen this Stop error screen,\n"
894 "restart your computer. If this screen appears again, follow\n"
897 "Check to be sure you have adequate disk space. If a driver is\n"
898 "identified in the Stop message, disable the driver or check\n"
899 "with the manufacturer for driver updates. Try changing video\n"
902 "Check with your hardware vendor for any BIOS updates. Disable\n"
903 "BIOS memory options such as caching or shadowing. If you need\n"
904 "to use Safe Mode to remove or disable components, restart your\n"
905 "computer, press F8 to select Advanced Startup Options, and then\n"
906 "select Safe Mode.\n"
908 "Technical information:\n"
910 "*** STOP: 0x0000007E (0xC0000005,0xF88FF190,0x0xF8975BA0,0xF89758A0)\n"
913 "*** EPUSBDSK.sys - Address F88FF190 base at FF88FE000, datestamp "
916 "Beginning dump of physical memory\n");
917 BSOD_PAUSE (bst, 4000000);
918 BSOD_TEXT (bst, LEFT,
919 "Physical memory dump complete.\n"
920 "Contact your system administrator or technical support group for "
924 XClearWindow (dpy, window);
929 static struct bsod_state *
930 windows_lh (Display *dpy, Window window)
932 struct bsod_state *bst =
933 make_bsod_state (dpy, window, "windowslh", "WindowsLH");
935 unsigned long fg = bst->fg;
936 unsigned long bg = bst->bg;
937 unsigned long bg2 = get_pixel_resource (dpy, bst->xgwa.colormap,
938 "windowslh.background2",
939 "WindowsLH.Background");
941 /* The "RSOD" that appeared with "Windows Longhorn 5048.050401-0536_x86fre"
942 As reported by http://joi.ito.com/RedScreen.jpg
944 BSOD_COLOR (bst, bg, bg2);
945 BSOD_TEXT (bst, CENTER_FULL, "Windows Boot Error\n");
946 BSOD_COLOR (bst, fg, bg);
947 BSOD_TEXT (bst, CENTER,
949 "Windows Boot Manager has experienced a problem.\n"
952 " Status: 0xc000000f\n"
956 " Info: An error occurred transferring exectuion." /* (sic) */
960 "You can try to recover the system with the Microsoft Windows "
962 "Tools. (You might need to restart the system manually.)\n"
964 "If the problem continues, please contact your system administrator "
968 BSOD_MOVETO (bst, bst->left_margin, bst->xgwa.height - bst->font->descent);
969 BSOD_COLOR (bst, bg, bg2);
970 BSOD_TEXT (bst, LEFT_FULL, " SPACE=Continue\n");
972 bst->y = bst->font->ascent;
974 XClearWindow (dpy, window);
979 static struct bsod_state *
980 windows_other (Display *dpy, Window window)
982 /* Lump all of the 2K-ish crashes together and select them randomly...
984 int which = (random() % 4);
986 case 0: return windows_2k (dpy, window); break;
987 case 1: return windows_me (dpy, window); break;
988 case 2: return windows_xp (dpy, window); break;
989 case 3: return windows_lh (dpy, window); break;
990 default: abort(); break;
995 /* SCO OpenServer 5 panic, by Tom Kelly <tom@ancilla.toronto.on.ca>
997 static struct bsod_state *
998 sco (Display *dpy, Window window)
1000 struct bsod_state *bst = make_bsod_state (dpy, window, "sco", "SCO");
1002 BSOD_TEXT (bst, LEFT,
1003 "Unexpected trap in kernel mode:\n"
1005 "cr0 0x80010013 cr2 0x00000014 cr3 0x00000000 tlb 0x00000000\n"
1006 "ss 0x00071054 uesp 0x00012055 efl 0x00080888 ipl 0x00000005\n"
1007 "cs 0x00092585 eip 0x00544a4b err 0x004d4a47 trap 0x0000000E\n"
1008 "eax 0x0045474b ecx 0x0042544b edx 0x57687920 ebx 0x61726520\n"
1009 "esp 0x796f7520 ebp 0x72656164 esi 0x696e6720 edi 0x74686973\n"
1010 "ds 0x3f000000 es 0x43494c48 fs 0x43525343 gs 0x4f4d4b53\n"
1012 "PANIC: k_trap - kernel mode trap type 0x0000000E\n"
1013 "Trying to dump 5023 pages to dumpdev hd (1/41), 63 pages per '.'\n"
1015 BSOD_CHAR_DELAY (bst, 100000);
1016 BSOD_TEXT (bst, LEFT,
1017 "................................................................."
1020 BSOD_CHAR_DELAY (bst, 0);
1021 BSOD_TEXT (bst, LEFT,
1022 "5023 pages dumped\n"
1026 BSOD_PAUSE (bst, 2000000);
1027 BSOD_TEXT (bst, LEFT,
1028 "** Safe to Power Off **\n"
1030 "** Press Any Key to Reboot **\n"
1033 bst->y = ((bst->xgwa.height -
1034 ((bst->font->ascent + bst->font->descent) * 18)));
1036 XClearWindow (dpy, window);
1041 /* Linux (sparc) panic, by Tom Kelly <tom@ancilla.toronto.on.ca>
1043 static struct bsod_state *
1044 sparc_linux (Display *dpy, Window window)
1046 struct bsod_state *bst = make_bsod_state (dpy, window, "sco", "SCO");
1047 bst->scroll_p = True;
1048 bst->y = bst->xgwa.height - bst->font->ascent - bst->font->descent;
1050 BSOD_TEXT (bst, LEFT,
1051 "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
1052 "Unable to handle kernel paging request at virtual address f0d4a000\n"
1053 "tsk->mm->context = 00000014\n"
1054 "tsk->mm->pgd = f26b0000\n"
1056 " \"@'/ ,. \\`@\"\n"
1059 "gawk(22827): Oops\n"
1060 "PSR: 044010c1 PC: f001c2cc NPC: f001c2d0 Y: 00000000\n"
1061 "g0: 00001000 g1: fffffff7 g2: 04401086 g3: 0001eaa0\n"
1062 "g4: 000207dc g5: f0130400 g6: f0d4a018 g7: 00000001\n"
1063 "o0: 00000000 o1: f0d4a298 o2: 00000040 o3: f1380718\n"
1064 "o4: f1380718 o5: 00000200 sp: f1b13f08 ret_pc: f001c2a0\n"
1065 "l0: efffd880 l1: 00000001 l2: f0d4a230 l3: 00000014\n"
1066 "l4: 0000ffff l5: f0131550 l6: f012c000 l7: f0130400\n"
1067 "i0: f1b13fb0 i1: 00000001 i2: 00000002 i3: 0007c000\n"
1068 "i4: f01457c0 i5: 00000004 i6: f1b13f70 i7: f0015360\n"
1069 "Instruction DUMP:\n"
1072 XClearWindow (dpy, window);
1077 /* BSD Panic by greywolf@starwolf.com - modeled after the Linux panic above.
1078 By Grey Wolf <greywolf@siteROCK.com>
1080 static struct bsod_state *
1081 bsd (Display *dpy, Window window)
1083 struct bsod_state *bst = make_bsod_state (dpy, window, "bsd", "BSD");
1085 const char * const panicstr[] = {
1086 "panic: ifree: freeing free inode\n",
1087 "panic: blkfree: freeing free block\n",
1088 "panic: improbability coefficient below zero\n",
1089 "panic: cgsixmmap\n",
1090 "panic: crazy interrupts\n",
1092 "panic: attempted windows install\n",
1094 "panic: free inode isn't\n",
1095 "panic: cpu_fork: curproc\n",
1096 "panic: malloc: out of space in kmem_map\n",
1097 "panic: vogon starship detected\n",
1098 "panic: teleport chamber: out of order\n",
1099 "panic: Brain fried - core dumped\n"
1102 char syncing[80], bbuf[5];
1104 for (i = 0; i < sizeof(syncing); i++)
1107 i = (random() % (sizeof(panicstr) / sizeof(*panicstr)));
1108 BSOD_TEXT (bst, LEFT, panicstr[i]);
1109 BSOD_TEXT (bst, LEFT, "Syncing disks: ");
1111 b = (random() % 40);
1112 for (n = 0; (n < 20) && (b > 0); n++)
1116 i = (random() & 0x7);
1117 b -= (random() & 0xff) % 20;
1121 sprintf (bbuf, "%d ", b);
1122 BSOD_TEXT (bst, LEFT, bbuf);
1123 BSOD_PAUSE (bst, 1000000);
1126 BSOD_TEXT (bst, LEFT, "\n");
1127 BSOD_TEXT (bst, LEFT, (b ? "damn!" : "sunk!"));
1128 BSOD_TEXT (bst, LEFT, "\nRebooting\n");
1130 bst->y = ((bst->xgwa.height -
1131 ((bst->font->ascent + bst->font->descent) * 4)));
1133 XClearWindow (dpy, window);
1138 static struct bsod_state *
1139 amiga (Display *dpy, Window window)
1141 struct bsod_state *bst = make_bsod_state (dpy, window, "amiga", "Amiga");
1144 int pix_w = 0, pix_h = 0;
1148 unsigned long bg2 = get_pixel_resource (dpy, bst->xgwa.colormap,
1149 "amiga.background2",
1150 "Amiga.Background");
1153 pixmap = xpm_data_to_pixmap (dpy, window, (char **) amiga_hand,
1155 # endif /* DO_XPM */
1157 if (pixmap && bst->xgwa.height > 600) /* scale up the bitmap */
1159 pixmap = double_pixmap (dpy, bst->gc, bst->xgwa.visual, bst->xgwa.depth,
1160 pixmap, pix_w, pix_h);
1165 XSetLineAttributes (dpy, bst->gc, lw, LineSolid, CapButt, JoinMiter);
1167 height = (bst->font->ascent + bst->font->descent) * 6;
1169 BSOD_PAUSE (bst, 2000000);
1170 BSOD_COPY (bst, 0, 0, bst->xgwa.width, bst->xgwa.height - height, 0, height);
1173 BSOD_RECT (bst, True, 0, 0, bst->xgwa.width, height);
1175 BSOD_TEXT (bst, CENTER,
1177 "Software failure. Press left mouse button to continue.\n"
1178 "Guru Meditation #00000003.00C01570"
1180 BSOD_RECT (bst, False, lw/2, lw/2, bst->xgwa.width - lw, height);
1181 BSOD_PAUSE (bst, 1000000);
1183 BSOD_LOOP (bst, -3);
1185 XSetWindowBackground (dpy, window, bg2);
1186 XClearWindow (dpy, window);
1187 XSetWindowBackground (dpy, window, bst->bg);
1191 int x = (bst->xgwa.width - pix_w) / 2;
1192 int y = ((bst->xgwa.height - pix_h) / 2);
1193 XCopyArea (dpy, pixmap, bst->window, bst->gc, 0, 0, pix_w, pix_h, x, y);
1203 /* Atari ST, by Marcus Herbert <rhoenie@nobiscum.de>
1204 Marcus had this to say:
1206 Though I still have my Atari somewhere, I hardly remember
1207 the meaning of the bombs. I think 9 bombs was "bus error" or
1208 something like that. And you often had a few bombs displayed
1209 quickly and then the next few ones coming up step by step.
1210 Perhaps somebody else can tell you more about it.. its just
1213 static struct bsod_state *
1214 atari (Display *dpy, Window window)
1216 struct bsod_state *bst = make_bsod_state (dpy, window, "atari", "Atari");
1219 int pix_w = atari_width;
1220 int pix_h = atari_height;
1224 pixmap = XCreatePixmapFromBitmapData (dpy, window, (char *) atari_bits,
1226 bst->fg, bst->bg, bst->xgwa.depth);
1227 pixmap = double_pixmap (dpy, bst->gc, bst->xgwa.visual, bst->xgwa.depth,
1228 pixmap, pix_w, pix_h);
1234 y = bst->xgwa.height/2;
1237 for (i = 1; i< 7; i++)
1238 BSOD_COPY (bst, x, y, pix_w, pix_h, (x + (i*offset)), y);
1242 BSOD_PAUSE (bst, 1000000);
1243 BSOD_COPY (bst, x, y, pix_w, pix_h, (x + (i*offset)), y);
1246 XClearWindow (dpy, window);
1247 XCopyArea (dpy, pixmap, window, bst->gc, 0, 0, pix_w, pix_h, x, y);
1248 XFreePixmap (dpy, pixmap);
1254 static struct bsod_state *
1255 mac (Display *dpy, Window window)
1257 struct bsod_state *bst = make_bsod_state (dpy, window, "mac", "Mac");
1260 int pix_w = mac_width;
1261 int pix_h = mac_height;
1262 int offset = mac_height * 4;
1265 const char *string = ("0 0 0 0 0 0 0 F\n"
1268 pixmap = XCreatePixmapFromBitmapData(dpy, window, (char *) mac_bits,
1269 mac_width, mac_height,
1270 bst->fg, bst->bg, bst->xgwa.depth);
1272 for (i = 0; i < 2; i++)
1274 pixmap = double_pixmap (dpy, bst->gc, bst->xgwa.visual, bst->xgwa.depth,
1275 pixmap, pix_w, pix_h);
1276 pix_w *= 2; pix_h *= 2;
1279 bst->x = (bst->xgwa.width - pix_w) / 2;
1280 bst->y = (((bst->xgwa.height + offset) / 2) -
1282 (bst->font->ascent + bst->font->descent) * 2);
1283 if (bst->y < 0) bst->y = 0;
1285 XClearWindow (dpy, window);
1286 XCopyArea (dpy, pixmap, window, bst->gc, 0, 0, pix_w, pix_h, bst->x, bst->y);
1287 XFreePixmap (dpy, pixmap);
1289 bst->y += offset + bst->font->ascent + bst->font->descent;
1290 BSOD_TEXT (bst, CENTER, string);
1296 static struct bsod_state *
1297 macsbug (Display *dpy, Window window)
1299 struct bsod_state *bst = make_bsod_state (dpy, window, "macsbug", "MacsBug");
1302 const char *left = (" SP \n"
1349 const char *bottom = (" _A09D\n"
1350 " +00884 40843714 #$0700,SR "
1352 " +00886 40843765 *+$0400 "
1354 " +00888 40843718 $0004(A7),([0,A7[)"
1355 " ; 04E8D0AE | 66B8");
1357 const char * body = ("PowerPC unmapped memory exception at 003AFDAC "
1358 "BowelsOfTheMemoryMgr+04F9C\n"
1359 " Calling chain using A6/R1 links\n"
1360 " Back chain ISA Caller\n"
1361 " 00000000 PPC 28C5353C __start+00054\n"
1362 " 24DB03C0 PPC 28B9258C main+0039C\n"
1363 " 24DB0350 PPC 28B9210C MainEvent+00494\n"
1364 " 24DB02B0 PPC 28B91B40 HandleEvent+00278\n"
1365 " 24DB0250 PPC 28B83DAC DoAppleEvent+00020\n"
1366 " 24DB0210 PPC FFD3E5D0 "
1367 "AEProcessAppleEvent+00020\n"
1368 " 24DB0132 68K 00589468\n"
1369 " 24DAFF8C 68K 00589582\n"
1370 " 24DAFF26 68K 00588F70\n"
1371 " 24DAFEB3 PPC 00307098 "
1372 "EmToNatEndMoveParams+00014\n"
1373 " 24DAFE40 PPC 28B9D0B0 DoScript+001C4\n"
1374 " 24DAFDD0 PPC 28B9C35C RunScript+00390\n"
1375 " 24DAFC60 PPC 28BA36D4 run_perl+000E0\n"
1376 " 24DAFC10 PPC 28BC2904 perl_run+002CC\n"
1377 " 24DAFA80 PPC 28C18490 Perl_runops+00068\n"
1378 " 24DAFA30 PPC 28BE6CC0 Perl_pp_backtick+000FC\n"
1379 " 24DAF9D0 PPC 28BA48B8 Perl_my_popen+00158\n"
1380 " 24DAF980 PPC 28C5395C sfclose+00378\n"
1381 " 24DAF930 PPC 28BA568C free+0000C\n"
1382 " 24DAF8F0 PPC 28BA6254 pool_free+001D0\n"
1383 " 24DAF8A0 PPC FFD48F14 DisposePtr+00028\n"
1384 " 24DAF7C9 PPC 00307098 "
1385 "EmToNatEndMoveParams+00014\n"
1386 " 24DAF780 PPC 003AA180 __DisposePtr+00010");
1391 int char_width, line_height;
1392 int col_right, row_top, row_bottom, page_right, page_bottom, body_top;
1395 unsigned long fg = bst->fg;
1396 unsigned long bg = bst->bg;
1397 unsigned long bc = get_pixel_resource (dpy, bst->xgwa.colormap,
1398 "macsbug.borderColor",
1399 "MacsBug.BorderColor");
1401 for (s = body; *s; s++) if (*s == '\n') body_lines++;
1403 char_width = (bst->font->per_char
1404 ? bst->font->per_char['n'-bst->font->min_char_or_byte2].width
1405 : bst->font->min_bounds.width);
1406 line_height = bst->font->ascent + bst->font->descent;
1408 col_right = char_width * 12; /* number of columns in `left' */
1409 page_bottom = line_height * 47; /* number of lines in `left' */
1411 if (page_bottom > bst->xgwa.height)
1412 page_bottom = bst->xgwa.height;
1414 row_bottom = page_bottom - line_height;
1415 row_top = row_bottom - (line_height * 4);
1416 page_right = col_right + (char_width * 88);
1417 body_top = row_top - (line_height * body_lines);
1426 xoff = (bst->xgwa.width - page_right) / 2;
1427 yoff = (bst->xgwa.height - page_bottom) / 2;
1429 if (xoff < 0) xoff = 0;
1430 if (yoff < 0) yoff = 0;
1432 BSOD_MARGINS (bst, xoff, yoff);
1434 BSOD_COLOR (bst, bc, bg);
1435 BSOD_RECT (bst, True, 0, 0, bst->xgwa.width, bst->xgwa.height);
1436 BSOD_COLOR (bst, bg, bg);
1437 BSOD_RECT (bst, True, xoff-2, yoff, page_right+4, page_bottom);
1438 BSOD_COLOR (bst, fg, bg);
1440 BSOD_MOVETO (bst, xoff, yoff + line_height);
1441 BSOD_TEXT (bst, LEFT, left);
1442 BSOD_MOVETO (bst, xoff+col_right, yoff + row_top + line_height);
1443 BSOD_TEXT (bst, LEFT, bottom);
1445 BSOD_RECT (bst, True, xoff + col_right, yoff, 2, page_bottom);
1446 BSOD_RECT (bst, True, xoff + col_right, yoff + row_top,
1447 page_right - col_right, 1);
1448 BSOD_RECT (bst, True, xoff + col_right, yoff + row_bottom,
1449 page_right - col_right, 1);
1450 BSOD_RECT (bst, False, xoff-2, yoff, page_right+4, page_bottom);
1452 BSOD_LINE_DELAY (bst, 500);
1454 xoff + col_right + char_width,
1455 yoff + body_top + line_height);
1456 BSOD_MARGINS (bst, xoff + col_right + char_width, yoff);
1457 BSOD_TEXT (bst, LEFT, body);
1459 BSOD_RECT (bst, False, xoff-2, yoff, page_right+4, page_bottom); /* again */
1461 BSOD_RECT (bst, False,
1462 xoff + col_right + (char_width/2)+2,
1463 yoff + row_bottom + 2,
1465 page_bottom - row_bottom - 4);
1467 BSOD_PAUSE (bst, 666666);
1469 BSOD_LOOP (bst, -3);
1471 XClearWindow (dpy, window);
1476 static struct bsod_state *
1477 mac1 (Display *dpy, Window window)
1479 struct bsod_state *bst = make_bsod_state (dpy, window, "mac1", "Mac1");
1482 int pix_w = macbomb_width;
1483 int pix_h = macbomb_height;
1486 pixmap = XCreatePixmapFromBitmapData (dpy, window, (char *) macbomb_bits,
1487 macbomb_width, macbomb_height,
1488 bst->fg, bst->bg, bst->xgwa.depth);
1490 x = (bst->xgwa.width - pix_w) / 2;
1491 y = (bst->xgwa.height - pix_h) / 2;
1494 XClearWindow (dpy, window);
1495 XCopyArea (dpy, pixmap, window, bst->gc, 0, 0, pix_w, pix_h, x, y);
1501 /* This is what kernel panics looked like on MacOS X 10.0 through 10.1.5.
1502 In later releases, it's a graphic of a power button with text in
1503 English, French, German, and Japanese overlayed transparently.
1505 static struct bsod_state *
1506 macx_10_0 (Display *dpy, Window window)
1508 struct bsod_state *bst = make_bsod_state (dpy, window, "macx", "MacX");
1510 XClearWindow (dpy, window);
1511 XSetForeground (dpy, bst->gc,
1512 get_pixel_resource (dpy, bst->xgwa.colormap,
1513 "macx.textForeground",
1514 "MacX.TextForeground"));
1515 XSetBackground (dpy, bst->gc,
1516 get_pixel_resource (dpy, bst->xgwa.colormap,
1517 "macx.textBackground",
1518 "MacX.TextBackground"));
1524 int x, y, pix_w, pix_h;
1525 pixmap = xpm_data_to_pixmap (dpy, window, (char **) happy_mac,
1526 &pix_w, &pix_h, &mask);
1528 x = (bst->xgwa.width - pix_w) / 2;
1529 y = (bst->xgwa.height - pix_h) / 2;
1531 XSetClipMask (dpy, bst->gc, mask);
1532 XSetClipOrigin (dpy, bst->gc, x, y);
1533 XCopyArea (dpy, pixmap, window, bst->gc, 0, 0, pix_w, pix_h, x, y);
1534 XSetClipMask (dpy, bst->gc, None);
1535 XFreePixmap (dpy, pixmap);
1539 bst->left_margin = 0;
1540 bst->right_margin = 0;
1541 bst->y = bst->font->ascent;
1542 bst->macx_eol_kludge = True;
1545 BSOD_PAUSE (bst, 3000000);
1546 BSOD_TEXT (bst, LEFT,
1547 "panic(cpu 0): Unable to find driver for this platform: "
1548 "\"PowerMac 3,5\".\n"
1550 "backtrace: 0x0008c2f4 0x0002a7a0 0x001f0204 0x001d4e4c 0x001d4c5c "
1551 "0x001a56cc 0x01d5dbc 0x001c621c 0x00037430 0x00037364\n"
1555 "No debugger configured - dumping debug information\n"
1557 "version string : Darwin Kernel Version 1.3:\n"
1558 "Thu Mar 1 06:56:40 PST 2001; root:xnu/xnu-123.5.obj~1/RELEASE_PPC\n"
1563 "DBAT0: 00000000 00000000\n"
1564 "DBAT1: 00000000 00000000\n"
1565 "DBAT2: 80001FFE 8000003A\n"
1566 "DBAT3: 90001FFE 9000003A\n"
1568 "backtrace: 0x0008c2f4 0x0002a7a0 0x001f0204 0x001d4e4c 0x001d4c5c "
1569 "0x001a56cc 0x01d5dbc 0x001c621c 0x00037430 0x00037364\n"
1571 "panic: We are hanging here...\n");
1578 static struct bsod_state *
1579 macx_10_2 (Display *dpy, Window window, Bool v10_3_p)
1581 struct bsod_state *bst = make_bsod_state (dpy, window, "macx", "MacX");
1584 int pix_w = 0, pix_h = 0;
1587 pixmap = xpm_data_to_pixmap (dpy, window,
1588 (char **) (v10_3_p ? osx_10_3 : osx_10_2),
1590 if (! pixmap) abort();
1593 if (bst->xgwa.height > 600) /* scale up the bitmap */
1595 pixmap = double_pixmap (dpy, bst->gc, bst->xgwa.visual, bst->xgwa.depth,
1596 pixmap, pix_w, pix_h);
1597 if (! pixmap) abort();
1604 BSOD_PAUSE (bst, 2000000);
1606 bst->pixmap = pixmap;
1608 x = (bst->xgwa.width - pix_w) / 2;
1609 y = ((bst->xgwa.height - pix_h) / 2);
1610 BSOD_PIXMAP (bst, 0, 0, pix_w, pix_h, x, y);
1614 # endif /* DO_XPM */
1617 static struct bsod_state *
1618 macx (Display *dpy, Window window)
1621 switch (random() % 3) {
1622 case 0: return macx_10_0 (dpy, window); break;
1623 case 1: return macx_10_2 (dpy, window, False); break;
1624 case 2: return macx_10_2 (dpy, window, True); break;
1627 # else /* !DO_XPM */
1628 return macx_10_0 (dpy, window);
1629 # endif /* !DO_XPM */
1633 #ifndef HAVE_COCOA /* #### I have no idea how to implement this without
1634 real plane-masks. I don't think it would look
1635 right if done with alpha-transparency... */
1638 * by Martin Pool <mbp@samba.org>, Feb 2000.
1640 * This is meant to look like the preferred failure mode of NCD
1641 * Xterms. The parameters for choosing what to copy where might not
1642 * be quite right, but it looks about ugly enough.
1644 static struct bsod_state *
1645 blitdamage (Display *dpy, Window window)
1647 struct bsod_state *bst =
1648 make_bsod_state (dpy, window, "blitdamage", "BlitDamage");
1651 int delta_x = 0, delta_y = 0;
1653 int chunk_h, chunk_w;
1659 w = bst->xgwa.width;
1660 h = bst->xgwa.height;
1662 gc_mask = GCForeground;
1664 XSetPlaneMask (dpy, bst->gc, random());
1667 chunk_w = w / (random() % 1 + 1);
1668 chunk_h = h / (random() % 1 + 1);
1669 if (random() & 0x1000)
1670 delta_y = random() % 600;
1671 if (!delta_y || (random() & 0x2000))
1672 delta_x = random() % 600;
1679 for (i = 0; i < steps; i++) {
1680 if (x + chunk_w > w)
1685 if (y + chunk_h > h)
1690 BSOD_COPY (bst, src_x, src_y, chunk_w, chunk_h, x, y);
1691 BSOD_PAUSE (bst, 1000);
1696 #endif /* !HAVE_COCOA */
1700 * OS/2 panics, by Knut St. Osmundsen <bird-xscreensaver@anduin.net>
1702 * All but one messages are real ones, some are from my test machines
1703 * and system dumps, others are reconstructed from google results.
1704 * Please, don't be to hard if the formatting of the earlier systems
1705 * aren't 100% correct.
1707 static struct bsod_state *
1708 os2 (Display *dpy, Window window)
1710 struct bsod_state *bst = make_bsod_state (dpy, window, "os2", "OS2");
1713 static const char * const os2_panics[] =
1714 { /* OS/2 2.0 trap - details are bogus (CR0++). */
1715 "TRAP 0002 ERRCD=0000 ERACC=**** ERLIM=********\n"
1716 "EAX=7d240a58 EBX=ff202fdc ECX=00064423 EDX=00003624\n"
1717 "ESI=fff3272c EDI=7d240004 EBP=00004a44 FLG=00003202\n"
1718 "CS:EIP=0160:fff702a6 CSACC=c09d CSLIM=ffffffff\n"
1719 "SS:ESP=0030:00004a38 SSACC=1097 SSLIM=00003fff\n"
1720 "DS=0158 DSACC=c0f3 DSLIM=ffffffff CR0=fffffffb\n"
1721 "ES=0158 ESACC=c0f3 ESLIM=ffffffff CR2=1a060014\n"
1722 "FS=0000 FSACC=**** FSLIM=********\n"
1723 "GS=0000 GSACC=**** GSLIM=********\n"
1725 "The system detected an internal processing error\n"
1726 "at location ##0160:fff6453f - 000d:a53f\n"
1730 "Internal revision 6.307, 92/03/01\n"
1733 /* warp 3 (early) */
1734 "TRAP 000e ERRCD=0000 ERACC=**** ERLIM=********\n"
1735 "EAX=ff050c20 EBX=000000bb ECX=ffff00c1 EDx=fff379b8\n"
1736 "ESI=ffe55a3c EDI=00000000 EBP=00004eb8 FLG=00013282\n"
1737 "CS:EIP=0160:fff8dbb8 CSACC=c09b CSLIM=ffffffff\n"
1738 "SS:EIP=0030:00004eb4 SSACC=1097 SSLIM=00003fff\n"
1739 "DS=0158 DSACC=c0f3 DSLIM=ffffffff CR0=8001001b\n"
1740 "ES=0158 DSACC=c0f3 DSLIM=ffffffff CR2=000000c7\n"
1741 "FS=0000 FSACC=**** FSLIM=********\n"
1742 "GS=0000 GSACC=**** GSLIM=********\n"
1744 "The system detected an internal processing error\n"
1745 "at location ##0160:fff66bf0 - 000d:9bf0.\n"
1749 "Internal revision 8.125, 94/02/16\n"
1751 "The system is stopped. Record the location number of the error\n"
1752 "and contact your service representative.\n",
1755 "TRAP 000e ERRCD=0002 ERACC=**** ERLIM=********\n"
1756 "EAX=00000000 EBX=fdef1e0c ECX=00003824 EDX=0000edf9\n"
1757 "ESI=fdf30e80 EDI=fc8b0000 EBP=00005658 FLG=00012246\n"
1758 "CS:EIP=0160:fff8ada3 CSACC=c09b CSLIM=ffffffff\n"
1759 "SS:ESP=0030:000055d4 SSACC=1097 SSLIM=0000480f\n"
1760 "DS=0158 DSACC=c093 DSLIM=ffffffff CR0=8001001b\n"
1761 "ES=0158 ESACC=c093 ESLIM=ffffffff CR2=fc8b0000\n"
1762 "FS=03b8 FSACC=0093 FSLIM=00000023\n"
1763 "GS=0000 GSACC=**** GSLIM=********\n"
1765 "The system detected an internal processing error\n"
1766 "at location ##0160:fff5c364 - 000d:a364.\n"
1770 "Internal revision 8200,94/11/07\n"
1772 "The system is stopped. Record all of the above information and\n"
1773 "contact your service representative.\n",
1776 "TRAP 000d ERRCD=2200 ERACC=1092 ERLIM=00010fff\n"
1777 "EAX=0000802e EBX=fff001c8 ECX=9bd80000 EDX=00000000\n"
1778 "ESI=fff09bd8 EDI=fdeb001b EBP=00000000 FLG=00012012\n"
1779 "CS:EIP=0168:fff480a2 CSACC=c09b CSLIM=ffffffff\n"
1780 "SS:ESP=00e8:00001f32 SSACC=0093 SSLIM=00001fff\n"
1781 "DS=0940 DSACC=0093 DSLIM=00000397 CR0=8001001b\n"
1782 "ES=00e8 ESACC=0093 ESLIM=00001fff CR2=15760008\n"
1783 "FS=0000 FSACC=**** FSLIM=****\n"
1784 "GS=0000 GSACC=**** GSLIM=****\n"
1786 "The system detected an internal processing error\n"
1787 "at location ##0168:fff4b06e - 000e:c06e\n"
1791 "Internal revision 8.259_uni,98/01/07\n"
1793 "The system is stopped. Record all of the above information and\n"
1794 "contact your service representative.\n",
1796 /* Warp 4.52+ - the official r0trap.exe from the debugging classes */
1797 "Exception in module: OS2KRNL\n"
1798 "TRAP 000e ERRCD=0002 ERACC=**** ERLIM=********\n"
1799 "EAX=00000001 EBX=80010002 ECX=ffed4638 EDX=0003f17b\n"
1800 "ESI=00000001 EDI=00000002 EBP=00005408 FLG=00012202\n"
1801 "CS:EIP=0168:fff3cd2e CSACC=c09b CSLIM=ffffffff\n"
1802 "SS:ESP=0030:000053ec SSACC=1097 SSLIM=000044ff\n"
1803 "DS=0160 DSACC=c093 DSLIM=ffffffff CR0=8001001b\n"
1804 "ES=0160 ESACC=c093 ESLIM=ffffffff CR2=00000001\n"
1805 "FS=0000 FSACC=**** FSLIM=********\n"
1806 "GS=0000 GSACC=**** GSLIM=********\n"
1808 "The system detected an internal processing error at\n"
1809 "location ##0168:fff1e3f3 - 000e:c3f3.\n"
1813 "Internal revision 14.097_UNI\n"
1815 "The system is stopped. Record all of the above information and\n"
1816 "contact your service representative.\n",
1818 /* Warp 4.52+, typical JFS problem. */
1819 "Exeption in module: JFS\n"
1820 "TRAP 0003 ERRCD=0000 ERACC=**** ERLIM=********\n"
1821 "EAX=00000000 EBX=ffffff05 ECX=00000001 EDX=f5cd8010\n"
1822 "ESI=000000e6 EDI=000000e7 EBP=f9c7378e FLG=00002296\n"
1823 "CS:EIP=0168:f8df3250 CSACC=c09b CSLIM=ffffffff\n"
1824 "SS:ESP=1550:fdc73778 SSACC=c093 SSLIM=ffffffff\n"
1825 "DS=0160 DSACC=c093 DSLIM=ffffffff CR0=80010016\n"
1826 "ES=0160 ESACC=c093 DSLIM=ffffffff CR2=05318000\n"
1827 "FS=03c0 FSACC=0093 DSLIM=00000023\n"
1828 "GS=0160 GSACC=c093 DSLIM=ffffffff\n"
1830 "The system detected an internal processing error\n"
1831 "at location ##0168:fff1e2ab - 000e:c2ab.\n"
1836 "Internal revision 14.100c_UNI\n"
1838 "The system is stopped. Record all of the above information and\n"
1839 "contact your service representative.\n"
1842 BSOD_TEXT (bst, LEFT, os2_panics[random() % countof(os2_panics)]);
1843 BSOD_CURSOR (bst, CURSOR_LINE, 240000, 999999);
1845 XClearWindow (dpy, window);
1850 /* SPARC Solaris panic. Should look pretty authentic on Solaris boxes.
1851 * Anton Solovyev <solovam@earthlink.net>
1853 static struct bsod_state *
1854 sparc_solaris (Display *dpy, Window window)
1856 struct bsod_state *bst = make_bsod_state (dpy, window, "solaris", "Solaris");
1859 bst->scroll_p = True;
1861 bst->left_margin = bst->right_margin = bst->xgwa.width * 0.07;
1862 bst->top_margin = bst->bottom_margin = bst->xgwa.height * 0.07;
1863 bst->y = bst->top_margin + bst->font->ascent;
1866 BSOD_PAUSE (bst, 3000000);
1869 BSOD_RECT (bst, True,
1870 bst->left_margin, bst->top_margin,
1871 bst->xgwa.width - bst->left_margin - bst->right_margin,
1872 bst->xgwa.height - bst->top_margin - bst->bottom_margin);
1875 BSOD_TEXT (bst, LEFT,
1876 "BAD TRAP: cpu=0 type=0x31 rp=0x2a10043b5e0 addr=0xf3880 mmu_fsr=0x0\n"
1877 "BAD TRAP occurred in module \"unix\" due to an illegal access to a"
1879 "adb: trap type = 0x31\n"
1881 "pid=307, pc=0x100306e4, sp=0x2a10043ae81, tstate=0x4480001602,"
1883 "g1-g7: 1045b000, 32f, 10079440, 180, 300000ebde8, 0, 30000953a20\n"
1884 "Begin traceback... sp = 2a10043ae81\n"
1885 "Called from 100bd060, fp=2a10043af31, args=f3700 300008cc988 f3880 0"
1887 "Called from 101fe1bc, fp=2a10043b011, args=3000045a240 104465a0"
1888 " 300008e47d0 300008e48fa 300008ae350 300008ae410\n"
1889 "Called from 1007c520, fp=2a10043b0c1, args=300008e4878 300003596e8 0"
1890 " 3000045a320 0 3000045a220\n"
1891 "Called from 1007c498, fp=2a10043b171, args=1045a000 300007847f0 20"
1892 " 3000045a240 1 0\n"
1893 "Called from 1007972c, fp=2a10043b221, args=1 300009517c0 30000951e58 1"
1895 "Called from 10031e10, fp=2a10043b2d1, args=3000095b0c8 0 300009396a8"
1896 " 30000953a20 0 1\n"
1897 "Called from 10000bdd8, fp=ffffffff7ffff1c1, args=0 57 100131480"
1898 " 100131480 10012a6e0 0\n"
1899 "End traceback...\n"
1900 "panic[cpu0]/thread=30000953a20: trap\n"
1901 "syncing file systems...");
1903 BSOD_PAUSE (bst, 3000000);
1905 BSOD_TEXT (bst, LEFT, " 1 done\n");
1906 BSOD_TEXT (bst, LEFT, "dumping to /dev/dsk/c0t0d0s3, offset 26935296\n");
1907 BSOD_PAUSE (bst, 2000000);
1910 for (i = 1; i <= 100; ++i)
1913 sprintf (buf, "\b\b\b\b\b\b\b\b\b\b\b%3d%% done", i);
1914 BSOD_TEXT (bst, LEFT, buf);
1915 BSOD_PAUSE (bst, 100000);
1918 BSOD_TEXT (bst, LEFT,
1919 ": 2803 pages dumped, compression ratio 2.88, dump succeeded\n");
1920 BSOD_PAUSE (bst, 2000000);
1922 BSOD_TEXT (bst, LEFT,
1930 /* Linux panic and fsck, by jwz
1932 static struct bsod_state *
1933 linux_fsck (Display *dpy, Window window)
1935 struct bsod_state *bst = make_bsod_state (dpy, window, "linux", "Linux");
1938 const char *sysname;
1941 const char *linux_panic[] = {
1942 " kernel: Unable to handle kernel paging request at virtual "
1943 "address 0000f0ad\n",
1944 " kernel: printing eip:\n",
1945 " kernel: c01becd7\n",
1946 " kernel: *pde = 00000000\n",
1947 " kernel: Oops: 0000\n",
1948 " kernel: CPU: 0\n",
1949 " kernel: EIP: 0010:[<c01becd7>] Tainted: P \n",
1950 " kernel: EFLAGS: 00010286\n",
1951 " kernel: eax: 0000ff00 ebx: ca6b7e00 ecx: ce1d7a60 edx: ce1d7a60\n",
1952 " kernel: esi: ca6b7ebc edi: 00030000 ebp: d3655ca0 esp: ca6b7e5c\n",
1953 " kernel: ds: 0018 es: 0018 ss: 0018\n",
1954 " kernel: Process crond (pid: 1189, stackpage=ca6b7000)\n",
1955 " kernel: Stack: d3655ca0 ca6b7ebc 00030054 ca6b7e7c c01c1e5b "
1956 "00000287 00000020 c01c1fbf \n",
1958 " kernel: 00005a36 000000dc 000001f4 00000000 00000000 "
1959 "ce046d40 00000001 00000000 \n",
1961 " kernel: ffffffff d3655ca0 d3655b80 00030054 c01bef93 "
1962 "d3655ca0 ca6b7ebc 00030054 \n",
1964 " kernel: Call Trace: [<c01c1e5b>] [<c01c1fbf>] [<c01bef93>] "
1965 "[<c01bf02b>] [<c0134c4f>]\n",
1967 " kernel: [<c0142562>] [<c0114f8c>] [<c0134de3>] [<c010891b>]\n",
1969 " kernel: Code: 2a 00 75 08 8b 44 24 2c 85 c0 74 0c 8b 44 24 58 83 48 18 "
1974 bst->scroll_p = True;
1976 bst->left_margin = bst->right_margin = 10;
1977 bst->top_margin = bst->bottom_margin = 10;
1984 if (uname (&uts) >= 0)
1985 sysname = uts.nodename;
1986 s = strchr (sysname, '.');
1989 # endif /* !HAVE_UNAME */
1992 BSOD_TEXT (bst, LEFT, "waiting for X server to shut down ");
1993 BSOD_PAUSE (bst, 100000);
1994 BSOD_TEXT (bst, LEFT,
1995 "XIO: fatal IO error 2 (broken pipe) on X server \":0.0\"\n"
1996 " after 339471 requests (339471 known processed) "
1997 "with 0 events remaining\n");
1998 BSOD_CHAR_DELAY (bst, 300000);
1999 BSOD_TEXT (bst, LEFT, ".........\n");
2000 BSOD_CHAR_DELAY (bst, 0);
2001 BSOD_TEXT (bst, LEFT,
2002 "xinit: X server slow to shut down, sending KILL signal.\n"
2003 "waiting for server to die ");
2004 BSOD_CHAR_DELAY (bst, 300000);
2005 BSOD_TEXT (bst, LEFT, "...\n");
2006 BSOD_CHAR_DELAY (bst, 0);
2007 BSOD_TEXT (bst, LEFT, "xinit: Can't kill server\n");
2008 BSOD_PAUSE (bst, 2000000);
2010 sprintf (buf, "\n%s Login: ", sysname);
2011 BSOD_TEXT (bst, LEFT, buf);
2012 BSOD_PAUSE (bst, 1000000);
2013 BSOD_TEXT (bst, LEFT,
2015 "Parallelizing fsck version 1.22 (22-Jun-2001)\n"
2016 "e2fsck 1.22, 22-Jun-2001 for EXT2 FS 0.5b, 95/08/09\n"
2017 "Warning! /dev/hda1 is mounted.\n"
2018 "/dev/hda1 contains a file system with errors, check forced.\n");
2019 BSOD_PAUSE (bst, 1000000);
2021 if (0 == random() % 2)
2022 BSOD_TEXT (bst, LEFT,
2023 "Couldn't find ext2 superblock, trying backup blocks...\n"
2024 "The filesystem size (according to the superblock) is 3644739 blocks\n"
2025 "The physical size of the device is 3636706 blocks\n"
2026 "Either the superblock or the partition table is likely to be corrupt!\n"
2028 BSOD_PAUSE (bst, 1000000);
2032 BSOD_TEXT (bst, LEFT, "Pass 1: Checking inodes, blocks, and sizes\n");
2033 BSOD_PAUSE (bst, 2000000);
2035 i = (random() % 60) - 20;
2038 int b = random() % 0xFFFF;
2039 sprintf (buf, "Deleted inode %d has zero dtime. Fix<y>? yes\n\n", b);
2040 BSOD_TEXT (bst, LEFT, buf);
2041 BSOD_PAUSE (bst, 1000);
2044 i = (random() % 40) - 10;
2047 int g = random() % 0xFFFF;
2048 int b = random() % 0xFFFFFFF;
2050 BSOD_PAUSE (bst, 1000000);
2052 sprintf (buf, "Warning: Group %d's copy of the group descriptors "
2053 "has a bad block (%d).\n", g, b);
2054 BSOD_TEXT (bst, LEFT, buf);
2056 b = random() % 0x3FFFFF;
2059 b += random() % 0xFFFF;
2061 "Error reading block %d (Attempt to read block "
2062 "from filesystem resulted in short read) while doing "
2063 "inode scan. Ignore error<y>?",
2065 BSOD_TEXT (bst, LEFT, buf);
2066 BSOD_PAUSE (bst, 10000);
2067 BSOD_TEXT (bst, LEFT, " yes\n\n");
2071 if (0 == (random() % 10))
2073 BSOD_PAUSE (bst, 1000000);
2075 i = 3 + (random() % 10);
2078 BSOD_TEXT (bst, LEFT,
2079 "Could not allocate 256 block(s) for inode table: "
2080 "No space left on device\n");
2081 BSOD_PAUSE (bst, 1000);
2083 BSOD_TEXT (bst, LEFT, "Restarting e2fsck from the beginning...\n");
2084 BSOD_PAUSE (bst, 2000000);
2089 i = (random() % 20) - 5;
2092 BSOD_PAUSE (bst, 1000000);
2096 int j = 5 + (random() % 10);
2097 int w = random() % 4;
2101 int b = random() % 0xFFFFF;
2102 int g = random() % 0xFFF;
2104 if (0 == (random() % 10))
2106 else if (0 == (random() % 10))
2111 "Inode table for group %d not in group. (block %d)\n"
2112 "WARNING: SEVERE DATA LOSS POSSIBLE.\n"
2117 "Block bitmap for group %d not in group. (block %d)\n"
2122 "Inode bitmap %d for group %d not in group.\n"
2125 else /* if (w == 3) */
2127 "Bad block %d in group %d's inode table.\n"
2128 "WARNING: SEVERE DATA LOSS POSSIBLE.\n"
2132 BSOD_TEXT (bst, LEFT, buf);
2133 BSOD_TEXT (bst, LEFT, " yes\n\n");
2134 BSOD_PAUSE (bst, 1000);
2139 if (0 == random() % 10) goto PANIC;
2140 BSOD_TEXT (bst, LEFT, "Pass 2: Checking directory structure\n");
2141 BSOD_PAUSE (bst, 2000000);
2143 i = (random() % 20) - 5;
2146 int n = random() % 0xFFFFF;
2147 int o = random() % 0xFFF;
2148 sprintf (buf, "Directory inode %d, block 0, offset %d: "
2149 "directory corrupted\n"
2152 BSOD_TEXT (bst, LEFT, buf);
2153 BSOD_PAUSE (bst, 1000);
2154 BSOD_TEXT (bst, LEFT, " yes\n\n");
2156 if (0 == (random() % 100))
2158 sprintf (buf, "Missing '.' in directory inode %d.\nFix<y>?", n);
2159 BSOD_TEXT (bst, LEFT, buf);
2160 BSOD_PAUSE (bst, 1000);
2161 BSOD_TEXT (bst, LEFT, " yes\n\n");
2165 if (0 == random() % 10)
2168 BSOD_TEXT (bst, LEFT,
2169 "Pass 3: Checking directory connectivity\n"
2170 "/lost+found not found. Create? yes\n");
2171 BSOD_PAUSE (bst, 2000000);
2173 /* Unconnected directory inode 4949 (/var/spool/squid/06/???)
2174 Connect to /lost+found<y>? yes
2176 '..' in /var/spool/squid/06/08 (20351) is <The NULL inode> (0), should be
2177 /var/spool/squid/06 (20350).
2180 Unconnected directory inode 128337 (/var/spool/squid/06/???)
2181 Connect to /lost+found<y>? yes
2185 if (0 == random() % 10) goto PANIC;
2186 BSOD_TEXT (bst, LEFT, "Pass 4: Checking reference counts\n");
2187 BSOD_PAUSE (bst, 2000000);
2189 /* Inode 2 ref count is 19, should be 20. Fix<y>? yes
2191 Inode 4949 ref count is 3, should be 2. Fix<y>? yes
2195 Inode 128336 ref count is 3, should be 2. Fix<y>? yes
2197 Inode 128337 ref count is 3, should be 2. Fix<y>? yes
2202 if (0 == random() % 10) goto PANIC;
2203 BSOD_TEXT (bst, LEFT, "Pass 5: Checking group summary information\n");
2204 BSOD_PAUSE (bst, 2000000);
2206 i = (random() % 200) - 50;
2209 BSOD_TEXT (bst, LEFT, "Block bitmap differences: ");
2212 sprintf (buf, " %d", -(random() % 0xFFF));
2213 BSOD_TEXT (bst, LEFT, buf);
2214 BSOD_PAUSE (bst, 1000);
2216 BSOD_TEXT (bst, LEFT, "\nFix? yes\n\n");
2220 i = (random() % 100) - 50;
2223 BSOD_TEXT (bst, LEFT, "Inode bitmap differences: ");
2226 sprintf (buf, " %d", -(random() % 0xFFF));
2227 BSOD_TEXT (bst, LEFT, buf);
2228 BSOD_PAUSE (bst, 1000);
2230 BSOD_TEXT (bst, LEFT, "\nFix? yes\n\n");
2233 i = (random() % 20) - 5;
2236 int g = random() % 0xFFFF;
2237 int c = random() % 0xFFFF;
2239 "Free blocks count wrong for group #0 (%d, counted=%d).\nFix? ",
2241 BSOD_TEXT (bst, LEFT, buf);
2242 BSOD_PAUSE (bst, 1000);
2243 BSOD_TEXT (bst, LEFT, " yes\n\n");
2249 BSOD_TEXT (bst, LEFT, "\n\n");
2250 while (linux_panic[i])
2252 time_t t = time ((time_t *) 0);
2253 struct tm *tm = localtime (&t);
2256 if (*linux_panic[i])
2258 strftime (prefix, sizeof(prefix)-1, "%b %d %H:%M:%S ", tm);
2259 BSOD_TEXT (bst, LEFT, prefix);
2260 BSOD_TEXT (bst, LEFT, sysname);
2261 BSOD_TEXT (bst, LEFT, linux_panic[i]);
2262 BSOD_PAUSE (bst, 1000);
2265 BSOD_PAUSE (bst, 300000);
2269 BSOD_PAUSE (bst, 4000000);
2271 XClearWindow(dpy, window);
2277 * Linux (hppa) panic, by Stuart Brady <sdbrady@ntlworld.com>
2278 * Output courtesy of M. Grabert
2280 static struct bsod_state *
2281 hppa_linux (Display *dpy, Window window)
2283 struct bsod_state *bst =
2284 make_bsod_state (dpy, window, "hppalinux", "HPPALinux");
2287 const char *release, *sysname, *gccversion, *version;
2288 long int linedelay = 0;
2291 struct { long int delay; const char *string; } linux_panic[] =
2292 {{ 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"
2293 "\n\n\n\n\n\n\n\n\n\n\n\n\n" },
2294 { 0, "Linux version %s (root@%s) (gcc version %s) %s\n" },
2295 { 4000, "FP[0] enabled: Rev 1 Model 16\n" },
2296 { 10, "The 32-bit Kernel has started...\n" },
2297 { -1, "Determining PDC firmware type: System Map.\n" },
2298 { -1, "model 00005bb0 00000481 00000000 00000002 7778df9f 100000f0 "
2299 "00000008 000000b2 000000b2\n" },
2300 { -1, "vers 00000203\n" },
2301 { -1, "CPUID vers 17 rev 7 (0x00000227)\n" },
2302 { -1, "capabilities 0x3\n" },
2303 { -1, "model 9000/785/C3000\n" },
2304 { -1, "Total Memory: 1024 Mb\n" },
2305 { -1, "On node 0 totalpages: 262144\n" },
2306 { -1, " DMA zone: 262144 pages, LIFO batch:16\n" },
2307 { -1, " Normal zone: 0 pages, LIFO batch:1\n" },
2308 { -1, " HighMem zone: 0 pages, LIFO batch:1\n" },
2309 { -1, "LCD display at f05d0008,f05d0000 registered\n" },
2310 { -1, "Building zonelist for node : 0\n" },
2311 { -1, "Kernel command line: ide=nodma root=/dev/sda3 HOME=/ ip=off "
2312 "console=ttyS0 TERM=vt102 palo_kernel=2/vmlinux-2.6\n" },
2313 { -1, "ide_setup: ide=nodmaIDE: Prevented DMA\n" },
2314 { -1, "PID hash table entries: 16 (order 4: 128 bytes)\n" },
2315 {500, "Console: colour dummy device 160x64\n" },
2316 { 10, "Memory: 1034036k available\n" },
2317 { -1, "Calibrating delay loop... 796.67 BogoMIPS\n" },
2318 { -1, "Dentry cache hash table entries: 131072 (order: 7, 524288 "
2320 { -1, "Inode-cache hash table entries: 65536 (order: 6, 262144 "
2322 { -1, "Mount-cache hash table entries: 512 (order: 0, 4096 bytes)\n" },
2323 { -1, "POSIX conformance testing by UNIFIX\n" },
2324 { -1, "NET: Registered protocol family 16\n" },
2325 { 100, "Searching for devices...\n" },
2326 { 25, "Found devices:\n" },
2327 { 10, "1. Astro BC Runway Port at 0xfed00000 [10] "
2328 "{ 12, 0x0, 0x582, 0x0000b }\n" },
2329 { -1, "2. Elroy PCI Bridge at 0xfed30000 [10/0] "
2330 "{ 13, 0x0, 0x782, 0x0000a }\n" },
2331 { -1, "3. Elroy PCI Bridge at 0xfed32000 [10/1] "
2332 "{ 13, 0x0, 0x782, 0x0000a }\n" },
2333 { -1, "4. Elroy PCI Bridge at 0xfed38000 [10/4] "
2334 "{ 13, 0x0, 0x782, 0x0000a }\n" },
2335 { -1, "5. Elroy PCI Bridge at 0xfed3c000 [10/6] "
2336 "{ 13, 0x0, 0x782, 0x0000a }\n" },
2337 { -1, "6. AllegroHigh W at 0xfffa0000 [32] "
2338 "{ 0, 0x0, 0x5bb, 0x00004 }\n" },
2339 { -1, "7. Memory at 0xfed10200 [49] { 1, 0x0, 0x086, 0x00009 }\n" },
2340 { -1, "CPU(s): 1 x PA8500 (PCX-W) at 400.000000 MHz\n" },
2341 { -1, "SBA found Astro 2.1 at 0xfed00000\n" },
2342 { -1, "lba version TR2.1 (0x2) found at 0xfed30000\n" },
2343 { -1, "lba version TR2.1 (0x2) found at 0xfed32000\n" },
2344 { -1, "lba version TR2.1 (0x2) found at 0xfed38000\n" },
2345 { -1, "lba version TR2.1 (0x2) found at 0xfed3c000\n" },
2346 { 100, "SCSI subsystem initialized\n" },
2347 { 10, "drivers/usb/core/usb.c: registered new driver usbfs\n" },
2348 { -1, "drivers/usb/core/usb.c: registered new driver hub\n" },
2349 { -1, "ikconfig 0.7 with /proc/config*\n" },
2350 { -1, "Initializing Cryptographic API\n" },
2351 { 250, "SuperIO: probe of 0000:00:0e.0 failed with error -1\n" },
2352 { 20, "SuperIO: Found NS87560 Legacy I/O device at 0000:00:0e.1 "
2354 { -1, "SuperIO: Serial port 1 at 0x3f8\n" },
2355 { -1, "SuperIO: Serial port 2 at 0x2f8\n" },
2356 { -1, "SuperIO: Parallel port at 0x378\n" },
2357 { -1, "SuperIO: Floppy controller at 0x3f0\n" },
2358 { -1, "SuperIO: ACPI at 0x7e0\n" },
2359 { -1, "SuperIO: USB regulator enabled\n" },
2360 { -1, "SuperIO: probe of 0000:00:0e.2 failed with error -1\n" },
2361 { -1, "Soft power switch enabled, polling @ 0xf0400804.\n" },
2362 { -1, "pty: 256 Unix98 ptys configured\n" },
2363 { -1, "Generic RTC Driver v1.07\n" },
2364 { -1, "Serial: 8250/16550 driver $Revision: 1.88 $ 13 ports, "
2365 "IRQ sharing disabled\n" },
2366 { -1, "ttyS0 at I/O 0x3f8 (irq = 0) is a 16550A\n" },
2367 { -1, "ttyS1 at I/O 0x2f8 (irq = 0) is a 16550A\n" },
2368 { -1, "Linux Tulip driver version 1.1.13 (May 11, 2002)\n" },
2369 { 150, "tulip0: no phy info, aborting mtable build\n" },
2370 { 10, "tulip0: MII transceiver #1 config 1000 status 782d "
2371 "advertising 01e1.\n" },
2372 { -1, "eth0: Digital DS21143 Tulip rev 65 at 0xf4008000, "
2373 "00:10:83:F9:B4:34, IRQ 66.\n" },
2374 { -1, "Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2\n" },
2375 { -1, "ide: Assuming 33MHz system bus speed for PIO modes; "
2376 "override with idebus=xx\n" },
2377 { 100, "SiI680: IDE controller at PCI slot 0000:01:06.0\n" },
2378 { 10, "SiI680: chipset revision 2\n" },
2379 { -1, "SiI680: BASE CLOCK == 133\n" },
2380 { -1, "SiI680: 100% native mode on irq 128\n" },
2381 { -1, " ide0: MMIO-DMA at 0xf4800000-0xf4800007 -- "
2382 "Error, MMIO ports already in use.\n" },
2383 { -1, " ide1: MMIO-DMA at 0xf4800008-0xf480000f -- "
2384 "Error, MMIO ports already in use.\n" },
2385 { 5, "hda: TS130220A2, ATA DISK drive\n" },
2386 { -1, " _______________________________\n" },
2387 { -1, " < Your System ate a SPARC! Gah! >\n" },
2388 { -1, " -------------------------------\n" },
2389 { -1, " \\ ^__^\n" },
2390 { -1, " \\ (xx)\\_______\n" },
2391 { -1, " (__)\\ )\\/\\\n" },
2392 { -1, " U ||----w |\n" },
2394 { -1, "swapper (pid 1): Breakpoint (code 0)\n" },
2396 { -1, " YZrvWESTHLNXBCVMcbcbcbcbOGFRQPDI\n" },
2397 { -1, "PSW: 00000000000001001111111100001111 Not tainted\n" },
2398 { -1, "r00-03 4d6f6f21 1032f010 10208f34 103fc2e0\n" },
2399 { -1, "r04-07 103fc230 00000001 00000001 0000000f\n" },
2400 { -1, "r08-11 103454f8 000f41fa 372d3980 103ee404\n" },
2401 { -1, "r12-15 3ccbf700 10344810 103ee010 f0400004\n" },
2402 { -1, "r16-19 f00008c4 f000017c f0000174 00000000\n" },
2403 { -1, "r20-23 fed32840 fed32800 00000000 0000000a\n" },
2404 { -1, "r24-27 0000ffa0 000000ff 103fc2e0 10326010\n" },
2405 { -1, "r28-31 00000000 00061a80 4ff98340 10208f34\n" },
2406 { -1, "sr0-3 00000000 00000000 00000000 00000000\n" },
2407 { -1, "sr4-7 00000000 00000000 00000000 00000000\n" },
2409 { -1, "IASQ: 00000000 00000000 IAOQ: 00000000 00000004\n" },
2410 { -1, " IIR: 00000000 ISR: 00000000 IOR: 00000000\n" },
2411 { -1, " CPU: 0 CR30: 4ff98000 CR31: 1037c000\n" },
2412 { -1, " ORIG_R28: 55555555\n" },
2413 { -1, " IAOQ[0]: 0x0\n" },
2414 { -1, " IAOQ[1]: 0x4\n" },
2415 { -1, " RP(r2): probe_hwif+0x218/0x44c\n" },
2416 { -1, "Kernel panic: Attempted to kill init!\n" },
2419 bst->scroll_p = True;
2421 bst->left_margin = bst->right_margin = 10;
2422 bst->top_margin = bst->bottom_margin = 10;
2424 release = "2.6.0-test11-pa2";
2426 version = "#2 Mon Dec 8 06:09:27 GMT 2003";
2431 if (uname (&uts) >= 0)
2433 sysname = uts.nodename;
2434 if (!strcmp (uts.sysname, "Linux"))
2436 release = uts.release;
2437 version = uts.version;
2440 s = strchr (sysname, '.');
2443 # endif /* !HAVE_UNAME */
2445 # if (defined (__GNUC__) && defined (__VERSION__))
2446 gccversion = __VERSION__;
2447 # else /* !(defined (__GNUC__) && defined (__VERSION__)) */
2448 gccversion = "3.3.2 (Debian)";
2449 # endif /* !(defined (__GNUC__) && defined (__VERSION__)) */
2451 /* Insert current host name into banner on line 2 */
2454 snprintf (ss, 1024, linux_panic[1].string,
2455 release, sysname, gccversion, version);
2456 linux_panic[1].string = ss;
2459 BSOD_PAUSE (bst, 100000);
2460 while (linux_panic[i].string)
2462 if (linux_panic[i].delay != -1)
2463 linedelay = linux_panic[i].delay * 1000;
2464 BSOD_PAUSE (bst, linedelay);
2465 BSOD_TEXT (bst, LEFT, linux_panic[i].string);
2469 bst->y = bst->xgwa.height - bst->font->ascent - bst->font->descent;
2471 XClearWindow(dpy, window);
2476 /* VMS by jwz (text sent by Roland Barmettler <roli@barmettler.net>)
2478 static struct bsod_state *
2479 vms (Display *dpy, Window window)
2481 struct bsod_state *bst = make_bsod_state (dpy, window, "vms", "VMS");
2483 const char *sysname;
2485 int dot_delay = 40000;
2486 int chunk_delay = 500000;
2493 const char *lines[] = {
2494 "%CNXMAN, Lost connection to system #\n"
2495 "%SHADOW-I-VOLPROC, DSA0: shadow master has changed. "
2496 "Dump file WILL be written if system crashes.\n"
2500 "%CNXMAN, Quorum lost, blocking activity\n"
2501 "%CNXMAN, Timed-out lost connection to system #\n"
2502 "%CNXMAN, Timed-out lost connection to system #\n"
2503 "%CNXMAN, Timed-out lost connection to system #\n"
2504 "%CNXMAN, Proposing reconfiguration of the VMScluster\n",
2507 "%CNXMAN, Removed from VMScluster system #\n"
2508 "%CNXMAN, Removed from VMScluster system #\n"
2509 "%CNXMAN, Removed from VMScluster system #\n"
2510 "%CNXMAN, Completing VMScluster state transition\n",
2513 "**** OpenVMS (TM) Alpha Operating system V7.3-1 - BUGCHECK ****\n"
2515 "** Bugcheck code = 000005DC: CLUEXIT, Node voluntarily exiting "
2517 "** Crash CPU: 00 Primary CPU: 00 Active CPUs: 00000001\n"
2518 "** Current Process = NULL\n"
2519 "** Current PSB ID = 00000001\n"
2522 "** Dumping error log buffers to HBVS unit 0\n"
2523 "**** Unable to dump error log buffers to remaining shadow set members\n"
2524 "** Error log buffers not dumped to HBVS unit 200\n"
2526 "** Dumping memory to HBVS unit 0\n"
2527 "**** Starting compressed selective memory dump at #...\n",
2532 "**** Memory dump complete - not all processes or global pages saved\n",
2540 "HALT instruction executed\n"
2541 "PC = ffffffff800c3884\n",
2547 "resetting all I/O buses\n"
2554 bst->scroll_p = True;
2556 bst->left_margin = bst->right_margin = 10;
2557 bst->top_margin = bst->bottom_margin = 10;
2563 if (uname (&uts) >= 0)
2564 sysname = uts.nodename;
2565 s = strchr (sysname, '.');
2568 # endif /* !HAVE_UNAME */
2570 args[0] = malloc (strlen(sysname) + 7);
2571 strcpy (args[0], sysname);
2574 /* Pick three numbers, 1-9, no overlaps. */
2575 ids[0] = 1 + (random() % 9);
2576 do { ids[1] = 1 + (random() % 9); } while (ids[1]==ids[0]);
2577 do { ids[2] = 1 + (random() % 9); } while (ids[2]==ids[0] || ids[2]==ids[1]);
2579 i = strlen(args[0])-1;
2581 args[0][i] = '0' + ids[0];
2584 for (s = args[0]; *s; s++)
2585 if (isalpha(*s)) *s = toupper (*s);
2587 args[1] = strdup (args[0]);
2588 args[2] = strdup (args[0]); args[2][i] = '0' + ids[1];
2589 args[3] = strdup (args[0]); args[3][i] = '0' + ids[2];
2591 args[4] = strdup (args[1]);
2592 args[5] = strdup (args[2]);
2593 args[6] = strdup (args[3]);
2596 time_t t = time ((time_t *) 0);
2597 struct tm *tm = localtime (&t);
2598 args[7] = malloc (30);
2599 strftime (args[7], 29, "%d-%b-%Y %H:%M", tm);
2600 for (s = args[7]; *s; s++)
2601 if (isalpha(*s)) *s = toupper (*s);
2605 for (i = 0; i < countof(lines); i++)
2607 const char *fmt = lines[i];
2608 if (! strcmp (fmt, "..."))
2610 int steps = 180 + (random() % 60);
2611 while (--steps >= 0)
2613 BSOD_TEXT (bst, LEFT, ".");
2614 BSOD_PAUSE (bst, dot_delay);
2619 char *fmt2 = malloc (strlen (fmt) * 2 + 1);
2620 for (s = (char *) fmt, s1 = fmt2; *s; s++)
2624 strcpy (s1, args[arg_count++]);
2631 BSOD_CHAR_DELAY (bst, char_delay);
2632 BSOD_TEXT (bst, LEFT, fmt2);
2634 BSOD_CHAR_DELAY (bst, 0);
2635 BSOD_PAUSE (bst, chunk_delay);
2639 for (i = 0; i < countof (args); i++)
2642 XClearWindow(dpy, window);
2647 /* HVX (formerly GCOS6) and TPS6 crash
2648 by Brian Garratt <brian-m.garratt@bull.co.uk>
2650 GCOS6 is a Unix-like operating system developed by Honeywell in the
2651 1970s in collaboration with MIT and AT&T (who called their version
2652 UNIX). Both are very much like MULTICS which Honeywell got from GE.
2654 HVX ("High-performance Virtual System on Unix") is an AIX application
2655 which emulates GCOS6 hardware on RS6000-like machines.
2657 static struct bsod_state *
2658 hvx (Display *dpy, Window window)
2660 struct bsod_state *bst = make_bsod_state (dpy, window, "hvx", "HVX");
2662 bst->scroll_p = True;
2664 bst->y = bst->xgwa.height - bst->bottom_margin - bst->font->ascent;
2666 BSOD_CHAR_DELAY (bst, 10000);
2667 BSOD_TEXT (bst, LEFT,
2668 "(TP) Trap no E Effective address 00000000 Instruction D7DE\n"
2669 "(TP) Registers :\n"
2670 "(TP) B1 -> B7 03801B02 00000000 03880D45 038BABDB 0388AFFD"
2671 " 0389B3F8 03972317\n"
2672 "(TP) R1 -> R7 0001 0007 F10F 090F 0020 0106 0272\n"
2673 "(TP) P I Z M1 0388A18B 3232 0000 FF00\n"
2674 "(TP) Program counter is at offset 0028 from string YTPAD\n"
2675 "(TP) User id of task which trapped is LT 626\n"
2678 BSOD_PAUSE (bst, 1000000);
2680 BSOD_CHAR_DELAY (bst, 100000);
2681 BSOD_TEXT (bst, LEFT, " TP CLOSE ALL");
2683 BSOD_CHAR_DELAY (bst, 10000);
2684 BSOD_TEXT (bst, LEFT, "\n(TP)?\n");
2685 BSOD_PAUSE (bst, 1000000);
2687 BSOD_CHAR_DELAY (bst, 100000);
2688 BSOD_TEXT (bst, LEFT, " TP ABORT -LT ALL");
2690 BSOD_CHAR_DELAY (bst, 10000);
2691 BSOD_TEXT (bst, LEFT, "\n(TP)?\n");
2692 BSOD_PAUSE (bst, 1000000);
2694 BSOD_CHAR_DELAY (bst, 100000);
2695 BSOD_TEXT (bst, LEFT, " TP STOP KILL");
2697 BSOD_CHAR_DELAY (bst, 10000);
2698 BSOD_TEXT (bst, LEFT,
2701 "Core dumps initiated for selected HVX processes ...\n"
2702 "Core dumps complete.\n"
2703 "Fri Jul 19 15:53:09 2002\n"
2704 "Live registers for cp 0:\n"
2705 " P = 7de3 IW=0000 I=32 CI=30000000 S=80006013"
2706 " IV=aa0 Level=13\n"
2707 " R1-7 = 1f 913 13 4 8 0 0\n"
2708 " B1-7 = 64e71b a93 50e 64e73c 6c2c 7000 b54\n"
2709 "Memory dump starting to file /var/hvx/dp01/diag/Level2 ...\n"
2710 "Memory dump complete.\n"
2713 XClearWindow(dpy, window);
2718 /* HPUX panic, by Tobias Klausmann <klausman@schwarzvogel.de>
2720 static struct bsod_state *
2721 hpux (Display *dpy, Window window)
2723 struct bsod_state *bst = make_bsod_state (dpy, window, "hvx", "HVX");
2724 const char *sysname;
2727 bst->scroll_p = True;
2728 bst->y = bst->xgwa.height - bst->bottom_margin - bst->font->ascent;
2735 if (uname (&uts) >= 0)
2736 sysname = uts.nodename;
2737 s = strchr (sysname, '.');
2740 # endif /* !HAVE_UNAME */
2742 BSOD_TEXT (bst, LEFT,
2746 sprintf (buf, "%.100s [HP Release B.11.00] (see /etc/issue)\n", sysname);
2747 BSOD_TEXT (bst, LEFT, buf);
2748 BSOD_PAUSE (bst, 1000000);
2749 BSOD_TEXT (bst, LEFT,
2752 " ******* Unexpected HPMC/TOC. Processor HPA FFFFFFFF'"
2753 "FFFA0000 *******\n"
2754 " GENERAL REGISTERS:\n"
2755 "r00/03 00000000'00000000 00000000'00000000 00000000'00000000 00000000'"
2757 "r04/07 00000000'00000001 00000000'0126E328 00000000'00000000 00000000'"
2759 "r08/11 00000000'00000000 00000000'0198CFC0 00000000'000476FE 00000000'"
2761 "r12/15 00000000'40013EE8 00000000'08000080 00000000'4002530C 00000000'"
2763 "r16/19 00000000'7F7F2A00 00000000'00000001 00000000'00000000 00000000'"
2765 "r20/23 00000000'006C8048 00000000'00000001 00000000'00000000 00000000'"
2767 "r24/27 00000000'00000000 00000000'00000000 00000000'00000000 00000000'"
2769 "r28/31 00000000'00000000 00000000'007DD628 00000000'0199F2B0 00000000'"
2771 " CONTROL REGISTERS:\n"
2772 "sr0/3 00000000'0F3B4000 00000000'0C2A2000 00000000'016FF800 00000000'"
2774 "sr4/7 00000000'00000000 00000000'016FF800 00000000'0DBF1400 00000000'"
2776 "pcq = 00000000'00000000.00000000'00104950 00000000'00000000.00000000'"
2778 "isr = 00000000'10240006 ior = 00000000'67D9E220 iir = 08000240 rctr = "
2781 "pid reg cr8/cr9 00007700'0000B3A9 00000000'0000C5D8\n"
2782 "pid reg cr12/cr13 00000000'00000000 00000000'00000000\n"
2783 "ipsw = 000000FF'080CFF1F iva = 00000000'0002C000 sar = 3A ccr = C0\n"
2784 "tr0/3 00000000'006C76C0 00000000'00000001 00000000'00000000 00000000'"
2786 "tr4/7 00000000'03790000 0000000C'4FB68340 00000000'C07EE13F 00000000'"
2788 "eiem = FFFFFFF0'FFFFFFFF eirr = 80000000'00000000 itmr = 0000000C'"
2790 "cr1/4 00000000'00000000 00000000'00000000 00000000'00000000 00000000'"
2792 "cr5/7 00000000'00000000 00000000'00000000 00000000'"
2794 " MACHINE CHECK PARAMETERS:\n"
2795 "Check Type = 00000000 CPU STATE = 9E000001 Cache Check = 00000000\n"
2796 "TLB Check = 00000000 Bus Check = 00000000 PIM State = ? SIU "
2797 "Status = ????????\n"
2798 "Assists = 00000000 Processor = 00000000\n"
2799 "Slave Addr = 00000000'00000000 Master Addr = 00000000'00000000\n"
2802 "TOC, pcsq.pcoq = 0'0.0'104950 , isr.ior = 0'10240006.0'67d9e220\n"
2803 "@(#)B2352B/9245XB HP-UX (B.11.00) #1: Wed Nov 5 22:38:19 PST 1997\n"
2804 "Transfer of control: (display==0xd904, flags==0x0)\n"
2808 "*** A system crash has occurred. (See the above messages for details.)\n"
2809 "*** The system is now preparing to dump physical memory to disk, for use\n"
2810 "*** in debugging the crash.\n"
2812 "*** The dump will be a SELECTIVE dump: 40 of 256 megabytes.\n"
2813 "*** To change this dump type, press any key within 10 seconds.\n"
2814 "*** Proceeding with selective dump.\n"
2816 "*** The dump may be aborted at any time by pressing ESC.\n");
2822 for (i = 0; i <= steps; i++)
2824 if (i > steps) i = steps;
2826 "*** Dumping: %3d%% complete (%d of 40 MB) (device 64:0x2)\r",
2829 BSOD_TEXT (bst, LEFT, buf);
2830 BSOD_PAUSE (bst, 1500000);
2834 BSOD_TEXT (bst, LEFT, "\n*** System rebooting.\n");
2836 XClearWindow(dpy, window);
2841 /* IBM OS/390 aka MVS aka z/OS.
2842 Text from Dan Espen <dane@mk.telcordia.com>.
2843 Apparently this isn't actually a crash, just a random session...
2846 static struct bsod_state *
2847 os390 (Display *dpy, Window window)
2849 struct bsod_state *bst = make_bsod_state (dpy, window, "os390", "OS390");
2851 bst->scroll_p = True;
2852 bst->y = bst->xgwa.height - bst->bottom_margin - bst->font->ascent;
2854 BSOD_LINE_DELAY (bst, 100000);
2855 BSOD_TEXT (bst, LEFT,
2856 "\n*** System rebooting.\n"
2857 "* ISPF Subtask abend *\n"
2858 "SPF ENDED DUE TO ERROR+\n"
2861 "IEA995I SYMPTOM DUMP OUTPUT\n"
2862 " USER COMPLETION CODE=0222\n"
2863 " TIME=23.00.51 SEQ=03210 CPU=0000 ASID=00AE\n"
2864 " PSW AT TIME OF ERROR 078D1000 859DAF18 ILC 2 INTC 0D\n"
2865 " NO ACTIVE MODULE FOUND\n"
2867 " DATA AT PSW 059DAF12 - 00181610 0A0D9180 70644710\n"
2868 " AR/GR 0: 00000000/80000000 1: 00000000/800000DE\n"
2869 " 2: 00000000/196504DC 3: 00000000/00037A78\n"
2870 " 4: 00000000/00037B78 5: 00000000/0003351C\n"
2871 " 6: 00000000/0000F0AD 7: 00000000/00012000\n"
2872 " 8: 00000000/059DAF10 9: 00000000/0002D098\n"
2873 " A: 00000000/059D9F10 B: 00000000/059D8F10\n"
2874 " C: 00000000/859D7F10 D: 00000000/00032D60\n"
2875 " E: 00000000/00033005 F: 01000002/00000041\n"
2876 " END OF SYMPTOM DUMP\n"
2877 "ISPS014 - ** Logical screen request failed - abend 0000DE **\n"
2878 "ISPS015 - ** Contact your system programmer or dialog developer.**\n"
2879 "*** ISPF Main task abend ***\n"
2880 "IEA995I SYMPTOM DUMP OUTPUT\n"
2881 " USER COMPLETION CODE=0222\n"
2882 " TIME=23.00.52 SEQ=03211 CPU=0000 ASID=00AE\n"
2883 " PSW AT TIME OF ERROR 078D1000 8585713C ILC 2 INTC 0D\n"
2884 " ACTIVE LOAD MODULE ADDRESS=05855000 OFFSET=0000213C\n"
2886 " DATA AT PSW 05857136 - 00181610 0A0D9180 D3304770\n"
2887 " GR 0: 80000000 1: 800000DE\n"
2888 " 2: 00015260 3: 00000038\n"
2889 " 4: 00012508 5: 00000000\n"
2890 " 6: 000173AC 7: FFFFFFF8\n"
2891 " 8: 05858000 9: 00012CA0\n"
2892 " A: 05857000 B: 05856000\n"
2893 " C: 85855000 D: 00017020\n"
2894 " E: 85857104 F: 00000000\n"
2895 " END OF SYMPTOM DUMP\n"
2898 BSOD_CURSOR (bst, CURSOR_LINE, 240000, 999999);
2900 XClearWindow(dpy, window);
2905 /* Compaq Tru64 Unix panic, by jwz as described by
2906 Tobias Klausmann <klausman@schwarzvogel.de>
2908 static struct bsod_state *
2909 tru64 (Display *dpy, Window window)
2911 struct bsod_state *bst = make_bsod_state (dpy, window, "tru64", "Tru64");
2912 const char *sysname;
2915 bst->scroll_p = True;
2916 bst->y = bst->xgwa.height - bst->bottom_margin - bst->font->ascent;
2918 sysname = "127.0.0.1";
2922 if (uname (&uts) >= 0)
2923 sysname = uts.nodename;
2925 # endif /* !HAVE_UNAME */
2928 "Compaq Tru64 UNIX V5.1B (Rev. 2650) (%.100s) console\n"
2932 BSOD_TEXT (bst, LEFT, buf);
2933 BSOD_PAUSE (bst, 6000000);
2935 BSOD_TEXT (bst, LEFT,
2936 "panic (cpu 0): trap: illegal instruction\n"
2937 "kernel inst fault=gentrap, ps=0x5, pc=0xfffffc0000593878, inst=0xaa\n"
2938 "kernel inst fault=gentrap, ps=0x5, pc=0xfffffc0000593878, inst=0xaa\n"
2940 "DUMP: blocks available: 1571600\n"
2941 "DUMP: blocks wanted: 100802 (partial compressed dump) [OKAY]\n"
2942 "DUMP: Device Disk Blocks Available\n"
2943 "DUMP: ------ ---------------------\n"
2944 "DUMP: 0x1300023 1182795 - 1571597 (of 1571598) [primary swap]\n"
2945 "DUMP.prom: Open: dev 0x5100041, block 2102016: SCSI 0 11 0 2 200 0 0\n"
2946 "DUMP: Writing header... [1024 bytes at dev 0x1300023, block 1571598]\n"
2947 "DUMP: Writing data");
2951 int steps = 4 + (random() % 8);
2952 BSOD_CHAR_DELAY (bst, 1000000);
2953 for (i = 0; i < steps; i++)
2954 BSOD_TEXT (bst, LEFT, ".");
2955 BSOD_CHAR_DELAY (bst, 0);
2956 sprintf (buf, "[%dMB]\n", steps);
2957 BSOD_TEXT (bst, LEFT, buf);
2960 BSOD_TEXT (bst, LEFT,
2961 "DUMP: Writing header... [1024 bytes at dev 0x1300023, block 1571598]\n"
2962 "DUMP: crash dump complete.\n"
2963 "kernel inst fault=gentrap, ps=0x5, pc=0xfffffc0000593878, inst=0xaa\n"
2965 "DUMP: second crash dump skipped: 'dump_savecnt' enforced.\n");
2966 BSOD_PAUSE (bst, 4000000);
2968 BSOD_TEXT (bst, LEFT,
2973 "HALT instruction executed\n"
2974 "PC = fffffc00005863b0\n");
2975 BSOD_PAUSE (bst, 3000000);
2977 BSOD_TEXT (bst, LEFT,
2984 XClearWindow(dpy, window);
2991 static struct bsod_state *
2992 msdos (Display *dpy, Window window)
2994 struct bsod_state *bst = make_bsod_state (dpy, window, "msdos", "MSDOS");
2996 BSOD_CHAR_DELAY (bst, 10000);
2997 BSOD_TEXT (bst, LEFT, "C:\\WINDOWS>");
2998 BSOD_CURSOR (bst, CURSOR_LINE, 200000, 8);
3000 BSOD_CHAR_DELAY (bst, 200000);
3001 BSOD_TEXT (bst, LEFT, "dir a:");
3002 BSOD_PAUSE (bst, 1000000);
3004 BSOD_CHAR_DELAY (bst, 10000);
3005 BSOD_TEXT (bst, LEFT, "\nNot ready reading drive A\nAbort, Retry, Fail?");
3007 BSOD_CURSOR (bst, CURSOR_LINE, 200000, 10);
3008 BSOD_CHAR_DELAY (bst, 200000);
3009 BSOD_TEXT (bst, LEFT, "f");
3010 BSOD_PAUSE (bst, 1000000);
3012 BSOD_CHAR_DELAY (bst, 10000);
3013 BSOD_TEXT (bst, LEFT,
3014 "\n\n\nNot ready reading drive A\nAbort, Retry, Fail?");
3016 BSOD_CURSOR (bst, CURSOR_LINE, 200000, 10);
3017 BSOD_CHAR_DELAY (bst, 200000);
3018 BSOD_TEXT (bst, LEFT, "f");
3019 BSOD_PAUSE (bst, 1000000);
3021 BSOD_CHAR_DELAY (bst, 10000);
3022 BSOD_TEXT (bst, LEFT, "\nVolume in drive A has no label\n\n"
3023 "Not ready reading drive A\nAbort, Retry, Fail?");
3025 BSOD_CURSOR (bst, CURSOR_LINE, 200000, 12);
3026 BSOD_CHAR_DELAY (bst, 200000);
3027 BSOD_TEXT (bst, LEFT, "a");
3028 BSOD_PAUSE (bst, 1000000);
3030 BSOD_CHAR_DELAY (bst, 10000);
3031 BSOD_TEXT (bst, LEFT, "\n\nC:\\WINDOWS>");
3033 BSOD_CURSOR (bst, CURSOR_LINE, 200000, 999999);
3035 XClearWindow(dpy, window);
3042 * This is what happens if an Nvidia card goes into some crazy text mode.
3043 * Most often seen on the second screen of a dual-head system when the
3044 * proper driver isn't loaded.
3046 typedef struct { int fg; int bg; int bit; Bool blink; } nvcell;
3049 nvspatter (nvcell *grid, int rows, int cols, int ncolors, int nbits,
3052 int max = rows * cols;
3053 int from = fill_p ? 0 : random() % (max - 1);
3054 int len = fill_p ? max : random() % (cols * 4);
3055 int to = from + len;
3057 Bool noisy = ((random() % 4) == 0);
3058 Bool diag = (noisy || fill_p) ? 0 : ((random() % 4) == 0);
3060 int fg = random() % ncolors;
3061 int bg = random() % ncolors;
3062 int blink = ((random() % 4) == 0);
3063 int bit = (random() % nbits);
3065 if (to > max) to = max;
3069 int src = random() % (rows * cols);
3070 int len2 = (cols / 2) - (random() % 5);
3072 for (i = from; i < to; i++, j++)
3074 if (j > src + len2 || j >= max)
3076 if (i >= max) abort();
3077 if (j >= max) abort();
3082 for (i = from; i < to; i++)
3084 nvcell *cell = &grid[i];
3088 cell->blink = blink;
3092 fg = random() % ncolors;
3093 bg = random() % ncolors;
3094 blink = ((random() % 8) == 0);
3100 struct bsod_state *bst;
3107 unsigned long colors[256];
3113 nvidia_free (struct bsod_state *bst)
3115 nvstate *nvs = (nvstate *) bst->closure;
3117 XFreeColors (bst->dpy, bst->xgwa.colormap, nvs->colors, nvs->ncolors, 0);
3118 for (i = 0; i < countof(nvs->bits); i++)
3119 XFreePixmap (bst->dpy, nvs->bits[i]);
3120 XFreeGC (bst->dpy, nvs->gc1);
3126 nvidia_draw (struct bsod_state *bst)
3128 nvstate *nvs = (nvstate *) bst->closure;
3131 for (y = 0; y < nvs->rows; y++)
3132 for (x = 0; x < nvs->cols; x++)
3134 nvcell *cell = &nvs->grid[y * nvs->cols + x];
3135 unsigned long fg = nvs->colors[cell->fg];
3136 unsigned long bg = nvs->colors[cell->bg];
3137 Bool flip = cell->blink && (nvs->tick & 1);
3138 XSetForeground (bst->dpy, bst->gc, flip ? fg : bg);
3139 XSetBackground (bst->dpy, bst->gc, flip ? bg : fg);
3140 XCopyPlane (bst->dpy, nvs->bits[cell->bit], bst->window, bst->gc,
3141 0, 0, nvs->cellw, nvs->cellh,
3142 x * nvs->cellw, y * nvs->cellh, 1L);
3146 if ((random() % 5) == 0) /* change the display */
3147 nvspatter (nvs->grid, nvs->rows, nvs->cols, nvs->ncolors,
3148 countof(nvs->bits), False);
3154 static struct bsod_state *
3155 nvidia (Display *dpy, Window window)
3157 struct bsod_state *bst = make_bsod_state (dpy, window, "nvidia", "nVidia");
3158 nvstate *nvs = (nvstate *) calloc (1, sizeof (*nvs));
3165 bst->draw_cb = nvidia_draw;
3166 bst->free_cb = nvidia_free;
3170 nvs->cellw = bst->xgwa.width / nvs->cols;
3171 nvs->cellh = bst->xgwa.height / nvs->rows;
3172 if (nvs->cellw < 8 || nvs->cellh < 18)
3173 nvs->cellw = 8, nvs->cellh = 18;
3174 nvs->cols = (bst->xgwa.width / nvs->cellw) + 1;
3175 nvs->rows = (bst->xgwa.height / nvs->cellh) + 1;
3177 nvs->grid = (nvcell *) calloc (sizeof(*nvs->grid), nvs->rows * nvs->cols);
3182 for (i = 0; i < nvs->ncolors; i++)
3185 c.red = random() & 0xFFFF;
3186 c.green = random() & 0xFFFF;
3187 c.blue = random() & 0xFFFF;
3188 c.flags = DoRed|DoGreen|DoBlue;
3189 XAllocColor (dpy, bst->xgwa.colormap, &c);
3190 nvs->colors[i] = c.pixel;
3193 /* Construct corrupted character bitmaps
3195 for (i = 0; i < countof(nvs->bits); i++)
3199 nvs->bits[i] = XCreatePixmap (dpy, window, nvs->cellw, nvs->cellh, 1);
3200 if (!nvs->gc1) nvs->gc1 = XCreateGC (dpy, nvs->bits[i], 0, &gcv);
3202 XSetForeground (dpy, nvs->gc1, 0);
3203 XFillRectangle (dpy, nvs->bits[i], nvs->gc1, 0, 0,
3204 nvs->cellw, nvs->cellh);
3205 XSetForeground (dpy, nvs->gc1, 1);
3207 if ((random() % 40) != 0)
3208 for (j = 0; j < ((nvs->cellw * nvs->cellh) / 16); j++)
3209 XFillRectangle (dpy, nvs->bits[i], nvs->gc1,
3210 (random() % (nvs->cellw-2)) & ~1,
3211 (random() % (nvs->cellh-2)) & ~1,
3215 /* Randomize the grid
3217 nvspatter (nvs->grid, nvs->rows, nvs->cols, nvs->ncolors,
3218 countof(nvs->bits), True);
3219 for (i = 0; i < 20; i++)
3220 nvspatter (nvs->grid, nvs->rows, nvs->cols, nvs->ncolors,
3221 countof(nvs->bits), False);
3228 * Simulate various Apple ][ crashes. The memory map encouraged many programs
3229 * to use the primary hi-res video page for various storage, and the secondary
3230 * hi-res page for active display. When it crashed into Applesoft or the
3231 * monitor, it would revert to the primary page and you'd see memory garbage on
3232 * the screen. Also, it was common for copy-protected games to use the primary
3233 * text page for important code, because that made it really hard to
3234 * reverse-engineer them. The result often looked like what this generates.
3236 * The Apple ][ logic and video hardware is in apple2.c. The TV is emulated by
3237 * analogtv.c for maximum realism
3239 * Trevor Blackwell <tlb@tlb.org>
3242 static const char * const apple2_basic_errors[]={
3246 "RETURN WITHOUT GOSUB",
3250 "BAD SUBSCRIPT ERROR",
3253 "FORMULA TOO COMPLEX",
3258 "DEFAULT ARGUMENTS ARE NOT ALLOWED IN DECLARATION OF FRIEND "
3259 "TEMPLATE SPECIALIZATION"
3263 static const char * const apple2_dos_errors[]={
3267 "NO BUFFERS AVAILABLE",
3268 "PROGRAM TOO LARGE",
3271 static void a2controller_crash(apple2_sim_t *sim, int *stepno,
3272 double *next_actiontime)
3274 apple2_state_t *st=sim->st;
3283 if (!sim->controller_data)
3284 sim->controller_data = calloc(sizeof(struct mydata),1);
3285 mine=(struct mydata *) sim->controller_data;
3290 a2_init_memory_active(sim);
3291 sim->dec->powerup = 1000.0;
3293 if (random()%3==0) {
3295 *next_actiontime+=0.4;
3298 else if (random()%4==0) {
3299 st->gr_mode=A2_GR_LORES;
3300 if (random()%3==0) st->gr_mode |= A2_GR_FULL;
3301 *next_actiontime+=0.4;
3304 else if (random()%2==0) {
3305 st->gr_mode=A2_GR_HIRES;
3309 st->gr_mode=A2_GR_HIRES;
3310 *next_actiontime+=0.4;
3316 /* An illegal instruction or a reset caused it to drop into the
3317 assembly language monitor, where you could disassemble code & view
3319 if (random()%3==0) {
3322 int addr=0xd000+random()%0x3000;
3324 "%02X",random()%0xff);
3327 sprintf(sim->printing_buf,
3330 " A=%02X X=%02X Y=%02X S=%02X F=%02X\n"
3333 random()%0xff, random()%0xff,
3334 random()%0xff, random()%0xff,
3336 sim->printing=sim->printing_buf;
3344 *next_actiontime += 2.0 + (random()%1000)*0.0002;
3347 /* Lots of programs had at least their main functionality in
3348 Applesoft Basic, which had a lot of limits (memory, string
3349 length, etc) and would sometimes crash unexpectedly. */
3350 sprintf(sim->printing_buf,
3356 apple2_basic_errors[random() %
3357 (sizeof(apple2_basic_errors)
3359 (1000*(random()%(random()%59+1)) +
3360 100*(random()%(random()%9+1)) +
3361 5*(random()%(random()%199+1)) +
3362 1*(random()%(random()%(random()%2+1)+1))));
3363 sim->printing=sim->printing_buf;
3367 *next_actiontime += 2.0 + (random()%1000)*0.0002;
3372 if (random()%3==0) {
3373 /* This was how you reset the Basic interpreter. The sort of
3374 incantation you'd have on a little piece of paper taped to the
3375 side of your machine */
3376 sim->typing="CALL -1370";
3379 else if (random()%2==0) {
3380 sim->typing="CATALOG\n";
3384 *next_actiontime+=1.0;
3391 *next_actiontime += 0.5;
3398 for (s="APPLE ]["; *s; s++) a2_printc(st,*s);
3401 *next_actiontime+=1.0;
3406 if (random()%50==0) {
3407 sprintf(sim->printing_buf,
3408 "\nDISK VOLUME 254\n\n"
3412 sim->printing=sim->printing_buf;
3415 sprintf(sim->printing_buf,"\n?%s\n]",
3416 apple2_dos_errors[random()%
3417 (sizeof(apple2_dos_errors) /
3419 sim->printing=sim->printing_buf;
3422 *next_actiontime+=1.0;
3426 if (random()%2==0) {
3427 /* This was how you went back to text mode in the monitor */
3428 sim->typing="FB4BG";
3431 *next_actiontime+=1.0;
3442 *next_actiontime+=2.0;
3446 /* This reset things into Basic */
3447 if (random()%2==0) {
3448 sim->typing="FAA6G";
3453 *next_actiontime+=sim->delay;
3458 for (i=0; i<1500; i++) {
3459 a2_poke(st, mine->fillptr, mine->fillbyte);
3461 mine->fillbyte = (mine->fillbyte+1)&0xff;
3463 *next_actiontime += 0.08;
3464 /* When you hit c000, it changed video settings */
3465 if (mine->fillptr>=0xc000) {
3469 /* And it seemed to reset around here, I dunno why */
3470 if (mine->fillptr>=0xcf00) *stepno=130;
3476 case A2CONTROLLER_FREE:
3483 a2_draw (struct bsod_state *bst)
3485 apple2_sim_t *sim = (apple2_sim_t *) bst->closure;
3487 sim = apple2_start (bst->dpy, bst->window, 9999999, a2controller_crash);
3491 if (! apple2_one_frame (sim)) {
3499 a2_free (struct bsod_state *bst)
3501 apple2_sim_t *sim = (apple2_sim_t *) bst->closure;
3503 sim->stepno = A2CONTROLLER_DONE;
3504 a2_draw (bst); /* finish up */
3505 if (bst->closure) abort(); /* should have been freed by now */
3510 static struct bsod_state *
3511 apple2crash (Display *dpy, Window window)
3513 struct bsod_state *bst = make_bsod_state (dpy, window, "apple2", "Apple2");
3514 bst->draw_cb = a2_draw;
3515 bst->free_cb = a2_free;
3520 /*****************************************************************************
3521 *****************************************************************************/
3524 static const struct {
3526 struct bsod_state * (*fn) (Display *, Window);
3528 { "Windows", windows_31 },
3529 { "NT", windows_nt },
3530 { "Win2K", windows_other },
3533 { "MacsBug", macsbug },
3538 { "HPPALinux", hppa_linux },
3539 { "SparcLinux", sparc_linux },
3543 { "BlitDamage", blitdamage },
3545 { "Solaris", sparc_solaris },
3546 { "Linux", linux_fsck },
3553 { "Nvidia", nvidia },
3554 { "Apple2", apple2crash },
3558 struct driver_state {
3563 Bool debug_p, cycle_p;
3564 struct bsod_state *bst;
3569 hack_title (struct driver_state *dst)
3573 XFetchName (dst->bst->dpy, dst->bst->window, &oname);
3574 if (oname && !strncmp (oname, "BSOD: ", 6)) {
3575 char *tail = oname + 4;
3576 char *s = strchr (tail+1, ':');
3579 nname = malloc (strlen (tail) + strlen (dst->name) + 20);
3580 sprintf (nname, "BSOD: %s%s", dst->name, tail);
3581 XStoreName (dst->bst->dpy, dst->bst->window, nname);
3584 # endif /* !HAVE_COCOA */
3588 bsod_init (Display *dpy, Window window)
3590 struct driver_state *dst = (struct driver_state *) calloc (1, sizeof(*dst));
3593 dst->delay = get_integer_resource (dpy, "delay", "Integer");
3594 if (dst->delay < 3) dst->delay = 3;
3596 dst->debug_p = get_boolean_resource (dpy, "debug", "Boolean");
3599 s = get_string_resource(dpy, "doOnly", "DoOnly");
3600 if (s && !strcasecmp (s, "cycle"))
3603 dst->cycle_p = True;
3607 int count = countof(all_modes);
3608 for (dst->only = 0; dst->only < count; dst->only++)
3609 if (!strcasecmp (s, all_modes[dst->only].name))
3611 if (dst->only >= count)
3613 fprintf (stderr, "%s: unknown -only mode: \"%s\"\n", progname, s);
3625 static unsigned long
3626 bsod_draw (Display *dpy, Window window, void *closure)
3628 struct driver_state *dst = (struct driver_state *) closure;
3633 now = time ((time_t *) 0);
3634 time_left = dst->start + dst->delay - now;
3636 if (dst->bst && dst->bst->img_loader) /* still loading */
3638 dst->bst->img_loader =
3639 load_image_async_simple (dst->bst->img_loader, 0, 0, 0, 0, 0);
3643 if (! dst->bst && time_left > 0) /* run completed; wait out the delay */
3646 fprintf (stderr, "%s: %s: %d left\n", progname, dst->name, time_left);
3650 else if (dst->bst) /* sub-mode currently running */
3652 int this_delay = -1;
3655 this_delay = bsod_pop (dst->bst);
3657 /* XSync (dpy, False); slows down char drawing too much on HAVE_COCOA */
3659 if (this_delay == 0)
3660 goto AGAIN; /* no delay, not expired: stay here */
3661 else if (this_delay >= 0)
3662 return this_delay; /* return; time to sleep */
3664 { /* sub-mode run completed or expired */
3666 fprintf (stderr, "%s: %s: done\n", progname, dst->name);
3667 free_bsod_state (dst->bst);
3672 else /* launch a new sub-mode */
3675 dst->which = (dst->which + 1) % countof(all_modes);
3676 else if (dst->only >= 0)
3677 dst->which = dst->only;
3680 int count = countof(all_modes);
3683 for (i = 0; i < 200; i++)
3685 char name[100], class[100];
3686 int new_mode = (random() & 0xFF) % count;
3688 if (i < 100 && new_mode == dst->which)
3691 sprintf (name, "do%s", all_modes[new_mode].name);
3692 sprintf (class, "Do%s", all_modes[new_mode].name);
3694 if (get_boolean_resource (dpy, name, class))
3696 dst->which = new_mode;
3703 fprintf (stderr, "%s: no display modes enabled?\n", progname);
3705 dst->which = dst->only = 0;
3710 fprintf (stderr, "%s: %s: launch\n", progname,
3711 all_modes[dst->which].name);
3713 /* Run the mode setup routine...
3715 if (dst->bst) abort();
3716 dst->name = all_modes[dst->which].name;
3717 dst->bst = all_modes[dst->which].fn (dpy, window);
3718 dst->start = (dst->bst ? time ((time_t *) 0) : 0);
3720 /* Reset the structure run state to the beginning,
3721 and do some sanitization of the cursor position
3722 before the first run.
3727 fprintf (stderr, "%s: %s: queue size: %d (%d)\n", progname,
3728 dst->name, dst->bst->pos, dst->bst->queue_size);
3732 dst->bst->x = dst->bst->current_left = dst->bst->left_margin;
3734 if (dst->bst->y < dst->bst->top_margin + dst->bst->font->ascent)
3735 dst->bst->y = dst->bst->top_margin + dst->bst->font->ascent;
3744 bsod_reshape (Display *dpy, Window window, void *closure,
3745 unsigned int w, unsigned int h)
3747 struct driver_state *dst = (struct driver_state *) closure;
3750 w == dst->bst->xgwa.width &&
3751 h == dst->bst->xgwa.height)
3755 fprintf (stderr, "%s: %s: reshape reset\n", progname, dst->name);
3757 /* just pick a new mode and restart when the window is resized. */
3759 free_bsod_state (dst->bst);
3763 XClearWindow (dpy, window);
3768 bsod_event (Display *dpy, Window window, void *closure, XEvent *event)
3770 struct driver_state *dst = (struct driver_state *) closure;
3771 Bool reset_p = False;
3773 /* pick a new mode and restart when mouse clicked, or certain keys typed. */
3775 if (event->type == ButtonPress)
3777 else if (event->type == KeyPress)
3781 XLookupString (&event->xkey, &c, 1, &keysym, 0);
3782 if (c == ' ' || c == '\t' || c == '\r' || c == '\n')
3789 fprintf (stderr, "%s: %s: manual reset\n", progname, dst->name);
3791 free_bsod_state (dst->bst);
3795 XClearWindow (dpy, window);
3804 bsod_free (Display *dpy, Window window, void *closure)
3806 struct driver_state *dst = (struct driver_state *) closure;
3808 free_bsod_state (dst->bst);
3813 static const char *bsod_defaults [] = {
3827 "*doAtari: False", /* boring */
3828 "*doBSD: False", /* boring */
3830 "*doSparcLinux: False", /* boring */
3831 "*doHPPALinux: True",
3832 "*doBlitDamage: True",
3845 "*font2: -*-courier-bold-r-*-*-*-120-*-*-m-*-*-*",
3846 "*bigFont: -*-courier-bold-r-*-*-*-180-*-*-m-*-*-*",
3847 "*bigFont2: -*-courier-bold-r-*-*-*-180-*-*-m-*-*-*",
3849 ".foreground: White",
3850 ".background: Black",
3852 ".windows.foreground: White",
3853 ".windows.background: #0000AA", /* EGA color 0x01. */
3855 ".windowslh.foreground: White",
3856 ".windowslh.background: #AA0000", /* EGA color 0x04. */
3857 ".windowslh.background2: #AAAAAA", /* EGA color 0x07. */
3859 ".amiga.foreground: #FF0000",
3860 ".amiga.background: Black",
3861 ".amiga.background2: White",
3863 ".mac.foreground: #BBFFFF",
3864 ".mac.background: Black",
3866 ".atari.foreground: Black",
3867 ".atari.background: White",
3869 ".macsbug.font: -*-courier-medium-r-*-*-*-80-*-*-m-*-*-*",
3870 ".macsbug.bigFont: -*-courier-bold-r-*-*-*-140-*-*-m-*-*-*",
3871 ".macsbug.foreground: Black",
3872 ".macsbug.background: White",
3873 ".macsbug.borderColor: #AAAAAA",
3875 ".mac1.foreground: Black",
3876 ".mac1.background: White",
3878 ".macx.foreground: White",
3879 ".macx.textForeground: White",
3880 ".macx.textBackground: Black",
3881 ".macx.background: #888888",
3883 ".sco.font: -*-courier-bold-r-*-*-*-140-*-*-m-*-*-*",
3884 ".sco.foreground: White",
3885 ".sco.background: Black",
3887 ".hvx.font: -*-courier-bold-r-*-*-*-140-*-*-m-*-*-*",
3888 ".hvx.foreground: White",
3889 ".hvx.background: Black",
3891 ".linux.foreground: White",
3892 ".linux.background: Black",
3894 ".hppalinux.bigFont: -*-courier-bold-r-*-*-*-140-*-*-m-*-*-*",
3895 ".hppalinux.foreground: White",
3896 ".hppalinux.background: Black",
3898 ".sparclinux.bigFont: -*-courier-bold-r-*-*-*-140-*-*-m-*-*-*",
3899 ".sparclinux.foreground: White",
3900 ".sparclinux.background: Black",
3903 ".bsd.bigFont: -sun-console-medium-r-*-*-22-*-*-*-m-*-*-*",
3904 ".bsd.bigFont2: -*-courier-bold-r-*-*-*-140-*-*-m-*-*-*",
3905 ".bsd.foreground: #c0c0c0",
3906 ".bsd.background: Black",
3908 ".solaris.font: -sun-gallant-*-*-*-*-19-*-*-*-*-120-*-*",
3909 ".solaris.foreground: Black",
3910 ".solaris.background: White",
3912 ".hpux.bigFont: -*-courier-bold-r-*-*-*-140-*-*-m-*-*-*",
3913 ".hpux.foreground: White",
3914 ".hpux.background: Black",
3916 ".os390.bigFont: -*-courier-bold-r-*-*-*-140-*-*-m-*-*-*",
3917 ".os390.background: Black",
3918 ".os390.foreground: Red",
3920 ".tru64.bigFont: -*-courier-bold-r-*-*-*-140-*-*-m-*-*-*",
3921 ".tru64.foreground: White",
3922 ".tru64.background: #0000AA", /* EGA color 0x01. */
3924 ".vms.bigFont: -*-courier-bold-r-*-*-*-140-*-*-m-*-*-*",
3925 ".vms.foreground: White",
3926 ".vms.background: Black",
3928 ".msdos.bigFont: -*-courier-bold-r-*-*-*-140-*-*-m-*-*-*",
3929 ".msdos.foreground: White",
3930 ".msdos.background: Black",
3932 ".os2.foreground: White",
3933 ".os2.background: Black",
3935 "*dontClearRoot: True",
3937 "*apple2TVColor: 50",
3939 "*apple2TVBrightness: 10",
3940 "*apple2TVContrast: 90",
3941 "*apple2SimulateUser: True",
3945 #ifdef HAVE_XSHM_EXTENSION
3951 static const XrmOptionDescRec bsod_options [] = {
3952 { "-delay", ".delay", XrmoptionSepArg, 0 },
3953 { "-only", ".doOnly", XrmoptionSepArg, 0 },
3954 { "-debug", ".debug", XrmoptionNoArg, "True" },
3955 { "-windows", ".doWindows", XrmoptionNoArg, "True" },
3956 { "-no-windows", ".doWindows", XrmoptionNoArg, "False" },
3957 { "-nt", ".doNT", XrmoptionNoArg, "True" },
3958 { "-no-nt", ".doNT", XrmoptionNoArg, "False" },
3959 { "-2k", ".doWin2K", XrmoptionNoArg, "True" },
3960 { "-no-2k", ".doWin2K", XrmoptionNoArg, "False" },
3961 { "-amiga", ".doAmiga", XrmoptionNoArg, "True" },
3962 { "-no-amiga", ".doAmiga", XrmoptionNoArg, "False" },
3963 { "-mac", ".doMac", XrmoptionNoArg, "True" },
3964 { "-no-mac", ".doMac", XrmoptionNoArg, "False" },
3965 { "-mac1", ".doMac1", XrmoptionNoArg, "True" },
3966 { "-no-mac1", ".doMac1", XrmoptionNoArg, "False" },
3967 { "-macx", ".doMacX", XrmoptionNoArg, "True" },
3968 { "-no-macx", ".doMacX", XrmoptionNoArg, "False" },
3969 { "-atari", ".doAtari", XrmoptionNoArg, "True" },
3970 { "-no-atari", ".doAtari", XrmoptionNoArg, "False" },
3971 { "-macsbug", ".doMacsBug", XrmoptionNoArg, "True" },
3972 { "-no-macsbug", ".doMacsBug", XrmoptionNoArg, "False" },
3973 { "-apple2", ".doApple2", XrmoptionNoArg, "True" },
3974 { "-no-apple2", ".doApple2", XrmoptionNoArg, "False" },
3975 { "-sco", ".doSCO", XrmoptionNoArg, "True" },
3976 { "-no-sco", ".doSCO", XrmoptionNoArg, "False" },
3977 { "-hvx", ".doHVX", XrmoptionNoArg, "True" },
3978 { "-no-hvx", ".doHVX", XrmoptionNoArg, "False" },
3979 { "-bsd", ".doBSD", XrmoptionNoArg, "True" },
3980 { "-no-bsd", ".doBSD", XrmoptionNoArg, "False" },
3981 { "-linux", ".doLinux", XrmoptionNoArg, "True" },
3982 { "-no-linux", ".doLinux", XrmoptionNoArg, "False" },
3983 { "-hppalinux", ".doHPPALinux", XrmoptionNoArg, "True" },
3984 { "-no-hppalinux", ".doHPPALinux", XrmoptionNoArg, "False" },
3985 { "-sparclinux", ".doSparcLinux", XrmoptionNoArg, "True" },
3986 { "-no-sparclinux", ".doSparcLinux", XrmoptionNoArg, "False" },
3987 { "-blitdamage", ".doBlitDamage", XrmoptionNoArg, "True" },
3988 { "-no-blitdamage", ".doBlitDamage", XrmoptionNoArg, "False" },
3989 { "-nvidia", ".doNvidia", XrmoptionNoArg, "True" },
3990 { "-no-nvidia", ".doNvidia", XrmoptionNoArg, "False" },
3991 { "-solaris", ".doSolaris", XrmoptionNoArg, "True" },
3992 { "-no-solaris", ".doSolaris", XrmoptionNoArg, "False" },
3993 { "-hpux", ".doHPUX", XrmoptionNoArg, "True" },
3994 { "-no-hpux", ".doHPUX", XrmoptionNoArg, "False" },
3995 { "-os390", ".doOS390", XrmoptionNoArg, "True" },
3996 { "-no-os390", ".doOS390", XrmoptionNoArg, "False" },
3997 { "-tru64", ".doHPUX", XrmoptionNoArg, "True" },
3998 { "-no-tru64", ".doTru64", XrmoptionNoArg, "False" },
3999 { "-vms", ".doVMS", XrmoptionNoArg, "True" },
4000 { "-no-vms", ".doVMS", XrmoptionNoArg, "False" },
4001 { "-msdos", ".doMSDOS", XrmoptionNoArg, "True" },
4002 { "-no-msdos", ".doMSDOS", XrmoptionNoArg, "False" },
4003 { "-os2", ".doOS2", XrmoptionNoArg, "True" },
4004 { "-no-os2", ".doOS2", XrmoptionNoArg, "False" },
4010 XSCREENSAVER_MODULE ("BSOD", bsod)