1 /* xscreensaver, Copyright (c) 1998-2017 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"
45 #ifdef HAVE_XSHM_EXTENSION
50 # include <sys/utsname.h>
51 #endif /* HAVE_UNAME */
53 #if defined(HAVE_GDK_PIXBUF) || defined(HAVE_XPM) || defined(HAVE_JWXYZ)
58 # include "images/amiga.xpm"
59 # include "images/hmac.xpm"
60 # include "images/osx_10_2.xpm"
61 # include "images/osx_10_3.xpm"
62 # include "images/android.xpm"
63 # include "images/ransomware.xpm"
65 #include "images/atari.xbm"
66 #include "images/mac.xbm"
67 #include "images/macbomb.xbm"
68 #include "images/apple.xbm"
69 #include "images/atm.xbm"
72 #define countof(x) (sizeof((x))/sizeof((*x)))
76 # define MIN(A,B) ((A)<(B)?(A):(B))
77 # define MAX(A,B) ((A)>(B)?(A):(B))
82 LEFT_FULL, CENTER_FULL, RIGHT_FULL,
83 COLOR, INVERT, MOVETO, MARGINS,
84 CURSOR_BLOCK, CURSOR_LINE, RECT, LINE, COPY, PIXMAP, IMG, FONT,
85 PAUSE, CHAR_DELAY, LINE_DELAY,
86 LOOP, RESET, VERT_MARGINS, CROP
91 void *arg1, *arg2, *arg3, *arg4, *arg5, *arg6;
97 XWindowAttributes xgwa;
98 XFontStruct *font, *fontA, *fontB, *fontC;
101 int left_margin, right_margin; /* for text wrapping */
102 int top_margin, bottom_margin; /* for text scrolling and cropping */
106 Bool crop_p; /* If True, chops off extra text vertically */
108 Pixmap pixmap; /* Source image used by BSOD_PIXMAP */
110 int x, y; /* current text-drawing position */
111 int current_left; /* don't use this */
113 int pos; /* position in queue */
115 struct bsod_event *queue;
117 unsigned long char_delay; /* delay between printing characters */
118 unsigned long line_delay; /* delay between printing lines */
120 Bool macx_eol_kludge;
123 int (*draw_cb) (struct bsod_state *);
124 void (*free_cb) (struct bsod_state *);
126 async_load_state *img_loader;
130 # if !defined(__GNUC__) && !defined(__extension__)
131 /* don't warn about "string length is greater than the length ISO C89
132 compilers are required to support" in these string constants... */
133 # define __extension__ /**/
137 /* Draw text at the current position; align is LEFT, CENTER, RIGHT, or *_FULL
138 (meaning to clear the whole line margin to margin).
140 #define BSOD_TEXT(bst,align,string) do { \
141 ensure_queue (bst); \
142 (bst)->queue[(bst)->pos].type = (align); \
143 (bst)->queue[(bst)->pos].arg1 = (void *) strdup (__extension__ (string)); \
144 (bst)->queue[(bst)->pos].arg2 = (bst)->queue[(bst)->pos].arg1; \
145 (bst)->queue[(bst)->pos].arg3 = (void *) 0; \
149 /* Flip the foreground and background colors
151 #define BSOD_INVERT(bst) do { \
152 ensure_queue (bst); \
153 (bst)->queue[(bst)->pos].type = INVERT; \
157 /* Set the foreground and background colors to the given pixels
159 #define BSOD_COLOR(bst,fg,bg) do { \
160 ensure_queue (bst); \
161 (bst)->queue[(bst)->pos].type = COLOR; \
162 (bst)->queue[(bst)->pos].arg1 = (void *) fg; \
163 (bst)->queue[(bst)->pos].arg2 = (void *) bg; \
167 /* Set the position of the next text.
168 Note that this is the baseline: lower left corner of next char printed.
170 #define BSOD_MOVETO(bst,x,y) do { \
171 ensure_queue (bst); \
172 (bst)->queue[(bst)->pos].type = MOVETO; \
173 (bst)->queue[(bst)->pos].arg1 = (void *) ((long) (x)); \
174 (bst)->queue[(bst)->pos].arg2 = (void *) ((long) (y)); \
178 /* Delay for at least the given number of microseconds.
180 #define BSOD_PAUSE(bst,usec) do { \
181 ensure_queue (bst); \
182 (bst)->queue[(bst)->pos].type = PAUSE; \
183 (bst)->queue[(bst)->pos].arg1 = (void *) ((long) (usec)); \
187 /* Set the delay after each character is printed.
189 #define BSOD_CHAR_DELAY(bst,usec) do { \
190 ensure_queue (bst); \
191 (bst)->queue[(bst)->pos].type = CHAR_DELAY; \
192 (bst)->queue[(bst)->pos].arg1 = (void *) ((long) (usec)); \
196 /* Set the delay after each newline.
198 #define BSOD_LINE_DELAY(bst,usec) do { \
199 ensure_queue (bst); \
200 (bst)->queue[(bst)->pos].type = LINE_DELAY; \
201 (bst)->queue[(bst)->pos].arg1 = (void *) (usec); \
205 /* Set the prevailing left/right margins (used when strings have
206 embedded newlines, and when centering or right-justifying text.)
208 #define BSOD_MARGINS(bst,left,right) do { \
209 ensure_queue (bst); \
210 (bst)->queue[(bst)->pos].type = MARGINS; \
211 (bst)->queue[(bst)->pos].arg1 = (void *) ((long) (left)); \
212 (bst)->queue[(bst)->pos].arg2 = (void *) ((long) (right)); \
216 /* Set the prevailing top/bottom margins (used when scrolling and cropping text)
218 #define BSOD_VERT_MARGINS(bst,top,bottom) do { \
219 ensure_queue (bst); \
220 (bst)->queue[(bst)->pos].type = VERT_MARGINS; \
221 (bst)->queue[(bst)->pos].arg1 = (void *) ((long) (top)); \
222 (bst)->queue[(bst)->pos].arg2 = (void *) ((long) (bottom)); \
226 /* Draw a blinking cursor; type is CURSOR_BLOCK or CURSOR_LINE.
227 usec is how long 1/2 of a cycle is. count is how many times to blink.
228 (You can pass a gigantic number if this is the last thing in your mode.)
230 #define BSOD_CURSOR(bst,ctype,usec,count) do { \
231 ensure_queue (bst); \
232 (bst)->queue[(bst)->pos].type = (ctype); \
233 (bst)->queue[(bst)->pos].arg1 = (void *) (usec); \
234 (bst)->queue[(bst)->pos].arg2 = (void *) (count); \
238 /* Draw or fill a rectangle. You can set line-width in the GC.
240 #define BSOD_RECT(bst,fill,x,y,w,h) do { \
241 ensure_queue (bst); \
242 (bst)->queue[(bst)->pos].type = RECT; \
243 (bst)->queue[(bst)->pos].arg1 = (void *) ((long) (fill)); \
244 (bst)->queue[(bst)->pos].arg2 = (void *) ((long) (x)); \
245 (bst)->queue[(bst)->pos].arg3 = (void *) ((long) (y)); \
246 (bst)->queue[(bst)->pos].arg4 = (void *) ((long) (w)); \
247 (bst)->queue[(bst)->pos].arg5 = (void *) ((long) (h)); \
253 #define BSOD_LINE(bst,x,y,x2,y2,thick) do { \
254 ensure_queue (bst); \
255 (bst)->queue[(bst)->pos].type = LINE; \
256 (bst)->queue[(bst)->pos].arg1 = (void *) ((long) (x)); \
257 (bst)->queue[(bst)->pos].arg2 = (void *) ((long) (y)); \
258 (bst)->queue[(bst)->pos].arg3 = (void *) ((long) (x2)); \
259 (bst)->queue[(bst)->pos].arg4 = (void *) ((long) (y2)); \
260 (bst)->queue[(bst)->pos].arg5 = (void *) ((long) (thick)); \
264 /* Copy a rect from the window, to the window.
266 #define BSOD_COPY(bst,srcx,srcy,w,h,tox,toy) do { \
267 ensure_queue (bst); \
268 (bst)->queue[(bst)->pos].type = COPY; \
269 (bst)->queue[(bst)->pos].arg1 = (void *) ((long) (srcx)); \
270 (bst)->queue[(bst)->pos].arg2 = (void *) ((long) (srcy)); \
271 (bst)->queue[(bst)->pos].arg3 = (void *) ((long) (w)); \
272 (bst)->queue[(bst)->pos].arg4 = (void *) ((long) (h)); \
273 (bst)->queue[(bst)->pos].arg5 = (void *) ((long) (tox)); \
274 (bst)->queue[(bst)->pos].arg6 = (void *) ((long) (toy)); \
278 /* Copy a rect from bst->pixmap to the window.
280 #define BSOD_PIXMAP(bst,srcx,srcy,w,h,tox,toy) do { \
281 BSOD_COPY(bst,srcx,srcy,w,h,tox,toy); \
282 (bst)->queue[(bst)->pos-1].type = PIXMAP; \
285 /* Load a random image (or the desktop) onto the window.
287 #define BSOD_IMG(bst) do { \
288 ensure_queue (bst); \
289 (bst)->queue[(bst)->pos].type = IMG; \
293 /* Switch between fonts A, B and C.
295 #define BSOD_FONT(bst,n) do { \
296 ensure_queue (bst); \
297 (bst)->queue[(bst)->pos].type = FONT; \
298 (bst)->queue[(bst)->pos].arg1 = (void *) ((long) (n)); \
302 /* Jump around in the state table. You can use this as the last thing
303 in your state table to repeat the last N elements forever.
305 #define BSOD_LOOP(bst,off) do { \
306 ensure_queue (bst); \
307 (bst)->queue[(bst)->pos].type = LOOP; \
308 (bst)->queue[(bst)->pos].arg1 = (void *) (off); \
312 /* Restart the whole thing from the beginning.
314 #define BSOD_RESET(bst) do { \
315 ensure_queue (bst); \
316 (bst)->queue[(bst)->pos].type = RESET; \
320 /* Sets the crop state, if True, will not write text below the bottom_margin
322 #define BSOD_CROP(bst, state) do { \
323 ensure_queue (bst); \
324 (bst)->queue[(bst)->pos].type = CROP; \
325 (bst)->queue[(bst)->pos].arg1 = (void *) ((long) (state)); \
332 ensure_queue (struct bsod_state *bst)
335 if (bst->pos + 1 < bst->queue_size)
338 n = bst->queue_size + 10;
342 bst->queue = (struct bsod_event *)
343 realloc (bst->queue, n * sizeof(*bst->queue));
344 if (!bst->queue) abort();
345 memset (bst->queue + bst->queue_size, 0,
346 (n - bst->queue_size) * sizeof(*bst->queue));
352 position_for_text (struct bsod_state *bst, const char *line)
356 const char *start = line;
358 if (bst->queue[bst->pos].type != LEFT &&
359 bst->queue[bst->pos].type != LEFT_FULL)
362 int dir, ascent, descent;
364 const char *end = start;
365 while (*end && *end != '\r' && *end != '\n')
368 XTextExtents (bst->font, start, end-start,
369 &dir, &ascent, &descent, &ov);
370 if (ov.width > max_width)
371 max_width = ov.width;
376 switch (bst->queue[bst->pos].type) {
379 bst->current_left = bst->left_margin + bst->xoff;
383 bst->x = max_width - bst->right_margin - bst->xoff;
384 bst->current_left = bst->x;
389 int w = (bst->xgwa.width - bst->left_margin - bst->right_margin -
392 bst->x = bst->left_margin + bst->xoff + (w / 2);
393 bst->current_left = bst->x;
403 bst_crlf (struct bsod_state *bst)
405 int lh = bst->font->ascent + bst->font->descent;
406 bst->x = bst->current_left;
407 if (!bst->scroll_p ||
408 bst->y + lh < bst->xgwa.height - bst->bottom_margin - bst->yoff)
412 int w = bst->xgwa.width - bst->right_margin - bst->left_margin;
413 int h = bst->xgwa.height - bst->top_margin - bst->bottom_margin;
414 XCopyArea (bst->dpy, bst->window, bst->window, bst->gc,
415 bst->left_margin + bst->xoff,
416 bst->top_margin + bst->yoff + lh,
418 bst->left_margin + bst->xoff,
419 bst->top_margin + bst->yoff);
420 XClearArea (bst->dpy, bst->window,
421 bst->left_margin + bst->xoff,
422 bst->top_margin + bst->yoff + h - lh, w, lh, False);
428 draw_char (struct bsod_state *bst, char c)
432 else if (bst->crop_p && bst->y >=
433 (bst->xgwa.height - bst->bottom_margin - bst->yoff))
435 /* reached the bottom of the drawing area, and crop_p = True */
440 bst->x = bst->current_left;
444 if (bst->macx_eol_kludge)
446 /* Special case for the weird way OSX crashes print newlines... */
447 XDrawImageString (bst->dpy, bst->window, bst->gc,
448 bst->x, bst->y, " ", 1);
449 XDrawImageString (bst->dpy, bst->window, bst->gc,
451 bst->y + bst->font->ascent + bst->font->descent,
456 else if (c == '\b') /* backspace */
458 int cw = (bst->font->per_char
459 ? bst->font->per_char['n'-bst->font->min_char_or_byte2].width
460 : bst->font->min_bounds.width);
462 if (bst->x < bst->left_margin + bst->xoff)
463 bst->x = bst->left_margin + bst->xoff;
467 int dir, ascent, descent;
469 XTextExtents (bst->font, &c, 1, &dir, &ascent, &descent, &ov);
472 bst->x + ov.width > bst->xgwa.width - bst->right_margin - bst->xoff)
475 XDrawImageString (bst->dpy, bst->window, bst->gc,
476 bst->x, bst->y, &c, 1);
483 bsod_pop (struct bsod_state *bst)
485 bsod_event_type type = bst->queue[bst->pos].type;
488 return bst->draw_cb (bst);
490 if (bst->pos < 0) /* already done */
495 case LEFT: case LEFT_FULL:
496 case CENTER: case CENTER_FULL:
497 case RIGHT: case RIGHT_FULL:
499 const char *s = (const char *) bst->queue[bst->pos].arg2;
504 long delay = bst->line_delay;
506 bst->current_left = bst->left_margin + bst->xoff;
510 if (! bst->queue[bst->pos].arg3) /* "done once" */
512 position_for_text (bst, s);
513 bst->queue[bst->pos].arg4 = (void *) bst->queue[bst->pos].type;
514 bst->queue[bst->pos].type = LEFT;
516 if (type == CENTER_FULL ||
520 XSetForeground (bst->dpy, bst->gc, bst->bg);
521 XFillRectangle (bst->dpy, bst->window, bst->gc,
523 bst->y - bst->font->ascent,
525 bst->font->ascent + bst->font->descent);
526 XSetForeground (bst->dpy, bst->gc, bst->fg);
532 bst->queue[bst->pos].arg2 = (void *) s;
533 bst->queue[bst->pos].arg3 = (void *) 1; /* "done once" */
535 return (c == '\r' || c == '\n'
541 unsigned long swap = bst->fg;
544 XSetForeground (bst->dpy, bst->gc, bst->fg);
545 XSetBackground (bst->dpy, bst->gc, bst->bg);
551 bst->fg = (unsigned long) bst->queue[bst->pos].arg1;
552 bst->bg = (unsigned long) bst->queue[bst->pos].arg2;
553 XSetForeground (bst->dpy, bst->gc, bst->fg);
554 XSetBackground (bst->dpy, bst->gc, bst->bg);
560 bst->x = (long) bst->queue[bst->pos].arg1;
561 bst->y = (long) bst->queue[bst->pos].arg2;
567 int f = (long) bst->queue[bst->pos].arg1;
568 int x = (long) bst->queue[bst->pos].arg2;
569 int y = (long) bst->queue[bst->pos].arg3;
570 int w = (long) bst->queue[bst->pos].arg4;
571 int h = (long) bst->queue[bst->pos].arg5;
573 XFillRectangle (bst->dpy, bst->window, bst->gc, x, y, w, h);
575 XDrawRectangle (bst->dpy, bst->window, bst->gc, x, y, w, h);
581 int x1 = (long) bst->queue[bst->pos].arg1;
582 int y1 = (long) bst->queue[bst->pos].arg2;
583 int x2 = (long) bst->queue[bst->pos].arg3;
584 int y2 = (long) bst->queue[bst->pos].arg4;
585 int t = (long) bst->queue[bst->pos].arg5;
588 XChangeGC (bst->dpy, bst->gc, GCLineWidth, &gcv);
589 XDrawLine (bst->dpy, bst->window, bst->gc, x1, y1, x2, y2);
596 int srcx = (long) bst->queue[bst->pos].arg1;
597 int srcy = (long) bst->queue[bst->pos].arg2;
598 int w = (long) bst->queue[bst->pos].arg3;
599 int h = (long) bst->queue[bst->pos].arg4;
600 int tox = (long) bst->queue[bst->pos].arg5;
601 int toy = (long) bst->queue[bst->pos].arg6;
603 (type == PIXMAP ? bst->pixmap : bst->window),
604 bst->window, bst->gc,
605 srcx, srcy, w, h, tox, toy);
611 if (bst->img_loader) abort();
612 bst->img_loader = load_image_async_simple (0, bst->xgwa.screen,
613 bst->window, bst->window,
620 switch ((long) bst->queue[bst->pos].arg1) {
621 case 0: bst->font = bst->fontA; break;
622 case 1: bst->font = bst->fontB; break;
623 case 2: bst->font = bst->fontC; break;
624 default: abort(); break;
626 XSetFont (bst->dpy, bst->gc, bst->font->fid);
632 long delay = (long) bst->queue[bst->pos].arg1;
638 bst->char_delay = (long) bst->queue[bst->pos].arg1;
644 bst->line_delay = (long) bst->queue[bst->pos].arg1;
650 bst->left_margin = (long) bst->queue[bst->pos].arg1;
651 bst->right_margin = (long) bst->queue[bst->pos].arg2;
657 bst->top_margin = (long) bst->queue[bst->pos].arg1;
658 bst->bottom_margin = (long) bst->queue[bst->pos].arg2;
665 long delay = (long) bst->queue[bst->pos].arg1;
666 long count = (long) bst->queue[bst->pos].arg2;
669 if (type == CURSOR_BLOCK)
671 unsigned long swap = bst->fg;
674 XSetForeground (bst->dpy, bst->gc, bst->fg);
675 XSetBackground (bst->dpy, bst->gc, bst->bg);
676 draw_char (bst, ' ');
680 draw_char (bst, (count & 1 ? ' ' : '_'));
681 draw_char (bst, ' ');
687 bst->queue[bst->pos].arg2 = (void *) count;
695 long off = (long) bst->queue[bst->pos].arg1;
697 if (bst->pos < 0 || bst->pos >= bst->queue_size)
704 for (i = 0; i < bst->queue_size; i++)
705 switch (bst->queue[i].type) {
706 case LEFT: case LEFT_FULL:
707 case CENTER: case CENTER_FULL:
708 case RIGHT: case RIGHT_FULL:
709 bst->queue[i].arg2 = bst->queue[i].arg1;
710 bst->queue[i].arg3 = 0;
711 bst->queue[i].type = (bsod_event_type) bst->queue[i].arg4;
720 bst->crop_p = (long) bst->queue[bst->pos].arg1;
736 static struct bsod_state *
737 make_bsod_state (Display *dpy, Window window,
738 const char *name, const char *class)
741 struct bsod_state *bst;
742 char buf1[1024], buf2[1024];
743 char buf3[1024], buf4[1024];
744 char buf5[1024], buf6[1024];
745 char buf7[1024], buf8[1024];
746 const char *font1, *font2, *font3, *font4;
748 bst = (struct bsod_state *) calloc (1, sizeof (*bst));
749 bst->queue_size = 10;
750 bst->queue = (struct bsod_event *) calloc (bst->queue_size,
751 sizeof (*bst->queue));
753 bst->window = window;
754 XGetWindowAttributes (dpy, window, &bst->xgwa);
756 /* If the window is small:
757 use ".font" if it is loadable, else use ".font2".
759 If the window is big:
760 use ".bigFont" if it is loadable, else use ".bigFont2".
766 bst->xgwa.height < 640
770 sprintf (buf1, "%.100s.font", name);
771 sprintf (buf2, "%.100s.font", class);
772 sprintf (buf3, "%.100s.font2", name);
773 sprintf (buf4, "%.100s.font2", class);
777 sprintf (buf1, "%.100s.bigFont", name);
778 sprintf (buf2, "%.100s.bigFont", class);
779 sprintf (buf3, "%.100s.bigFont2", name);
780 sprintf (buf4, "%.100s.bigFont2", class);
782 sprintf (buf5, "%.100s.fontB", name);
783 sprintf (buf6, "%.100s.fontB", class);
784 sprintf (buf7, "%.100s.fontC", name);
785 sprintf (buf8, "%.100s.fontC", class);
787 font1 = get_string_resource (dpy, buf1, buf2);
788 font2 = get_string_resource (dpy, buf3, buf4);
789 font3 = get_string_resource (dpy, buf5, buf6);
790 font4 = get_string_resource (dpy, buf7, buf8);
792 /* If there was no ".mode.font2" resource also look for ".font2".
793 Under real X11, the wildcard does this, so this is redundant,
794 but jwxyz needs it because it doesn't implement wildcards.
796 # define RES2(VAR, BUF1, BUF2) do { \
798 VAR = get_string_resource (dpy, \
799 strchr (BUF1, '.') + 1, \
800 strchr (BUF2, '.') + 1); \
802 RES2 (font1, buf1, buf2);
803 RES2 (font2, buf3, buf4);
804 RES2 (font3, buf5, buf6);
805 RES2 (font4, buf7, buf8);
809 bst->font = XLoadQueryFont (dpy, font1);
810 if (! bst->font && font2)
811 bst->font = XLoadQueryFont (dpy, font2);
813 /* If neither of those worked, try some defaults. */
816 bst->font = XLoadQueryFont (dpy,"-*-courier-bold-r-*-*-*-120-*-*-m-*-*-*");
818 bst->font = XLoadQueryFont (dpy, "fixed");
823 bst->fontB = XLoadQueryFont (dpy, font3);
825 bst->fontC = XLoadQueryFont (dpy, font4);
827 if (! bst->fontB) bst->fontB = bst->font;
828 if (! bst->fontC) bst->fontC = bst->font;
830 bst->fontA = bst->font;
833 gcv.font = bst->font->fid;
835 sprintf (buf1, "%.100s.foreground", name);
836 sprintf (buf2, "%.100s.Foreground", class);
837 bst->fg = gcv.foreground = get_pixel_resource (dpy, bst->xgwa.colormap,
839 sprintf (buf1, "%.100s.background", name);
840 sprintf (buf2, "%.100s.Background", class);
841 bst->bg = gcv.background = get_pixel_resource (dpy, bst->xgwa.colormap,
843 bst->gc = XCreateGC (dpy, window, GCFont|GCForeground|GCBackground, &gcv);
846 jwxyz_XSetAntiAliasing (dpy, bst->gc, True);
850 /* Stupid iPhone X bezel.
851 #### This is the worst of all possible ways to do this!
853 if (bst->xgwa.width == 2436 || bst->xgwa.height == 2436) {
854 if (bst->xgwa.width > bst->xgwa.height)
861 bst->left_margin = bst->right_margin = 10;
862 bst->x = bst->left_margin + bst->xoff;
863 bst->y = bst->font->ascent + bst->left_margin + bst->yoff;
865 XSetWindowBackground (dpy, window, gcv.background);
871 free_bsod_state (struct bsod_state *bst)
878 XFreePixmap(bst->dpy, bst->pixmap);
880 XFreeFont (bst->dpy, bst->font);
881 XFreeGC (bst->dpy, bst->gc);
883 for (i = 0; i < bst->queue_size; i++)
884 switch (bst->queue[i].type) {
885 case LEFT: case LEFT_FULL:
886 case RIGHT: case RIGHT_FULL:
887 case CENTER: case CENTER_FULL:
888 free ((char *) bst->queue[i].arg1);
900 double_pixmap (Display *dpy, GC gc, Visual *visual, int depth, Pixmap pixmap,
901 int pix_w, int pix_h)
904 Pixmap p2 = XCreatePixmap(dpy, pixmap, pix_w*2, pix_h*2, depth);
905 XImage *i1 = XGetImage(dpy, pixmap, 0, 0, pix_w, pix_h, ~0L, ZPixmap);
906 XImage *i2 = XCreateImage(dpy, visual, depth, ZPixmap, 0, 0,
907 pix_w*2, pix_h*2, 8, 0);
908 i2->data = (char *) calloc(i2->height, i2->bytes_per_line);
909 for (y = 0; y < pix_h; y++)
910 for (x = 0; x < pix_w; x++)
912 unsigned long p = XGetPixel(i1, x, y);
913 XPutPixel(i2, x*2, y*2, p);
914 XPutPixel(i2, x*2+1, y*2, p);
915 XPutPixel(i2, x*2, y*2+1, p);
916 XPutPixel(i2, x*2+1, y*2+1, p);
918 free(i1->data); i1->data = 0;
920 XPutImage(dpy, p2, gc, i2, 0, 0, 0, 0, i2->width, i2->height);
921 free(i2->data); i2->data = 0;
923 XFreePixmap(dpy, pixmap);
928 /*****************************************************************************
929 *****************************************************************************/
931 static struct bsod_state *
932 windows_31 (Display *dpy, Window window)
934 struct bsod_state *bst = make_bsod_state (dpy, window, "windows", "Windows");
936 bst->xoff = bst->left_margin = bst->right_margin = 0;
939 BSOD_TEXT (bst, CENTER, "Windows\n");
941 BSOD_TEXT (bst, CENTER,
942 "A fatal exception 0E has occured at F0AD:42494C4C\n"
943 "the current application will be terminated.\n"
945 "* Press any key to terminate the current application.\n"
946 "* Press CTRL+ALT+DELETE again to restart your computer.\n"
947 " You will lose any unsaved information in all applications.\n"
950 BSOD_TEXT (bst, CENTER, "Press any key to continue");
952 bst->y = ((bst->xgwa.height - bst->yoff -
953 ((bst->font->ascent + bst->font->descent) * 9))
956 XClearWindow (dpy, window);
960 static struct bsod_state *
961 vmware (Display *dpy, Window window)
963 struct bsod_state *bst = make_bsod_state (dpy, window, "vmware", "VMware");
965 unsigned long fg = bst->fg;
966 unsigned long bg = bst->bg;
967 unsigned long fg2 = get_pixel_resource (dpy, bst->xgwa.colormap,
968 "vmware.foreground2",
969 "vmware.foreground");
970 BSOD_COLOR (bst, fg2, bg);
971 BSOD_TEXT (bst, LEFT,
972 "VMware ESX Server [Releasebuild-98103]\n");
973 BSOD_COLOR (bst, fg, bg);
974 BSOD_TEXT (bst, LEFT,
975 "PCPU 1 locked up. Failed to ack TLB invalidate.\n"
976 "frame=0x3a37d98 ip=0x625e94 cr2=0x0 cr3=0x40c66000 cr4=0x16c\n"
977 "es=0xffffffff ds=0xffffffff fs=0xffffffff gs=0xffffffff\n"
978 "eax=0xffffffff ebx=0xffffffff ecx=0xffffffff edx=0xffffffff\n"
979 "ebp=0x3a37ef4 esi=0xffffffff edi=0xffffffff err=-1 eflags=0xffffffff\n"
980 "*0:1037/helper1-4 1:1107/vmm0:Fagi 2:1121/vmware-vm 3:1122/mks:Franc\n"
981 "0x3a37ef4:[0x625e94]Panic+0x17 stack: 0x833ab4, 0x3a37f10, 0x3a37f48\n"
982 "0x3a37f04:[0x625e94]Panic+0x17 stack: 0x833ab4, 0x1, 0x14a03a0\n"
983 "0x3a37f48:[0x64bfa4]TLBDoInvalidate+0x38f stack: 0x3a37f54, 0x40, 0x2\n"
984 "0x3a37f70:[0x66da4d]XMapForceFlush+0x64 stack: 0x0, 0x4d3a, 0x0\n"
985 "0x3a37fac:[0x652b8b]helpFunc+0x2d2 stack: 0x1, 0x14a4580, 0x0\n"
986 "0x3a37ffc:[0x750902]CpuSched_StartWorld+0x109 stack: 0x0, 0x0, 0x0\n"
987 "0x3a38000:[0x0]blk_dev+0xfd76461f stack: 0x0, 0x0, 0x0\n"
988 "VMK uptime: 7:05:43:45.014 TSC: 1751259712918392\n"
989 "Starting coredump to disk\n");
990 BSOD_CHAR_DELAY (bst, 10000);
991 BSOD_TEXT (bst, LEFT, "using slot 1 of 1... ");
992 BSOD_CHAR_DELAY (bst, 300000);
993 BSOD_TEXT (bst, LEFT, "9876");
994 BSOD_CHAR_DELAY (bst, 3000000);
995 BSOD_TEXT (bst, LEFT, "66665");
996 BSOD_CHAR_DELAY (bst, 100000);
997 BSOD_TEXT (bst, LEFT, "4321");
998 BSOD_CHAR_DELAY (bst, 0);
999 BSOD_TEXT (bst, LEFT, "Disk dump successfull.\n"
1000 "Waiting for Debugger (world 1037)\n"
1001 "Debugger is listening on serial port ...\n");
1002 BSOD_CHAR_DELAY (bst, 10000);
1003 BSOD_TEXT (bst, LEFT, "Press Escape to enter local debugger\n");
1004 BSOD_CHAR_DELAY (bst, 10000);
1005 BSOD_TEXT (bst, LEFT, "Remote debugger activated. Local debugger no longer available.\n");
1007 /* BSOD_CURSOR (bst, CURSOR_LINE, 240000, 999999);*/
1009 /* bst->y = ((bst->xgwa.height - bst->yoff -
1010 ((bst->font->ascent + bst->font->descent) * 9))
1013 XClearWindow (dpy, window);
1019 static struct bsod_state *
1020 windows_nt (Display *dpy, Window window)
1022 struct bsod_state *bst = make_bsod_state (dpy, window, "nt", "NT");
1024 BSOD_TEXT (bst, LEFT,
1025 "*** STOP: 0x0000001E (0x80000003,0x80106fc0,0x8025ea21,0xfd6829e8)\n"
1026 "Unhandled Kernel exception c0000047 from fa8418b4 (8025ea21,fd6829e8)\n"
1028 "Dll Base Date Stamp - Name Dll Base Date Stamp - Name\n"
1029 "80100000 2be154c9 - ntoskrnl.exe 80400000 2bc153b0 - hal.dll\n"
1030 "80258000 2bd49628 - ncrc710.sys 8025c000 2bd49688 - SCSIPORT.SYS \n"
1031 "80267000 2bd49683 - scsidisk.sys 802a6000 2bd496b9 - Fastfat.sys\n"
1032 "fa800000 2bd49666 - Floppy.SYS fa810000 2bd496db - Hpfs_Rec.SYS\n"
1033 "fa820000 2bd49676 - Null.SYS fa830000 2bd4965a - Beep.SYS\n"
1034 "fa840000 2bdaab00 - i8042prt.SYS fa850000 2bd5a020 - SERMOUSE.SYS\n"
1035 "fa860000 2bd4966f - kbdclass.SYS fa870000 2bd49671 - MOUCLASS.SYS\n"
1036 "fa880000 2bd9c0be - Videoprt.SYS fa890000 2bd49638 - NCC1701E.SYS\n"
1037 "fa8a0000 2bd4a4ce - Vga.SYS fa8b0000 2bd496d0 - Msfs.SYS\n"
1038 "fa8c0000 2bd496c3 - Npfs.SYS fa8e0000 2bd496c9 - Ntfs.SYS\n"
1039 "fa940000 2bd496df - NDIS.SYS fa930000 2bd49707 - wdlan.sys\n"
1040 "fa970000 2bd49712 - TDI.SYS fa950000 2bd5a7fb - nbf.sys\n"
1041 "fa980000 2bd72406 - streams.sys fa9b0000 2bd4975f - ubnb.sys\n"
1042 "fa9c0000 2bd5bfd7 - usbser.sys fa9d0000 2bd4971d - netbios.sys\n"
1043 "fa9e0000 2bd49678 - Parallel.sys fa9f0000 2bd4969f - serial.SYS\n"
1044 "faa00000 2bd49739 - mup.sys faa40000 2bd4971f - SMBTRSUP.SYS\n"
1045 "faa10000 2bd6f2a2 - srv.sys faa50000 2bd4971a - afd.sys\n"
1046 "faa60000 2bd6fd80 - rdr.sys faaa0000 2bd49735 - bowser.sys\n"
1048 "Address dword dump Dll Base - Name\n"
1049 "801afc20 80106fc0 80106fc0 00000000 00000000 80149905 : "
1050 "fa840000 - i8042prt.SYS\n"
1051 "801afc24 80149905 80149905 ff8e6b8c 80129c2c ff8e6b94 : "
1052 "8025c000 - SCSIPORT.SYS\n"
1053 "801afc2c 80129c2c 80129c2c ff8e6b94 00000000 ff8e6b94 : "
1054 "80100000 - ntoskrnl.exe\n"
1055 "801afc34 801240f2 80124f02 ff8e6df4 ff8e6f60 ff8e6c58 : "
1056 "80100000 - ntoskrnl.exe\n"
1057 "801afc54 80124f16 80124f16 ff8e6f60 ff8e6c3c 8015ac7e : "
1058 "80100000 - ntoskrnl.exe\n"
1059 "801afc64 8015ac7e 8015ac7e ff8e6df4 ff8e6f60 ff8e6c58 : "
1060 "80100000 - ntoskrnl.exe\n"
1061 "801afc70 80129bda 80129bda 00000000 80088000 80106fc0 : "
1062 "80100000 - ntoskrnl.exe\n"
1064 "Kernel Debugger Using: COM2 (Port 0x2f8, Baud Rate 19200)\n"
1065 "Restart and set the recovery options in the system control panel\n"
1066 "or the /CRASHDEBUG system start option. If this message reappears,\n"
1067 "contact your system administrator or technical support group."
1070 bst->line_delay = 750;
1072 XClearWindow (dpy, window);
1077 static struct bsod_state *
1078 windows_2k (Display *dpy, Window window)
1080 struct bsod_state *bst = make_bsod_state (dpy, window, "windows", "Windows");
1082 BSOD_TEXT (bst, LEFT,
1083 "*** STOP: 0x000000D1 (0xE1D38000,0x0000001C,0x00000000,0xF09D42DA)\n"
1084 "DRIVER_IRQL_NOT_LESS_OR_EQUAL \n"
1086 "*** Address F09D42DA base at F09D4000, DateStamp 39f459ff - CRASHDD.SYS\n"
1088 "Beginning dump of physical memory\n");
1089 BSOD_PAUSE (bst, 4000000);
1090 BSOD_TEXT (bst, LEFT,
1091 "Physical memory dump complete. Contact your system administrator or\n"
1092 "technical support group.\n");
1094 bst->left_margin = 40;
1095 bst->y = (bst->font->ascent + bst->font->descent) * 10;
1096 bst->line_delay = 750;
1098 XClearWindow (dpy, window);
1103 static struct bsod_state *
1104 windows_me (Display *dpy, Window window)
1106 struct bsod_state *bst = make_bsod_state (dpy, window, "windows", "Windows");
1108 BSOD_TEXT (bst, LEFT,
1109 "Windows protection error. You need to restart your computer.\n\n"
1111 BSOD_CURSOR (bst, CURSOR_LINE, 120000, 999999);
1113 bst->left_margin = 40;
1114 bst->y = ((bst->xgwa.height - bst->yoff -
1115 ((bst->font->ascent + bst->font->descent) * 3))
1118 XClearWindow (dpy, window);
1123 static struct bsod_state *
1124 windows_xp (Display *dpy, Window window)
1126 struct bsod_state *bst = make_bsod_state (dpy, window, "windows", "Windows");
1128 BSOD_TEXT (bst, LEFT, /* From Wm. Rhodes <xscreensaver@27.org> */
1129 "A problem has been detected and windows has been shut down to prevent "
1131 "to your computer.\n"
1133 "If this is the first time you've seen this Stop error screen,\n"
1134 "restart your computer. If this screen appears again, follow\n"
1137 "Check to be sure you have adequate disk space. If a driver is\n"
1138 "identified in the Stop message, disable the driver or check\n"
1139 "with the manufacturer for driver updates. Try changing video\n"
1142 "Check with your hardware vendor for any BIOS updates. Disable\n"
1143 "BIOS memory options such as caching or shadowing. If you need\n"
1144 "to use Safe Mode to remove or disable components, restart your\n"
1145 "computer, press F8 to select Advanced Startup Options, and then\n"
1146 "select Safe Mode.\n"
1148 "Technical information:\n"
1150 "*** STOP: 0x0000007E (0xC0000005,0xF88FF190,0x0xF8975BA0,0xF89758A0)\n"
1153 "*** EPUSBDSK.sys - Address F88FF190 base at FF88FE000, datestamp "
1156 "Beginning dump of physical memory\n");
1157 BSOD_PAUSE (bst, 4000000);
1158 BSOD_TEXT (bst, LEFT,
1159 "Physical memory dump complete.\n"
1160 "Contact your system administrator or technical support group for "
1164 XClearWindow (dpy, window);
1169 static struct bsod_state *
1170 windows_lh (Display *dpy, Window window)
1172 struct bsod_state *bst =
1173 make_bsod_state (dpy, window, "windowslh", "WindowsLH");
1175 unsigned long fg = bst->fg;
1176 unsigned long bg = bst->bg;
1177 unsigned long bg2 = get_pixel_resource (dpy, bst->xgwa.colormap,
1178 "windowslh.background2",
1179 "WindowsLH.Background");
1181 /* The "RSOD" that appeared with "Windows Longhorn 5048.050401-0536_x86fre"
1182 As reported by http://joi.ito.com/RedScreen.jpg
1184 BSOD_COLOR (bst, bg, bg2);
1185 BSOD_TEXT (bst, CENTER_FULL, "Windows Boot Error\n");
1186 BSOD_COLOR (bst, fg, bg);
1187 BSOD_TEXT (bst, CENTER,
1189 "Windows Boot Manager has experienced a problem.\n"
1192 " Status: 0xc000000f\n"
1196 " Info: An error occurred transferring exectuion." /* (sic) */
1200 "You can try to recover the system with the Microsoft Windows "
1202 "Tools. (You might need to restart the system manually.)\n"
1204 "If the problem continues, please contact your system administrator "
1208 BSOD_MOVETO (bst, bst->left_margin + bst->xoff,
1209 bst->xgwa.height - bst->yoff - bst->font->descent);
1210 BSOD_COLOR (bst, bg, bg2);
1211 BSOD_TEXT (bst, LEFT_FULL, " SPACE=Continue\n");
1213 bst->y = bst->font->ascent;
1215 XClearWindow (dpy, window);
1220 static struct bsod_state *
1221 windows_10_update (Display *dpy, Window window)
1223 struct bsod_state *bst =
1224 make_bsod_state (dpy, window, "win10", "Win10");
1225 const char *fmt = "Working on updates %d%%";
1227 const char *line2 = "Don't turn off your PC. This will take a while.";
1228 const char *line3 = "Your PC will restart several times.";
1229 int line_height = bst->fontA->ascent + bst->fontA->descent;
1230 int y1 = bst->xgwa.height / 2 - line_height * 4;
1231 int y2 = bst->xgwa.height - bst->yoff - line_height * 3;
1234 /* TODO: win10_spinner.gif goes at (y - line_height * 2 - 64). */
1236 for (pct = 0; pct < 98; pct++)
1238 BSOD_MOVETO (bst, 0, y1);
1239 sprintf (line1, fmt, pct);
1240 BSOD_TEXT (bst, CENTER, line1);
1241 BSOD_MOVETO (bst, 0, y1 + line_height);
1242 BSOD_TEXT (bst, CENTER, line2);
1243 BSOD_MOVETO (bst, 0, y2);
1244 BSOD_TEXT (bst, CENTER, line3);
1245 BSOD_PAUSE (bst, 200000 + (random() % 3000000) + (random() % 3000000));
1248 XClearWindow (dpy, window);
1253 static struct bsod_state *
1254 windows_10 (Display *dpy, Window window)
1256 struct bsod_state *bst =
1257 make_bsod_state (dpy, window, "win10", "Win10");
1261 static const unsigned char qr_bits[] = {
1262 0xFF,0xFF,0xFF,0xFF,0xFF,0x01,0xFF,0xFF,0xFF,0xFF,0xFF,0x01,
1263 0x03,0x9A,0x70,0xEE,0x80,0x01,0xFB,0x22,0xAA,0xA6,0xBE,0x01,
1264 0x8B,0x8E,0x74,0xE7,0xA2,0x01,0x8B,0xEE,0x42,0xC4,0xA2,0x01,
1265 0x8B,0x42,0x6E,0xED,0xA2,0x01,0xFB,0xDA,0x63,0xA6,0xBE,0x01,
1266 0x03,0xAA,0xAA,0xAA,0x80,0x01,0xFF,0x8B,0xD8,0x9D,0xFF,0x01,
1267 0x63,0x62,0xDA,0x1B,0x98,0x01,0x6F,0x67,0x98,0x9F,0xBC,0x01,
1268 0x4F,0xCC,0x55,0x81,0x83,0x01,0xB7,0x6D,0xFF,0x68,0xB2,0x01,
1269 0xC3,0x10,0x87,0x8B,0x96,0x01,0x6F,0xB1,0x91,0x58,0x94,0x01,
1270 0xE3,0x36,0x88,0x84,0xB8,0x01,0x83,0x9B,0xFE,0x59,0xD7,0x01,
1271 0x3B,0x74,0x98,0x5C,0xB4,0x01,0x37,0x75,0xDC,0x91,0xA6,0x01,
1272 0x77,0xDE,0x01,0x54,0xBA,0x01,0xBB,0x6D,0x8B,0xB9,0xB5,0x01,
1273 0x1F,0x06,0xBD,0x9B,0xB4,0x01,0xD3,0xBD,0x91,0x19,0x84,0x01,
1274 0x0B,0x20,0xD8,0x91,0xB4,0x01,0x33,0x95,0xBC,0x0A,0xD5,0x01,
1275 0xB3,0x60,0xDC,0xD9,0xB6,0x01,0xEF,0x77,0x18,0x09,0xA4,0x01,
1276 0xA3,0xC2,0x95,0x51,0xB2,0x01,0xDF,0x63,0xDB,0xBE,0xB3,0x01,
1277 0x03,0x08,0xC9,0x09,0xF0,0x01,0xFF,0xA3,0x19,0xBD,0xFB,0x01,
1278 0x03,0x2E,0x84,0xA5,0xAA,0x01,0xFB,0x9A,0xFC,0x9B,0xBB,0x01,
1279 0x8B,0x7E,0x9C,0x1D,0xB0,0x01,0x8B,0x6E,0x58,0xA1,0xDB,0x01,
1280 0x8B,0xDA,0xD5,0x65,0xA2,0x01,0xFB,0x72,0xFB,0xE9,0xF0,0x01,
1281 0x03,0x02,0x99,0x3B,0xB3,0x01,0xFF,0xFF,0xFF,0xFF,0xFF,0x01,
1282 0xFF,0xFF,0xFF,0xFF,0xFF,0x01};
1285 const char *lines[] = {
1288 "Your PC ran into a problem and needs to restart. We're just\n",
1289 "collecting some error info, and then we'll restart for you.\n",
1293 "For more information about this issue and\n",
1294 "possible fixes, visit\n",
1295 /* "https://www.jwz.org/xscreensaver\n",*/
1296 "http://youtu.be/-RjmN9RZyr4\n",
1298 "If you call a support person, give them this info:\n",
1299 "Stop code CRITICAL_PROCESS_DIED",
1301 int i, y = 0, y0 = 0;
1302 int line_height0 = bst->fontB->ascent;
1303 int line_height1 = bst->fontA->ascent + bst->fontA->descent;
1304 int line_height2 = bst->fontC->ascent + bst->fontC->descent;
1305 int line_height = line_height0;
1306 int top, left0, left;
1307 int stop = 60 + (random() % 39);
1309 if (!(random() % 7))
1310 return windows_10_update (dpy, window);
1313 line_height1 *= 1.3;
1314 line_height2 *= 1.5;
1316 top = ((bst->xgwa.height - bst->yoff
1317 - (line_height0 * 1 +
1323 int dir, ascent, descent;
1325 const char *s = lines[2];
1326 XTextExtents (bst->fontA, s, strlen(s),
1327 &dir, &ascent, &descent, &ov);
1328 left = left0 = (bst->xgwa.width - ov.width) / 2;
1331 pixmap = XCreatePixmapFromBitmapData (dpy, window, (char *) qr_bits,
1332 qr_width, qr_height,
1333 bst->fg, bst->bg, bst->xgwa.depth);
1334 for (i = 0; i < 2; i++)
1336 pixmap = double_pixmap (dpy, bst->gc, bst->xgwa.visual, bst->xgwa.depth,
1337 pixmap, qr_width, qr_height);
1341 bst->pixmap = pixmap;
1344 line_height = line_height0;
1346 for (i = 0; i < countof(lines); i++)
1348 BSOD_MOVETO (bst, left, y);
1349 BSOD_TEXT (bst, LEFT, lines[i]);
1354 line_height = line_height1;
1359 y += line_height / 2;
1360 BSOD_PIXMAP (bst, 0, 0, qr_width, qr_height, left, y + line_height1);
1362 line_height = line_height2;
1363 left += qr_width + line_height2 / 2;
1372 for (i = 0; i <= stop; i++)
1375 sprintf (buf, "%d%% complete", i);
1376 BSOD_MOVETO (bst, left, y0);
1377 BSOD_TEXT (bst, LEFT, buf);
1378 BSOD_PAUSE (bst, 85000);
1380 BSOD_PAUSE (bst, 3000000);
1382 XClearWindow (dpy, window);
1387 static struct bsod_state *
1388 windows_other (Display *dpy, Window window)
1390 /* Lump all of the 2K-ish crashes together and select them randomly...
1392 int which = (random() % 4);
1394 case 0: return windows_2k (dpy, window); break;
1395 case 1: return windows_me (dpy, window); break;
1396 case 2: return windows_xp (dpy, window); break;
1397 case 3: return windows_lh (dpy, window); break;
1398 default: abort(); break;
1402 /* Windows and Apple2 ransomware.
1404 static struct bsod_state *apple2ransomware (Display *, Window);
1406 static struct bsod_state *
1407 windows_ransomware (Display *dpy, Window window)
1409 struct bsod_state *bst = make_bsod_state (dpy, window,
1410 "ransomware", "Ransomware");
1413 int pix_w = 0, pix_h = 0;
1414 Pixmap pixmap = xpm_data_to_pixmap (dpy, window,
1415 (char **) (ransomware_xpm),
1418 /* Don't start the countdown from the start, advance the deadline by 3 - 30
1420 int advance_deadline = (random() % 97200) + 10800;
1422 time_t now = time(NULL);
1423 const time_t stage1_deadline = now + 259200 - advance_deadline; /* 3 days */
1424 const time_t stage2_deadline = now + 604800 - advance_deadline; /* 7 days */
1425 char stage1_deadline_str[25], stage2_deadline_str[25];
1426 char countdown_str[16];
1427 int stage1_countdown_y, stage2_countdown_y;
1428 int countdown_d, countdown_h, countdown_m, countdown_s, countdown_r;
1429 const int line_height = bst->font->ascent + bst->font->descent;
1432 const char *currencies[] = {
1437 "Dunning-Krugerrands",
1438 "Dunning-Krugerrands",
1439 "Dunning-Krugerrands",
1440 "Dunning-Krugerrands",
1441 "Dunning-Krugerrands",
1442 "gift certificates",
1447 const char *currency = currencies[random() % countof(currencies)];
1449 const char *header_quips[] = {
1450 "Oops, your screens have been encrypted!",
1451 "Oops, your screens have been encrypted!",
1452 "Oops, your screens have been encrypted!",
1453 "Oops, your screens have been encrypted!",
1454 "Oops, your screen have encrypted!",
1455 "Oops, you're screens have been encrypted!",
1456 "Oops, your screens have been encrupted!",
1457 "Oops, your screens have been encrumpet!",
1458 "Oops, your screens have been encrusted!",
1459 "If you don't pay this ransom, then you are a theif!",
1460 "Your screen was subject to the laws of mathomatics!",
1461 "Oops, your screen was shaved by Occam's Razor!",
1462 "Oops, your screen was perturbated by Langford's Basilisk!",
1463 "Your screen is now stored as Snapchat messages!",
1464 "Oops, your screen is now stored on Betamax!",
1465 "Oops, your screen is now in the clown!",
1466 "Oops, your screen has been deprecated!",
1467 "Oops, you're screen was seized by the FBI!",
1468 "All your screen was shared with your coworkers!",
1469 "All your screen are belong to us.",
1470 "Well actually, your screen isn't needed anymore.",
1471 "u just got popped with some 0day shit!!",
1475 const char *header_quip = header_quips[random() % countof(header_quips)];
1477 /* You got this because... */
1478 const char *excuse_quips[] = {
1479 "all human actions are equivalent and all are on principle doomed "
1481 "you hold a diverse portfolio of cryptocurrencies",
1482 "you need to get in on ransomware futures at the ground floor",
1483 "your flight was overbooked",
1484 "you did not apply the security update for bugs NSA keys secret from "
1485 "Microsoft in your Windows(R) operating system",
1486 "you are bad and you should feel bad",
1487 "you used the wifi at defcon",
1488 "you lack official Clown Strike[TM] threaty threat technology",
1491 const char *excuse_quip = excuse_quips[random() % countof(excuse_quips)];
1493 /* WELL ACTUALLY, screensavers aren't really nescessary anymore because... */
1494 const char *screensaver_quips[] = {
1495 "I read it on hacker news",
1496 "that's official Debian policy now",
1497 "that is the official policy of United Airlines",
1498 "they cause global warming",
1499 "they lack an eternal struggle",
1500 "they lack a vapid dichotomy",
1501 "those electrons could be used for gold farming instead",
1502 "you can make more money in art exhibitions",
1505 const char *screensaver_quip =
1506 screensaver_quips[random() % countof(screensaver_quips)];
1508 /* Positions of UI elements. Layout:
1510 +---------+-+---------------------------------------+
1512 | | |---------------------------------------|
1523 | LINKS | +---------------------------------------+
1524 | LINKS | | FOOTER |
1525 +---------+-+---------------------------------------+
1527 The right side of the UI maximises to available width.
1528 The note text maximises to available height.
1529 The logo, header and timers are anchored to the top left of the window.
1530 The links and footer are anchored to the bottom left of the window.
1531 The entire window is a fixed 4:3 scale, with a minimum margin around it.
1534 /* Minimum margin around the window */
1535 int margin_size = 50;
1537 /* Right side of window (header, ransom note, BTC address, buttons) */
1538 const int right_pane_x = 270;
1540 const int header_y = 5;
1542 const int ransom_y = 40;
1544 const int footer_height = 100;
1546 /* Left pane (deadlines, countdown, links) */
1547 const int left_pane_width = right_pane_x - 5;
1548 /* Logo (shown at top left corner) */
1549 int logo_x = (left_pane_width - pix_w) / 2;
1551 /* Deadline position */
1552 const int deadline_y = 130;
1554 const int links_height = 100;
1555 const int links_x = 20;
1557 /* main window text */
1558 unsigned long fg = bst->fg;
1559 unsigned long bg = bst->bg;
1561 unsigned long fg2 = get_pixel_resource (dpy, bst->xgwa.colormap,
1562 "ransomware.foreground2",
1563 "Ransomware.Foreground");
1564 unsigned long bg2 = get_pixel_resource (dpy, bst->xgwa.colormap,
1565 "ransomware.background2",
1566 "Ransomware.Background");
1568 unsigned long fg3 = get_pixel_resource (dpy, bst->xgwa.colormap,
1569 "ransomware.foreground3",
1570 "Ransomware.Foreground");
1571 unsigned long bg3 = get_pixel_resource (dpy, bst->xgwa.colormap,
1572 "ransomware.background3",
1573 "Ransomware.Background");
1575 unsigned long link = get_pixel_resource (dpy, bst->xgwa.colormap,
1577 "Ransomware.Foreground");
1579 unsigned long theader = get_pixel_resource (dpy, bst->xgwa.colormap,
1580 "ransomware.timerheader",
1581 "Ransomware.Foreground");
1583 const char *lines[] = {
1584 "*What Happened To My Computer?\n",
1585 "Your important pixels are paintcrypted. All of your documents, photos, ",
1586 "videos, databases, icons, dick pics are not accessible because they ",
1587 "have been bitblted. Maybe you are looking for a way to get them back, ",
1588 "but don't waste your time. Nobody can recover your pixels without our ",
1589 "pointer motion clicker services.\n",
1591 "*Can I Recover My Important Dick Pix?\n",
1592 "Yes. We guarantee that you can recover them safely and easily. But you ",
1593 "not have much time.\n",
1594 "You can expose some files for free. Try it now by pressing <The Any ",
1596 "But if you want to unsave all your screens, then you need to pay. ",
1597 "You have only 3 days to click. After that the clicks will double. ",
1598 "After 7 days your pixels will be gone forever.\n",
1599 "We will have free events for cheapskates who can't pay in 6 months, ",
1600 "long after all the pixels are xored.\n",
1603 "Payment is accepted in ", "[C]",
1604 " only. For more information, press <About ", "[C]", ">.",
1605 " Please check the current price of ", "[C]", " and buy some ", "[C]",
1606 ". For more information, press <How to buy ", "[C]", ">.\n",
1607 "And send the correct amount to the address specified below. After your ",
1608 "payment, press <Check Payment>. Best time to check: 4-6am, Mon-Fri.\n",
1610 "*Why Did I Get This?\n",
1611 "You got this because ", "[Q]",
1612 ". Also you didn't click hard enough and now Tinkerbelle is dead.\n",
1614 "*But Aren't Screensavers Are Necessary?\n",
1615 "WELL ACTUALLY, screensavers aren't really nescessary anymore because ",
1618 "Please file complaints to @POTUS on Twitter.\n",
1623 "*GREETZ TO CRASH OVERRIDE AND ALSO JOEY\n",
1626 /* Make a 4:3 ratio box inside of the workspace */
1627 int box_width = bst->xgwa.width - (margin_size * 2);
1628 int box_height = bst->xgwa.height - bst->yoff - (margin_size * 2);
1629 int box_x = margin_size;
1630 int box_y = margin_size;
1631 if ((bst->xgwa.width / 4) * 3 > bst->xgwa.height) {
1632 /* Widescreen, make narrow bits */
1633 box_width = (bst->xgwa.height * 4 / 3) - (margin_size * 2);
1634 box_x = (bst->xgwa.width - box_width) / 2;
1636 /* Narrowscreen, make wide bits */
1637 box_height = (bst->xgwa.width * 3 / 4) - (margin_size * 2);
1638 box_y = (bst->xgwa.height - bst->yoff - box_height) / 2;
1641 if (box_width < 750 && box_x == margin_size) {
1642 /* Not much width... */
1643 box_width = bst->xgwa.width;
1648 bst->xoff = bst->left_margin = bst->right_margin = 0;
1650 if (!(random() % 8))
1651 return apple2ransomware (dpy, window);
1653 /* Grab the desktop image */
1654 /* BSOD_IMG (bst); */
1657 /* Draw the main red window */
1659 BSOD_RECT (bst, True, box_x, box_y, box_width, box_height);
1662 bst->pixmap = pixmap;
1663 BSOD_PIXMAP (bst, 0, 0, pix_w, pix_h, box_x + logo_x, box_y + logo_y);
1666 /* Setup deadlines */
1667 strftime (stage1_deadline_str, sizeof(stage1_deadline_str),
1668 "%m/%d/%Y %H:%M:%S\n\n", localtime(&stage1_deadline));
1669 strftime (stage2_deadline_str, sizeof(stage1_deadline_str),
1670 "%m/%d/%Y %H:%M:%S\n\n", localtime(&stage2_deadline));
1673 /* Draw header pane */
1675 BSOD_MOVETO (bst, box_x + right_pane_x, box_y + header_y + bst->fontA->ascent);
1676 BSOD_MARGINS (bst, box_x + right_pane_x, box_x);
1677 BSOD_COLOR (bst, fg, bg);
1678 BSOD_TEXT (bst, CENTER, header_quip);
1680 /* Draw left-side timers */
1681 BSOD_MOVETO (bst, box_x, box_y + deadline_y);
1682 BSOD_MARGINS (bst, box_x, box_x + box_width - left_pane_width);
1685 BSOD_COLOR (bst, theader, bg);
1686 BSOD_TEXT (bst, CENTER, "Payment will be raised on\n");
1687 BSOD_COLOR (bst, fg, bg);
1688 BSOD_TEXT (bst, CENTER, stage1_deadline_str);
1690 BSOD_TEXT (bst, CENTER, "Time Left\n");
1691 stage1_countdown_y = (line_height * 4) + box_y + deadline_y;
1692 BSOD_TEXT (bst, CENTER, "\n");
1693 BSOD_TEXT (bst, CENTER, "\n\n");
1695 BSOD_COLOR (bst, theader, bg);
1696 BSOD_TEXT (bst, CENTER, "Your pixels will be lost on\n");
1697 BSOD_COLOR (bst, fg, bg);
1698 BSOD_TEXT (bst, CENTER, stage2_deadline_str);
1700 BSOD_TEXT (bst, CENTER, "Time Left\n");
1701 stage2_countdown_y = (line_height * 9) + box_y + deadline_y;
1702 BSOD_TEXT (bst, CENTER, "\n");
1706 BSOD_MOVETO (bst, box_x + links_x, box_y + box_height - links_height);
1707 BSOD_MARGINS (bst, box_x + links_x, box_x + box_width - left_pane_width);
1708 BSOD_COLOR (bst, link, bg);
1710 if (box_height > 425) {
1711 /* Don't show this on small screens */
1712 BSOD_TEXT (bst, LEFT, "\n");
1713 BSOD_TEXT (bst, LEFT, "About ");
1714 BSOD_TEXT (bst, LEFT, currency);
1715 BSOD_TEXT (bst, LEFT, "\n\n"
1717 BSOD_TEXT (bst, LEFT, currency);
1718 BSOD_TEXT (bst, LEFT, "\n\n"
1722 /* Ransom note text area */
1723 BSOD_COLOR (bst, bg2, fg2);
1724 BSOD_RECT (bst, True, box_x + right_pane_x, box_y + ransom_y,
1725 box_width - right_pane_x - 10,
1726 box_height - ransom_y - footer_height);
1727 BSOD_MOVETO (bst, box_x + right_pane_x + 5,
1728 box_y + ransom_y + (line_height * 1.1));
1729 BSOD_MARGINS (bst, box_x + right_pane_x + 5, box_x + 15);
1730 /* VERT_MARGINS are a bit high, to ensure we draw as much text as we can in
1731 * the box, even if the line is partially cut. We'll draw over this later.
1733 BSOD_VERT_MARGINS (bst, box_y + ransom_y, box_y + (footer_height / 2));
1736 /* Write out the ransom note itself */
1737 BSOD_CROP (bst, True);
1738 for (i = 0; i < countof(lines); i++)
1740 const char *s = lines[i];
1741 if (!strcmp(s, "[C]")) s = currency;
1742 else if (!strcmp(s, "[Q]")) s = excuse_quip;
1743 else if (!strcmp(s, "[S]")) s = screensaver_quip;
1753 BSOD_TEXT (bst, LEFT, s);
1755 BSOD_CROP (bst, False);
1758 /* Draw over any overflowing ransom text. */
1759 BSOD_COLOR (bst, bg, fg);
1760 BSOD_RECT (bst, True, box_x + right_pane_x,
1761 box_y + box_height - footer_height,
1762 box_width - right_pane_x, footer_height);
1764 /* Draw the footer */
1765 BSOD_COLOR (bst, theader, bg);
1766 BSOD_MOVETO (bst, box_x + right_pane_x,
1767 box_y + box_height - footer_height + line_height);
1769 sprintf(buf, "Send $%.2f of %s to this address:\n", 101+frand(888), currency);
1770 BSOD_TEXT (bst, LEFT, buf);
1771 BSOD_COLOR (bst, fg2, bg2);
1773 /* address, has some extra slashes in there because it's a fake address */
1774 for (i = 0; i < 40; i++) {
1776 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123459789";
1777 buf[i] = s[random() % strlen(s)];
1779 strncpy (buf, " //", 3);
1783 strcpy (buf+33, " ");
1784 BSOD_TEXT (bst, LEFT, buf);
1786 BSOD_COLOR (bst, fg, bg);
1787 BSOD_TEXT (bst, LEFT, " ");
1788 BSOD_COLOR (bst, fg3, bg3);
1789 BSOD_TEXT (bst, LEFT, " Copy ");
1790 BSOD_COLOR (bst, fg, bg);
1791 BSOD_TEXT (bst, LEFT, "\n\n");
1793 BSOD_COLOR (bst, fg3, bg3);
1794 BSOD_TEXT (bst, LEFT, " Demogrify Screen ");
1795 BSOD_COLOR (bst, fg, bg);
1796 BSOD_TEXT (bst, LEFT, " ");
1797 BSOD_COLOR (bst, fg3, bg3);
1798 BSOD_TEXT (bst, LEFT, " Check Payment ");
1801 /* Draw countdown timers */
1802 BSOD_COLOR (bst, fg, bg);
1806 BSOD_MOVETO (bst, box_x, stage1_countdown_y);
1807 BSOD_MARGINS (bst, box_x, box_x + box_width - left_pane_width);
1809 countdown_r = stage1_deadline - now;
1810 countdown_s = countdown_r % 60;
1811 countdown_m = (countdown_r / 60) % 60;
1812 countdown_h = (countdown_r / 3600) % 24;
1813 countdown_d = (countdown_r / 86400);
1815 sprintf (countdown_str, "%02d:%02d:%02d:%02d\n",
1816 countdown_d, countdown_h, countdown_m, countdown_s);
1818 BSOD_TEXT (bst, CENTER, countdown_str);
1821 BSOD_MOVETO (bst, box_x, stage2_countdown_y);
1823 countdown_r = stage2_deadline - now;
1824 countdown_s = countdown_r % 60;
1825 countdown_m = (countdown_r / 60) % 60;
1826 countdown_h = (countdown_r / 3600) % 24;
1827 countdown_d = (countdown_r / 86400);
1829 sprintf (countdown_str, "%02d:%02d:%02d:%02d\n",
1830 countdown_d, countdown_h, countdown_m, countdown_s);
1832 BSOD_TEXT (bst, CENTER, countdown_str);
1834 BSOD_PAUSE (bst, 1000000);
1837 /* While the "correct" thing to do is create enough of a script to fill the
1838 * stage2_deadline, this would be 7 days of "frames", which is quite a bit
1839 * of memory. Instead, only fill the buffer with 1 hour of frames, which is
1840 * enough to make the point before xscreensaver cycles us.
1842 } while (stage1_deadline - now > 3600);
1844 XClearWindow (dpy, window);
1849 /* As seen in Portal 2. By jwz.
1851 static struct bsod_state *
1852 glados (Display *dpy, Window window)
1854 struct bsod_state *bst = make_bsod_state (dpy, window, "glaDOS", "GlaDOS");
1855 const char * panicstr[] = {
1857 "MOLTEN CORE WARNING\n",
1859 "An operator error exception has occurred at FISSREAC0020093:09\n",
1860 "FISSREAC0020077:14 FISSREAC0020023:17 FISSREAC0020088:22\n",
1861 "neutron multiplication rate at spikevalue 99999999\n",
1863 "* Press any key to vent radiological emissions into atmosphere.\n",
1864 "* Consult reactor core manual for instructions on proper reactor core\n",
1865 "maintenance and repair.\n",
1867 "Press any key to continue\n",
1872 bst->xoff = bst->left_margin = bst->right_margin = 0;
1874 bst->y = ((bst->xgwa.height - bst->yoff -
1875 ((bst->font->ascent + bst->font->descent) * countof(panicstr)))
1878 BSOD_MOVETO (bst, 0, bst->y);
1880 BSOD_TEXT (bst, CENTER, "OPERATOR ERROR\n");
1882 for (i = 0; i < countof(panicstr); i++)
1883 BSOD_TEXT (bst, CENTER, panicstr[i]);
1884 BSOD_PAUSE (bst, 1000000);
1886 BSOD_RECT (bst, True, 0, 0, bst->xgwa.width, bst->xgwa.height);
1888 BSOD_PAUSE (bst, 250000);
1891 XClearWindow (dpy, window);
1897 /* SCO OpenServer 5 panic, by Tom Kelly <tom@ancilla.toronto.on.ca>
1899 static struct bsod_state *
1900 sco (Display *dpy, Window window)
1902 struct bsod_state *bst = make_bsod_state (dpy, window, "sco", "SCO");
1904 BSOD_TEXT (bst, LEFT,
1905 "Unexpected trap in kernel mode:\n"
1907 "cr0 0x80010013 cr2 0x00000014 cr3 0x00000000 tlb 0x00000000\n"
1908 "ss 0x00071054 uesp 0x00012055 efl 0x00080888 ipl 0x00000005\n"
1909 "cs 0x00092585 eip 0x00544a4b err 0x004d4a47 trap 0x0000000E\n"
1910 "eax 0x0045474b ecx 0x0042544b edx 0x57687920 ebx 0x61726520\n"
1911 "esp 0x796f7520 ebp 0x72656164 esi 0x696e6720 edi 0x74686973\n"
1912 "ds 0x3f000000 es 0x43494c48 fs 0x43525343 gs 0x4f4d4b53\n"
1914 "PANIC: k_trap - kernel mode trap type 0x0000000E\n"
1915 "Trying to dump 5023 pages to dumpdev hd (1/41), 63 pages per '.'\n"
1917 BSOD_CHAR_DELAY (bst, 100000);
1918 BSOD_TEXT (bst, LEFT,
1919 "................................................................."
1922 BSOD_CHAR_DELAY (bst, 0);
1923 BSOD_TEXT (bst, LEFT,
1924 "5023 pages dumped\n"
1928 BSOD_PAUSE (bst, 2000000);
1929 BSOD_TEXT (bst, LEFT,
1930 "** Safe to Power Off **\n"
1932 "** Press Any Key to Reboot **\n"
1935 bst->y = ((bst->xgwa.height - bst->yoff -
1936 ((bst->font->ascent + bst->font->descent) * 18)));
1938 XClearWindow (dpy, window);
1943 /* Linux (sparc) panic, by Tom Kelly <tom@ancilla.toronto.on.ca>
1945 static struct bsod_state *
1946 sparc_linux (Display *dpy, Window window)
1948 struct bsod_state *bst = make_bsod_state (dpy, window,
1949 "sparclinux", "SparcLinux");
1950 bst->scroll_p = True;
1951 bst->y = bst->xgwa.height - bst->yoff
1952 - bst->font->ascent - bst->font->descent;
1954 BSOD_TEXT (bst, LEFT,
1955 "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
1956 "Unable to handle kernel paging request at virtual address f0d4a000\n"
1957 "tsk->mm->context = 00000014\n"
1958 "tsk->mm->pgd = f26b0000\n"
1960 " \"@'/ ,. \\`@\"\n"
1963 "gawk(22827): Oops\n"
1964 "PSR: 044010c1 PC: f001c2cc NPC: f001c2d0 Y: 00000000\n"
1965 "g0: 00001000 g1: fffffff7 g2: 04401086 g3: 0001eaa0\n"
1966 "g4: 000207dc g5: f0130400 g6: f0d4a018 g7: 00000001\n"
1967 "o0: 00000000 o1: f0d4a298 o2: 00000040 o3: f1380718\n"
1968 "o4: f1380718 o5: 00000200 sp: f1b13f08 ret_pc: f001c2a0\n"
1969 "l0: efffd880 l1: 00000001 l2: f0d4a230 l3: 00000014\n"
1970 "l4: 0000ffff l5: f0131550 l6: f012c000 l7: f0130400\n"
1971 "i0: f1b13fb0 i1: 00000001 i2: 00000002 i3: 0007c000\n"
1972 "i4: f01457c0 i5: 00000004 i6: f1b13f70 i7: f0015360\n"
1973 "Instruction DUMP:\n"
1976 XClearWindow (dpy, window);
1981 /* BSD Panic by greywolf@starwolf.com - modeled after the Linux panic above.
1982 By Grey Wolf <greywolf@siteROCK.com>
1984 static struct bsod_state *
1985 bsd (Display *dpy, Window window)
1987 struct bsod_state *bst = make_bsod_state (dpy, window, "bsd", "BSD");
1989 const char * const panicstr[] = {
1990 "panic: ifree: freeing free inode\n",
1991 "panic: blkfree: freeing free block\n",
1992 "panic: improbability coefficient below zero\n",
1993 "panic: cgsixmmap\n",
1994 "panic: crazy interrupts\n",
1996 "panic: attempted windows install\n",
1998 "panic: free inode isn't\n",
1999 "panic: cpu_fork: curproc\n",
2000 "panic: malloc: out of space in kmem_map\n",
2001 "panic: vogon starship detected\n",
2002 "panic: teleport chamber: out of order\n",
2003 "panic: Brain fried - core dumped\n"
2006 char syncing[80], bbuf[5];
2008 for (i = 0; i < sizeof(syncing); i++)
2011 i = (random() % (sizeof(panicstr) / sizeof(*panicstr)));
2012 BSOD_TEXT (bst, LEFT, panicstr[i]);
2013 BSOD_TEXT (bst, LEFT, "Syncing disks: ");
2015 b = (random() % 40);
2016 for (n = 0; (n < 20) && (b > 0); n++)
2020 i = (random() & 0x7);
2021 b -= (random() & 0xff) % 20;
2025 sprintf (bbuf, "%d ", b);
2026 BSOD_TEXT (bst, LEFT, bbuf);
2027 BSOD_PAUSE (bst, 1000000);
2030 BSOD_TEXT (bst, LEFT, "\n");
2031 BSOD_TEXT (bst, LEFT, (b ? "damn!" : "sunk!"));
2032 BSOD_TEXT (bst, LEFT, "\nRebooting\n");
2034 bst->y = ((bst->xgwa.height - bst->yoff -
2035 ((bst->font->ascent + bst->font->descent) * 4)));
2037 XClearWindow (dpy, window);
2042 static struct bsod_state *
2043 amiga (Display *dpy, Window window)
2045 struct bsod_state *bst = make_bsod_state (dpy, window, "amiga", "Amiga");
2048 int pix_w = 0, pix_h = 0;
2052 unsigned long bg2 = get_pixel_resource (dpy, bst->xgwa.colormap,
2053 "amiga.background2",
2054 "Amiga.Background");
2057 bst->top_margin = bst->bottom_margin = 0;
2060 pixmap = xpm_data_to_pixmap (dpy, window, (char **) amiga_hand,
2062 # endif /* DO_XPM */
2065 MIN (bst->xgwa.width, bst->xgwa.height) > 600) /* scale up the bitmap */
2067 pixmap = double_pixmap (dpy, bst->gc, bst->xgwa.visual, bst->xgwa.depth,
2068 pixmap, pix_w, pix_h);
2074 XSetLineAttributes (dpy, bst->gc, lw, LineSolid, CapButt, JoinMiter);
2076 height = (bst->font->ascent + bst->font->descent) * 6;
2078 BSOD_PAUSE (bst, 2000000);
2079 BSOD_COPY (bst, 0, 0, bst->xgwa.width, bst->xgwa.height - height, 0, height);
2082 BSOD_RECT (bst, True, 0, 0, bst->xgwa.width, height);
2084 BSOD_TEXT (bst, CENTER,
2086 "Software failure. Press left mouse button to continue.\n"
2087 "Guru Meditation #00000003.00C01570"
2089 BSOD_RECT (bst, False, lw/2, lw/2, bst->xgwa.width - lw, height);
2090 BSOD_PAUSE (bst, 1000000);
2092 BSOD_LOOP (bst, -3);
2094 XSetWindowBackground (dpy, window, bg2);
2095 XClearWindow (dpy, window);
2096 XSetWindowBackground (dpy, window, bst->bg);
2100 int x = (bst->xgwa.width - pix_w) / 2;
2101 int y = ((bst->xgwa.height - pix_h) / 2);
2102 XCopyArea (dpy, pixmap, bst->window, bst->gc, 0, 0, pix_w, pix_h, x, y);
2112 /* Atari ST, by Marcus Herbert <rhoenie@nobiscum.de>
2113 Marcus had this to say:
2115 Though I still have my Atari somewhere, I hardly remember
2116 the meaning of the bombs. I think 9 bombs was "bus error" or
2117 something like that. And you often had a few bombs displayed
2118 quickly and then the next few ones coming up step by step.
2119 Perhaps somebody else can tell you more about it.. its just
2122 static struct bsod_state *
2123 atari (Display *dpy, Window window)
2125 struct bsod_state *bst = make_bsod_state (dpy, window, "atari", "Atari");
2128 int pix_w = atari_width;
2129 int pix_h = atari_height;
2133 pixmap = XCreatePixmapFromBitmapData (dpy, window, (char *) atari_bits,
2135 bst->fg, bst->bg, bst->xgwa.depth);
2136 pixmap = double_pixmap (dpy, bst->gc, bst->xgwa.visual, bst->xgwa.depth,
2137 pixmap, pix_w, pix_h);
2143 y = bst->xgwa.height/2;
2146 for (i = 1; i< 7; i++)
2147 BSOD_COPY (bst, x, y, pix_w, pix_h, (x + (i*offset)), y);
2151 BSOD_PAUSE (bst, 1000000);
2152 BSOD_COPY (bst, x, y, pix_w, pix_h, (x + (i*offset)), y);
2155 XClearWindow (dpy, window);
2156 XCopyArea (dpy, pixmap, window, bst->gc, 0, 0, pix_w, pix_h, x, y);
2157 XFreePixmap (dpy, pixmap);
2163 static struct bsod_state *
2164 mac (Display *dpy, Window window)
2166 struct bsod_state *bst = make_bsod_state (dpy, window, "mac", "Mac");
2169 int pix_w = mac_width;
2170 int pix_h = mac_height;
2171 int offset = mac_height * 4;
2174 const char *string = ("0 0 0 0 0 0 0 F\n"
2177 bst->xoff = bst->left_margin = bst->right_margin = 0;
2179 pixmap = XCreatePixmapFromBitmapData(dpy, window, (char *) mac_bits,
2180 mac_width, mac_height,
2181 bst->fg, bst->bg, bst->xgwa.depth);
2183 for (i = 0; i < 2; i++)
2185 pixmap = double_pixmap (dpy, bst->gc, bst->xgwa.visual, bst->xgwa.depth,
2186 pixmap, pix_w, pix_h);
2187 pix_w *= 2; pix_h *= 2;
2190 bst->x = (bst->xgwa.width - pix_w) / 2;
2191 bst->y = (((bst->xgwa.height + offset) / 2) -
2193 (bst->font->ascent + bst->font->descent) * 2);
2194 if (bst->y < 0) bst->y = 0;
2196 XClearWindow (dpy, window);
2197 XCopyArea (dpy, pixmap, window, bst->gc, 0, 0, pix_w, pix_h, bst->x, bst->y);
2198 XFreePixmap (dpy, pixmap);
2200 bst->y += offset + bst->font->ascent + bst->font->descent;
2201 BSOD_TEXT (bst, CENTER, string);
2207 static struct bsod_state *
2208 macsbug (Display *dpy, Window window)
2210 struct bsod_state *bst = make_bsod_state (dpy, window, "macsbug", "MacsBug");
2213 const char *left = (" SP \n"
2260 const char *bottom = (" _A09D\n"
2261 " +00884 40843714 #$0700,SR "
2263 " +00886 40843765 *+$0400 "
2265 " +00888 40843718 $0004(A7),([0,A7[)"
2266 " ; 04E8D0AE | 66B8");
2268 const char * body = ("PowerPC unmapped memory exception at 003AFDAC "
2269 "BowelsOfTheMemoryMgr+04F9C\n"
2270 " Calling chain using A6/R1 links\n"
2271 " Back chain ISA Caller\n"
2272 " 00000000 PPC 28C5353C __start+00054\n"
2273 " 24DB03C0 PPC 28B9258C main+0039C\n"
2274 " 24DB0350 PPC 28B9210C MainEvent+00494\n"
2275 " 24DB02B0 PPC 28B91B40 HandleEvent+00278\n"
2276 " 24DB0250 PPC 28B83DAC DoAppleEvent+00020\n"
2277 " 24DB0210 PPC FFD3E5D0 "
2278 "AEProcessAppleEvent+00020\n"
2279 " 24DB0132 68K 00589468\n"
2280 " 24DAFF8C 68K 00589582\n"
2281 " 24DAFF26 68K 00588F70\n"
2282 " 24DAFEB3 PPC 00307098 "
2283 "EmToNatEndMoveParams+00014\n"
2284 " 24DAFE40 PPC 28B9D0B0 DoScript+001C4\n"
2285 " 24DAFDD0 PPC 28B9C35C RunScript+00390\n"
2286 " 24DAFC60 PPC 28BA36D4 run_perl+000E0\n"
2287 " 24DAFC10 PPC 28BC2904 perl_run+002CC\n"
2288 " 24DAFA80 PPC 28C18490 Perl_runops+00068\n"
2289 " 24DAFA30 PPC 28BE6CC0 Perl_pp_backtick+000FC\n"
2290 " 24DAF9D0 PPC 28BA48B8 Perl_my_popen+00158\n"
2291 " 24DAF980 PPC 28C5395C sfclose+00378\n"
2292 " 24DAF930 PPC 28BA568C free+0000C\n"
2293 " 24DAF8F0 PPC 28BA6254 pool_free+001D0\n"
2294 " 24DAF8A0 PPC FFD48F14 DisposePtr+00028\n"
2295 " 24DAF7C9 PPC 00307098 "
2296 "EmToNatEndMoveParams+00014\n"
2297 " 24DAF780 PPC 003AA180 __DisposePtr+00010");
2302 int char_width, line_height;
2303 int col_right, row_top, row_bottom, page_right, page_bottom, body_top;
2306 unsigned long fg = bst->fg;
2307 unsigned long bg = bst->bg;
2308 unsigned long bc = get_pixel_resource (dpy, bst->xgwa.colormap,
2309 "macsbug.borderColor",
2310 "MacsBug.BorderColor");
2312 bst->xoff = bst->left_margin = bst->right_margin = 0;
2314 for (s = body; *s; s++) if (*s == '\n') body_lines++;
2316 char_width = (bst->font->per_char
2317 ? bst->font->per_char['n'-bst->font->min_char_or_byte2].width
2318 : bst->font->min_bounds.width);
2319 line_height = bst->font->ascent + bst->font->descent;
2321 col_right = char_width * 12; /* number of columns in `left' */
2322 page_bottom = line_height * 47; /* number of lines in `left' */
2324 if (page_bottom > bst->xgwa.height - bst->yoff)
2325 page_bottom = bst->xgwa.height - bst->yoff;
2327 row_bottom = page_bottom - line_height;
2328 row_top = row_bottom - (line_height * 4);
2329 page_right = col_right + (char_width * 88);
2330 body_top = row_top - (line_height * body_lines);
2339 xoff = (bst->xgwa.width - page_right) / 2;
2340 yoff = (bst->xgwa.height - page_bottom) / 2;
2342 if (xoff < 0) xoff = 0;
2343 if (yoff < 0) yoff = 0;
2345 BSOD_MARGINS (bst, xoff, yoff);
2347 BSOD_COLOR (bst, bc, bg);
2348 BSOD_RECT (bst, True, 0, 0, bst->xgwa.width, bst->xgwa.height);
2349 BSOD_COLOR (bst, bg, bg);
2350 BSOD_RECT (bst, True, xoff-2, yoff, page_right+4, page_bottom);
2351 BSOD_COLOR (bst, fg, bg);
2353 BSOD_MOVETO (bst, xoff, yoff + line_height);
2354 BSOD_TEXT (bst, LEFT, left);
2355 BSOD_MOVETO (bst, xoff+col_right, yoff + row_top + line_height);
2356 BSOD_TEXT (bst, LEFT, bottom);
2358 BSOD_RECT (bst, True, xoff + col_right, yoff, 2, page_bottom);
2359 BSOD_RECT (bst, True, xoff + col_right, yoff + row_top,
2360 page_right - col_right, 1);
2361 BSOD_RECT (bst, True, xoff + col_right, yoff + row_bottom,
2362 page_right - col_right, 1);
2363 BSOD_RECT (bst, False, xoff-2, yoff, page_right+4, page_bottom);
2365 BSOD_LINE_DELAY (bst, 500);
2367 xoff + col_right + char_width,
2368 yoff + body_top + line_height);
2369 BSOD_MARGINS (bst, xoff + col_right + char_width, yoff);
2370 BSOD_TEXT (bst, LEFT, body);
2372 BSOD_RECT (bst, False, xoff-2, yoff, page_right+4, page_bottom); /* again */
2374 BSOD_RECT (bst, False,
2375 xoff + col_right + (char_width/2)+2,
2376 yoff + row_bottom + 2,
2378 page_bottom - row_bottom - 4);
2380 BSOD_PAUSE (bst, 666666);
2382 BSOD_LOOP (bst, -3);
2384 XClearWindow (dpy, window);
2389 static struct bsod_state *
2390 mac1 (Display *dpy, Window window)
2392 struct bsod_state *bst = make_bsod_state (dpy, window, "mac1", "Mac1");
2395 int pix_w = macbomb_width;
2396 int pix_h = macbomb_height;
2399 pixmap = XCreatePixmapFromBitmapData (dpy, window, (char *) macbomb_bits,
2400 macbomb_width, macbomb_height,
2401 bst->fg, bst->bg, bst->xgwa.depth);
2404 pix_w < bst->xgwa.width / 2 &&
2405 pix_h < bst->xgwa.height / 2)
2407 pixmap = double_pixmap (dpy, bst->gc, bst->xgwa.visual,
2408 bst->xgwa.depth, pixmap, pix_w, pix_h);
2413 x = (bst->xgwa.width - pix_w) / 2;
2414 y = (bst->xgwa.height - pix_h) / 2;
2417 XClearWindow (dpy, window);
2418 XCopyArea (dpy, pixmap, window, bst->gc, 0, 0, pix_w, pix_h, x, y);
2424 /* This is what kernel panics looked like on MacOS X 10.0 through 10.1.5.
2425 In later releases, it's a graphic of a power button with text in
2426 English, French, German, and Japanese overlayed transparently.
2428 static struct bsod_state *
2429 macx_10_0 (Display *dpy, Window window)
2431 struct bsod_state *bst = make_bsod_state (dpy, window, "macx", "MacX");
2433 XClearWindow (dpy, window);
2434 XSetForeground (dpy, bst->gc,
2435 get_pixel_resource (dpy, bst->xgwa.colormap,
2436 "macx.textForeground",
2437 "MacX.TextForeground"));
2438 XSetBackground (dpy, bst->gc,
2439 get_pixel_resource (dpy, bst->xgwa.colormap,
2440 "macx.textBackground",
2441 "MacX.TextBackground"));
2447 int x, y, pix_w, pix_h;
2448 pixmap = xpm_data_to_pixmap (dpy, window, (char **) happy_mac,
2449 &pix_w, &pix_h, &mask);
2454 pixmap = double_pixmap (dpy, bst->gc, bst->xgwa.visual,
2455 bst->xgwa.depth, pixmap, pix_w, pix_h);
2456 mask = double_pixmap (dpy, bst->gc, bst->xgwa.visual,
2457 1, mask, pix_w, pix_h);
2463 x = (bst->xgwa.width - pix_w) / 2;
2464 y = (bst->xgwa.height - pix_h) / 2;
2466 XSetClipMask (dpy, bst->gc, mask);
2467 XSetClipOrigin (dpy, bst->gc, x, y);
2468 XCopyArea (dpy, pixmap, window, bst->gc, 0, 0, pix_w, pix_h, x, y);
2469 XSetClipMask (dpy, bst->gc, None);
2470 XFreePixmap (dpy, pixmap);
2474 bst->left_margin = 0;
2475 bst->right_margin = 0;
2476 bst->y = bst->font->ascent;
2477 bst->macx_eol_kludge = True;
2480 BSOD_PAUSE (bst, 3000000);
2481 BSOD_TEXT (bst, LEFT,
2482 "panic(cpu 0): Unable to find driver for this platform: "
2483 "\"PowerMac 3,5\".\n"
2485 "backtrace: 0x0008c2f4 0x0002a7a0 0x001f0204 0x001d4e4c 0x001d4c5c "
2486 "0x001a56cc 0x01d5dbc 0x001c621c 0x00037430 0x00037364\n"
2490 "No debugger configured - dumping debug information\n"
2492 "version string : Darwin Kernel Version 1.3:\n"
2493 "Thu Mar 1 06:56:40 PST 2001; root:xnu/xnu-123.5.obj~1/RELEASE_PPC\n"
2498 "DBAT0: 00000000 00000000\n"
2499 "DBAT1: 00000000 00000000\n"
2500 "DBAT2: 80001FFE 8000003A\n"
2501 "DBAT3: 90001FFE 9000003A\n"
2503 "backtrace: 0x0008c2f4 0x0002a7a0 0x001f0204 0x001d4e4c 0x001d4c5c "
2504 "0x001a56cc 0x01d5dbc 0x001c621c 0x00037430 0x00037364\n"
2506 "panic: We are hanging here...\n");
2513 static struct bsod_state *
2514 macx_10_2 (Display *dpy, Window window, Bool v10_3_p)
2516 struct bsod_state *bst = make_bsod_state (dpy, window, "macx", "MacX");
2519 int pix_w = 0, pix_h = 0;
2522 pixmap = xpm_data_to_pixmap (dpy, window,
2523 (char **) (v10_3_p ? osx_10_3 : osx_10_2),
2525 if (! pixmap) abort();
2528 if (bst->xgwa.height > 600) /* scale up the bitmap */
2530 pixmap = double_pixmap (dpy, bst->gc, bst->xgwa.visual, bst->xgwa.depth,
2531 pixmap, pix_w, pix_h);
2532 if (! pixmap) abort();
2539 BSOD_PAUSE (bst, 2000000);
2541 bst->pixmap = pixmap;
2543 x = (bst->xgwa.width - pix_w) / 2;
2544 y = ((bst->xgwa.height - pix_h) / 2);
2545 BSOD_PIXMAP (bst, 0, 0, pix_w, pix_h, x, y);
2549 # endif /* DO_XPM */
2552 /* 2006 Mac Mini with MacOS 10.6 failing with a bad boot drive. By jwz.
2554 static struct bsod_state *
2555 mac_diskfail (Display *dpy, Window window)
2557 struct bsod_state *bst = make_bsod_state (dpy, window, "macdisk", "Mac");
2558 int cw = (bst->font->per_char
2559 ? bst->font->per_char['n'-bst->font->min_char_or_byte2].width
2560 : bst->font->min_bounds.width);
2561 int h = bst->font->ascent + bst->font->descent;
2562 int L = (bst->xgwa.width - (cw * 80)) / 2;
2563 int T = (bst->xgwa.height - (h * 10)) / 2;
2565 unsigned long fg = bst->fg;
2566 unsigned long bg = bst->bg;
2567 unsigned long bg2 = get_pixel_resource (dpy, bst->xgwa.colormap,
2574 bst->scroll_p = True;
2576 BSOD_COLOR(bst, bg2, bg);
2577 BSOD_RECT (bst, True, 0, 0, bst->xgwa.width, bst->xgwa.height);
2578 BSOD_PAUSE (bst, 3000000);
2580 BSOD_COLOR(bst, bg, fg);
2581 BSOD_RECT (bst, True, 0, 0, bst->xgwa.width, bst->xgwa.height);
2582 BSOD_COLOR(bst, fg, bg);
2584 BSOD_MARGINS (bst, L, L);
2585 BSOD_MOVETO (bst, L, T);
2587 BSOD_TEXT (bst, LEFT,
2588 "efiboot loaded from device: Acpi(PNP0A03,0)/Pci*1F|2)/Ata"
2589 "(Primary,Slave)/HD(Part\n"
2590 "2,Sig8997E427-064E-4FE7-8CB9-F27A784B232C)\n"
2591 "boot file path: \\System\\Library\\CoreServices\\boot.efi\n"
2592 ".Loading kernel cache file 'System\\Library\\Caches\\"
2593 "com.apple.kext.caches\\Startup\\\n"
2594 "kernelcache_i386.2A14EC2C'\n"
2595 "Loading 'mach_kernel'...\n"
2597 BSOD_CHAR_DELAY (bst, 7000);
2598 BSOD_TEXT (bst, LEFT,
2599 ".....................\n"
2601 BSOD_CHAR_DELAY (bst, 0);
2602 BSOD_TEXT (bst, LEFT,
2603 "root device uuid is 'B62181B4-6755-3C27-BFA1-49A0E053DBD6\n"
2604 "Loading drivers...\n"
2605 "Loading System\\Library\\Caches\\com.apple.kext.caches\\"
2606 "Startup\\Extensions.mkext....\n"
2608 BSOD_CHAR_DELAY (bst, 7000);
2609 BSOD_TEXT (bst, LEFT,
2610 "..............................................................."
2611 ".................\n"
2612 "..............................................................."
2613 ".................\n"
2617 BSOD_RECT (bst, True, 0, 0, bst->xgwa.width, bst->xgwa.height);
2620 BSOD_MARGINS (bst, 0, 0);
2621 BSOD_MOVETO (bst, 0, h);
2623 BSOD_CHAR_DELAY (bst, 0);
2624 BSOD_LINE_DELAY (bst, 5000);
2625 BSOD_TEXT (bst, LEFT,
2628 "Darwin Kernel Version 10.8.9: Tue Jun 7 16:33:36 PDT 2011;"
2629 " root:xnu-1504.15.3~1/RELEASE_I386\n"
2630 "vm_page_bootstrap: 508036 free pages and 16252 wired pages\n"
2631 "standard timeslicing quantum is 10000 us\n"
2632 "mig_table_max_displ = 73\n"
2633 "AppleACPICPU: ProcessorId=0 LocalApicId=0 Enabled\n"
2634 "AppleACPICPU: ProcessorId=1 LocalApicId=1 Enabled\n"
2635 "calling npo_policy_init for Quarantine\n"
2636 "Security policy loaded: Quaantine policy (Quarantine)\n"
2637 "calling npo_policy_init for Sandbox\n"
2638 "Security policy loaded: Seatbelt sandbox policy (Sandbox)\n"
2639 "calling npo_policy_init for TMSafetyNet\n"
2640 "Security policy loaded: Safety net for Time Machine "
2642 "Copyright (c) 1982, 1986, 1989, 1991, 1993\n"
2643 "The Regents of the University of California. All rights "
2646 "MAC Framework successfully initialized\n"
2647 "using 10485 buffer headers and 4096 cluster IO buffer headers\n"
2648 "IOAPIC: Version 0x20 Vectors 64:87\n"
2649 "ACPI: System State [S0 S3 S4 S5] (S3)\n"
2650 "PFM64 0x10000000, 0xf0000000\n"
2651 "[ PCI configuration begin ]\n"
2652 "PCI configuration changed (bridge=1 device=1 cardbus=0)\n"
2653 "[ PCI configuration end, bridges 4 devices 17 ]\n"
2654 "nbinit: done (64 MB memory set for nbuf pool)\n"
2655 "rooting via boot-uuid from /chosen: "
2656 "B62181B4-6755-3C27-BFA1-49A0E053DBD6\n"
2657 "Waiting on <dict ID=\"0\"><key>IOProviderClass</key>"
2658 "<string ID=\"1\">IOResources</string><key>IOResourceMatch</key>"
2659 "<string ID=\"2\">boot-uuid-nedia</string></dict>\n"
2660 "com.apple.AppleFSCCompressionTypeZlib kmod start\n"
2661 "com.apple.AppleFSCCompressionTypeZlib kmod succeeded\n"
2662 "AppleIntelCPUPowerManagementClient: ready\n"
2663 "FireWire (OHCI) Lucent ID 5811 built-in now active, GUID "
2664 "0019e3fffe97f8b4; max speed s400.\n"
2665 "Got boot device = IOService:/AppleACPIPlatformExpert/PCI000/"
2666 "AppleACPIPCI/SATA@1F,2/AppleAHCI/PRI202/IOAHCIDevice@0/"
2667 "AppleAHCIDiskDriver/IOAHCIBlockStorageDevice/"
2668 "IOBlockStorageDriver/ST96812AS Media/IOGUIDPartitionScheme/"
2671 BSOD_PAUSE (bst, 1000000);
2672 BSOD_TEXT (bst, LEFT,
2673 "BSD root: Disk0s, major 14, minor 2\n"
2674 "[Bluetooth::CSRHIDTransition] switchtoHCIMode (legacy)\n"
2675 "[Bluetooth::CSRHIDTransition] transition complete.\n"
2676 "CSRUSBBluetoothHCIController::setupHardware super returned 0\n"
2678 BSOD_PAUSE (bst, 3000000);
2679 BSOD_TEXT (bst, LEFT,
2680 "disk0s2: I/O error.\n"
2681 "0 [Level 3] [ReadUID 0] [Facility com.apple.system.fs] "
2682 "[ErrType IO] [ErrNo 5] [IOType Read] [PBlkNum 48424] "
2683 "[LBlkNum 1362] [FSLogMsgID 2009724291] [FSLogMsgOrder First]\n"
2684 "0 [Level 3] [ReadUID 0] [Facility com.apple.system.fs] "
2685 "[DevNode root_device] [MountPt /] [FSLogMsgID 2009724291] "
2686 "[FSLogMsgOrder Last]\n"
2687 "panic(cpu 0 caller 0x47f5ad): \"Process 1 exec of /sbin/launchd"
2688 " failed, errno 5\\n\"0/SourceCache/xnu/xnu-1504.15.3/bsd/kern/"
2689 "kern_exec.c:3145\n"
2690 "Debugger called: <panic>\n"
2691 "Backtrace (CPU 0), Frame : Return Address (4 potential args "
2693 "0x34bf3e48 : 0x21b837 (0x5dd7fc 0x34bf3e7c 0x223ce1 0x0)\n"
2694 "0x34bf3e98 : 0x47f5ad (0x5cf950 0x831c08 0x5 0x0)\n"
2695 "0x34bf3ef8 : 0x4696d2 (0x4800d20 0x1fe 0x45a69a0 0x80000001)\n"
2696 "0x34bf3f38 : 0x48fee5 (0x46077a8 0x84baa0 0x34bf3f88 "
2698 "0x34bf3f68 : 0x219432 (0x46077a8 0xffffff7f 0x0 0x227c4b)\n"
2699 "0x34bf3fa8 : 0x2aacb4 (0xffffffff 0x1 0x22f8f5 0x227c4b)\n"
2700 "0x34bf3fc8 : 0x2a1976 (0x0 0x0 0x2a17ab 0x4023ef0)\n"
2702 "BSD process name corresponding to current thread: init\n"
2708 "Darwin Kernel version 10.8.0: Tue Jun 7 16:33:36 PDT 2011; "
2709 "root:xnu-1504.15-3~1/RELEASE_I386\n"
2710 "System model name: Macmini1,1 (Mac-F4208EC0)\n"
2712 "System uptime in nanoseconds: 13239332027\n"
2714 BSOD_CURSOR (bst, CURSOR_BLOCK, 500000, 999999);
2716 XClearWindow (dpy, window);
2722 /* 2017 MacOS 10.12 interminable software update, by jwz.
2724 static struct bsod_state *
2725 macx_install (Display *dpy, Window window)
2727 struct bsod_state *bst = make_bsod_state (dpy, window, "macinstall", "MacX");
2730 int pix_w = apple_width;
2731 int pix_h = apple_height;
2736 unsigned long fg = get_pixel_resource (dpy, bst->xgwa.colormap,
2737 "macinstall.foreground",
2739 unsigned long bg = get_pixel_resource (dpy, bst->xgwa.colormap,
2740 "macinstall.background",
2742 unsigned long fg2 = get_pixel_resource (dpy, bst->xgwa.colormap,
2743 "macinstall.barForeground",
2745 unsigned long bg2 = get_pixel_resource (dpy, bst->xgwa.colormap,
2746 "macinstall.barBackground",
2749 int lh = bst->font->ascent + bst->font->descent;
2753 bst->xoff = bst->left_margin = bst->right_margin = 0;
2755 pixmap = XCreatePixmapFromBitmapData (dpy, window, (char *) apple_bits,
2756 apple_width, apple_height,
2757 fg, bg, bst->xgwa.depth);
2758 bst->pixmap = pixmap;
2760 x = (bst->xgwa.width - pix_w) / 2;
2761 y = (bst->xgwa.height) / 2 - pix_h;
2764 XSetLineAttributes (dpy, bst->gc, 1, LineSolid, CapRound, JoinMiter);
2766 BSOD_COLOR(bst, bg, bg);
2767 BSOD_RECT (bst, True, 0, 0, bst->xgwa.width, bst->xgwa.height);
2768 BSOD_COLOR(bst, fg, bg);
2769 BSOD_PIXMAP (bst, 0, 0, pix_w, pix_h, x, y);
2770 y += pix_h * 2 - lh;
2775 if (bh1 < 8) bh1 = 8;
2777 x = (bst->xgwa.width - bw1) / 2;
2778 BSOD_COLOR(bst, fg2, bg);
2779 BSOD_LINE (bst, x, y, x + bw1, y, bh1);
2783 BSOD_COLOR(bst, bg2, bg);
2784 BSOD_LINE (bst, x+1, y, x + bw2, y, bh2);
2786 BSOD_COLOR(bst, fg, bg);
2787 BSOD_LINE (bst, x, y, x + 1, y, bh1);
2789 pct = 5 + (random() % 40);
2790 min = 5 + (random() % 40);
2792 for (i = 0; i < 100; i++) {
2794 min += (random() % 3) - 1; /* sometimes down, mostly up */
2796 if (pct > 90) pct = 90;
2797 BSOD_RECT (bst, True, x, y - bh1/2, bw1 * pct / 100, bh1);
2799 sprintf (buf, " Installing Software Update: about %d minutes. ", min);
2800 bst->y = y + lh * 3;
2801 BSOD_TEXT (bst, CENTER, buf);
2802 BSOD_PAUSE (bst, 1000000);
2809 static struct bsod_state *
2810 macx (Display *dpy, Window window)
2813 switch (1?4:random() % 5) {
2814 case 0: return macx_10_0 (dpy, window); break;
2815 case 1: return macx_10_2 (dpy, window, False); break;
2816 case 2: return macx_10_2 (dpy, window, True); break;
2817 case 3: return mac_diskfail (dpy, window); break;
2818 case 4: return macx_install (dpy, window); break;
2821 # else /* !DO_XPM */
2822 switch (random() % 3) {
2823 case 0: return macx_10_0 (dpy, window); break;
2824 case 1: return macx_install (dpy, window); break;
2825 default: return mac_diskfail (dpy, window); break;
2827 # endif /* !DO_XPM */
2831 #ifndef HAVE_JWXYZ /* #### I have no idea how to implement this without
2832 real plane-masks. I don't think it would look
2833 right if done with alpha-transparency... */
2836 * by Martin Pool <mbp@samba.org>, Feb 2000.
2838 * This is meant to look like the preferred failure mode of NCD
2839 * Xterms. The parameters for choosing what to copy where might not
2840 * be quite right, but it looks about ugly enough.
2842 static struct bsod_state *
2843 blitdamage (Display *dpy, Window window)
2845 struct bsod_state *bst =
2846 make_bsod_state (dpy, window, "blitdamage", "BlitDamage");
2849 int delta_x = 0, delta_y = 0;
2851 int chunk_h, chunk_w;
2856 w = bst->xgwa.width;
2857 h = bst->xgwa.height;
2859 XSetPlaneMask (dpy, bst->gc, random());
2862 chunk_w = w / (random() % 1 + 1);
2863 chunk_h = h / (random() % 1 + 1);
2864 if (random() & 0x1000)
2865 delta_y = random() % 600;
2866 if (!delta_y || (random() & 0x2000))
2867 delta_x = random() % 600;
2874 for (i = 0; i < steps; i++) {
2875 if (x + chunk_w > w)
2880 if (y + chunk_h > h)
2885 BSOD_COPY (bst, src_x, src_y, chunk_w, chunk_h, x, y);
2886 BSOD_PAUSE (bst, 1000);
2891 #endif /* !HAVE_JWXYZ */
2895 * OS/2 panics, by Knut St. Osmundsen <bird-xscreensaver@anduin.net>
2897 * All but one messages are real ones, some are from my test machines
2898 * and system dumps, others are reconstructed from google results.
2899 * Please, don't be to hard if the formatting of the earlier systems
2900 * aren't 100% correct.
2902 static struct bsod_state *
2903 os2 (Display *dpy, Window window)
2905 struct bsod_state *bst = make_bsod_state (dpy, window, "os2", "OS2");
2908 static const char * const os2_panics[] =
2909 { /* OS/2 2.0 trap - details are bogus (CR0++). */
2910 "TRAP 0002 ERRCD=0000 ERACC=**** ERLIM=********\n"
2911 "EAX=7d240a58 EBX=ff202fdc ECX=00064423 EDX=00003624\n"
2912 "ESI=fff3272c EDI=7d240004 EBP=00004a44 FLG=00003202\n"
2913 "CS:EIP=0160:fff702a6 CSACC=c09d CSLIM=ffffffff\n"
2914 "SS:ESP=0030:00004a38 SSACC=1097 SSLIM=00003fff\n"
2915 "DS=0158 DSACC=c0f3 DSLIM=ffffffff CR0=fffffffb\n"
2916 "ES=0158 ESACC=c0f3 ESLIM=ffffffff CR2=1a060014\n"
2917 "FS=0000 FSACC=**** FSLIM=********\n"
2918 "GS=0000 GSACC=**** GSLIM=********\n"
2920 "The system detected an internal processing error\n"
2921 "at location ##0160:fff6453f - 000d:a53f\n"
2925 "Internal revision 6.307, 92/03/01\n"
2928 /* warp 3 (early) */
2929 "TRAP 000e ERRCD=0000 ERACC=**** ERLIM=********\n"
2930 "EAX=ff050c20 EBX=000000bb ECX=ffff00c1 EDx=fff379b8\n"
2931 "ESI=ffe55a3c EDI=00000000 EBP=00004eb8 FLG=00013282\n"
2932 "CS:EIP=0160:fff8dbb8 CSACC=c09b CSLIM=ffffffff\n"
2933 "SS:EIP=0030:00004eb4 SSACC=1097 SSLIM=00003fff\n"
2934 "DS=0158 DSACC=c0f3 DSLIM=ffffffff CR0=8001001b\n"
2935 "ES=0158 DSACC=c0f3 DSLIM=ffffffff CR2=000000c7\n"
2936 "FS=0000 FSACC=**** FSLIM=********\n"
2937 "GS=0000 GSACC=**** GSLIM=********\n"
2939 "The system detected an internal processing error\n"
2940 "at location ##0160:fff66bf0 - 000d:9bf0.\n"
2944 "Internal revision 8.125, 94/02/16\n"
2946 "The system is stopped. Record the location number of the error\n"
2947 "and contact your service representative.\n",
2950 "TRAP 000e ERRCD=0002 ERACC=**** ERLIM=********\n"
2951 "EAX=00000000 EBX=fdef1e0c ECX=00003824 EDX=0000edf9\n"
2952 "ESI=fdf30e80 EDI=fc8b0000 EBP=00005658 FLG=00012246\n"
2953 "CS:EIP=0160:fff8ada3 CSACC=c09b CSLIM=ffffffff\n"
2954 "SS:ESP=0030:000055d4 SSACC=1097 SSLIM=0000480f\n"
2955 "DS=0158 DSACC=c093 DSLIM=ffffffff CR0=8001001b\n"
2956 "ES=0158 ESACC=c093 ESLIM=ffffffff CR2=fc8b0000\n"
2957 "FS=03b8 FSACC=0093 FSLIM=00000023\n"
2958 "GS=0000 GSACC=**** GSLIM=********\n"
2960 "The system detected an internal processing error\n"
2961 "at location ##0160:fff5c364 - 000d:a364.\n"
2965 "Internal revision 8200,94/11/07\n"
2967 "The system is stopped. Record all of the above information and\n"
2968 "contact your service representative.\n",
2971 "TRAP 000d ERRCD=2200 ERACC=1092 ERLIM=00010fff\n"
2972 "EAX=0000802e EBX=fff001c8 ECX=9bd80000 EDX=00000000\n"
2973 "ESI=fff09bd8 EDI=fdeb001b EBP=00000000 FLG=00012012\n"
2974 "CS:EIP=0168:fff480a2 CSACC=c09b CSLIM=ffffffff\n"
2975 "SS:ESP=00e8:00001f32 SSACC=0093 SSLIM=00001fff\n"
2976 "DS=0940 DSACC=0093 DSLIM=00000397 CR0=8001001b\n"
2977 "ES=00e8 ESACC=0093 ESLIM=00001fff CR2=15760008\n"
2978 "FS=0000 FSACC=**** FSLIM=****\n"
2979 "GS=0000 GSACC=**** GSLIM=****\n"
2981 "The system detected an internal processing error\n"
2982 "at location ##0168:fff4b06e - 000e:c06e\n"
2986 "Internal revision 8.259_uni,98/01/07\n"
2988 "The system is stopped. Record all of the above information and\n"
2989 "contact your service representative.\n",
2991 /* Warp 4.52+ - the official r0trap.exe from the debugging classes */
2992 "Exception in module: OS2KRNL\n"
2993 "TRAP 000e ERRCD=0002 ERACC=**** ERLIM=********\n"
2994 "EAX=00000001 EBX=80010002 ECX=ffed4638 EDX=0003f17b\n"
2995 "ESI=00000001 EDI=00000002 EBP=00005408 FLG=00012202\n"
2996 "CS:EIP=0168:fff3cd2e CSACC=c09b CSLIM=ffffffff\n"
2997 "SS:ESP=0030:000053ec SSACC=1097 SSLIM=000044ff\n"
2998 "DS=0160 DSACC=c093 DSLIM=ffffffff CR0=8001001b\n"
2999 "ES=0160 ESACC=c093 ESLIM=ffffffff CR2=00000001\n"
3000 "FS=0000 FSACC=**** FSLIM=********\n"
3001 "GS=0000 GSACC=**** GSLIM=********\n"
3003 "The system detected an internal processing error at\n"
3004 "location ##0168:fff1e3f3 - 000e:c3f3.\n"
3008 "Internal revision 14.097_UNI\n"
3010 "The system is stopped. Record all of the above information and\n"
3011 "contact your service representative.\n",
3013 /* Warp 4.52+, typical JFS problem. */
3014 "Exeption in module: JFS\n"
3015 "TRAP 0003 ERRCD=0000 ERACC=**** ERLIM=********\n"
3016 "EAX=00000000 EBX=ffffff05 ECX=00000001 EDX=f5cd8010\n"
3017 "ESI=000000e6 EDI=000000e7 EBP=f9c7378e FLG=00002296\n"
3018 "CS:EIP=0168:f8df3250 CSACC=c09b CSLIM=ffffffff\n"
3019 "SS:ESP=1550:fdc73778 SSACC=c093 SSLIM=ffffffff\n"
3020 "DS=0160 DSACC=c093 DSLIM=ffffffff CR0=80010016\n"
3021 "ES=0160 ESACC=c093 DSLIM=ffffffff CR2=05318000\n"
3022 "FS=03c0 FSACC=0093 DSLIM=00000023\n"
3023 "GS=0160 GSACC=c093 DSLIM=ffffffff\n"
3025 "The system detected an internal processing error\n"
3026 "at location ##0168:fff1e2ab - 000e:c2ab.\n"
3031 "Internal revision 14.100c_UNI\n"
3033 "The system is stopped. Record all of the above information and\n"
3034 "contact your service representative.\n"
3037 BSOD_TEXT (bst, LEFT, os2_panics[random() % countof(os2_panics)]);
3038 BSOD_CURSOR (bst, CURSOR_LINE, 240000, 999999);
3040 XClearWindow (dpy, window);
3045 /* SPARC Solaris panic. Should look pretty authentic on Solaris boxes.
3046 * Anton Solovyev <solovam@earthlink.net>
3048 static struct bsod_state *
3049 sparc_solaris (Display *dpy, Window window)
3051 struct bsod_state *bst = make_bsod_state (dpy, window, "solaris", "Solaris");
3054 bst->scroll_p = True;
3056 bst->left_margin = bst->right_margin = bst->xgwa.width * 0.07;
3057 bst->top_margin = bst->bottom_margin = bst->xgwa.height * 0.07;
3058 bst->y = bst->top_margin + bst->yoff + bst->font->ascent;
3061 BSOD_PAUSE (bst, 3000000);
3064 BSOD_RECT (bst, True,
3065 bst->left_margin, bst->top_margin,
3066 bst->xgwa.width - bst->left_margin - bst->right_margin,
3067 bst->xgwa.height - bst->top_margin - bst->bottom_margin);
3070 BSOD_TEXT (bst, LEFT,
3071 "BAD TRAP: cpu=0 type=0x31 rp=0x2a10043b5e0 addr=0xf3880 mmu_fsr=0x0\n"
3072 "BAD TRAP occurred in module \"unix\" due to an illegal access to a"
3074 "adb: trap type = 0x31\n"
3076 "pid=307, pc=0x100306e4, sp=0x2a10043ae81, tstate=0x4480001602,"
3078 "g1-g7: 1045b000, 32f, 10079440, 180, 300000ebde8, 0, 30000953a20\n"
3079 "Begin traceback... sp = 2a10043ae81\n"
3080 "Called from 100bd060, fp=2a10043af31, args=f3700 300008cc988 f3880 0"
3082 "Called from 101fe1bc, fp=2a10043b011, args=3000045a240 104465a0"
3083 " 300008e47d0 300008e48fa 300008ae350 300008ae410\n"
3084 "Called from 1007c520, fp=2a10043b0c1, args=300008e4878 300003596e8 0"
3085 " 3000045a320 0 3000045a220\n"
3086 "Called from 1007c498, fp=2a10043b171, args=1045a000 300007847f0 20"
3087 " 3000045a240 1 0\n"
3088 "Called from 1007972c, fp=2a10043b221, args=1 300009517c0 30000951e58 1"
3090 "Called from 10031e10, fp=2a10043b2d1, args=3000095b0c8 0 300009396a8"
3091 " 30000953a20 0 1\n"
3092 "Called from 10000bdd8, fp=ffffffff7ffff1c1, args=0 57 100131480"
3093 " 100131480 10012a6e0 0\n"
3094 "End traceback...\n"
3095 "panic[cpu0]/thread=30000953a20: trap\n"
3096 "syncing file systems...");
3098 BSOD_PAUSE (bst, 3000000);
3100 BSOD_TEXT (bst, LEFT, " 1 done\n");
3101 BSOD_TEXT (bst, LEFT, "dumping to /dev/dsk/c0t0d0s3, offset 26935296\n");
3102 BSOD_PAUSE (bst, 2000000);
3105 for (i = 1; i <= 100; ++i)
3108 sprintf (buf, "\b\b\b\b\b\b\b\b\b\b\b%3d%% done", i);
3109 BSOD_TEXT (bst, LEFT, buf);
3110 BSOD_PAUSE (bst, 100000);
3113 BSOD_TEXT (bst, LEFT,
3114 ": 2803 pages dumped, compression ratio 2.88, dump succeeded\n");
3115 BSOD_PAUSE (bst, 2000000);
3117 BSOD_TEXT (bst, LEFT,
3125 /* Linux panic and fsck, by jwz
3127 static struct bsod_state *
3128 linux_fsck (Display *dpy, Window window)
3130 struct bsod_state *bst = make_bsod_state (dpy, window, "linux", "Linux");
3133 const char *sysname;
3139 const char *linux_panic[] = {
3140 " kernel: Unable to handle kernel paging request at virtual "
3141 "address 0000f0ad\n",
3142 " kernel: printing eip:\n",
3143 " kernel: c01becd7\n",
3144 " kernel: *pde = 00000000\n",
3145 " kernel: Oops: 0000\n",
3146 " kernel: CPU: 0\n",
3147 " kernel: EIP: 0010:[<c01becd7>] Tainted: P \n",
3148 " kernel: EFLAGS: 00010286\n",
3149 " kernel: eax: 0000ff00 ebx: ca6b7e00 ecx: ce1d7a60 edx: ce1d7a60\n",
3150 " kernel: esi: ca6b7ebc edi: 00030000 ebp: d3655ca0 esp: ca6b7e5c\n",
3151 " kernel: ds: 0018 es: 0018 ss: 0018\n",
3152 " kernel: Process crond (pid: 1189, stackpage=ca6b7000)\n",
3153 " kernel: Stack: d3655ca0 ca6b7ebc 00030054 ca6b7e7c c01c1e5b "
3154 "00000287 00000020 c01c1fbf \n",
3156 " kernel: 00005a36 000000dc 000001f4 00000000 00000000 "
3157 "ce046d40 00000001 00000000 \n",
3159 " kernel: ffffffff d3655ca0 d3655b80 00030054 c01bef93 "
3160 "d3655ca0 ca6b7ebc 00030054 \n",
3162 " kernel: Call Trace: [<c01c1e5b>] [<c01c1fbf>] [<c01bef93>] "
3163 "[<c01bf02b>] [<c0134c4f>]\n",
3165 " kernel: [<c0142562>] [<c0114f8c>] [<c0134de3>] [<c010891b>]\n",
3167 " kernel: Code: 2a 00 75 08 8b 44 24 2c 85 c0 74 0c 8b 44 24 58 83 48 18 "
3172 bst->scroll_p = True;
3174 bst->left_margin = bst->right_margin = 10;
3175 bst->top_margin = bst->bottom_margin = 10;
3181 if (uname (&uts) >= 0)
3182 sysname = uts.nodename;
3183 s = strchr (sysname, '.');
3186 # endif /* !HAVE_UNAME */
3189 BSOD_TEXT (bst, LEFT, "waiting for X server to shut down ");
3190 BSOD_PAUSE (bst, 100000);
3191 BSOD_TEXT (bst, LEFT,
3192 "XIO: fatal IO error 2 (broken pipe) on X server \":0.0\"\n"
3193 " after 339471 requests (339471 known processed) "
3194 "with 0 events remaining\n");
3195 BSOD_CHAR_DELAY (bst, 300000);
3196 BSOD_TEXT (bst, LEFT, ".........\n");
3197 BSOD_CHAR_DELAY (bst, 0);
3198 BSOD_TEXT (bst, LEFT,
3199 "xinit: X server slow to shut down, sending KILL signal.\n"
3200 "waiting for server to die ");
3201 BSOD_CHAR_DELAY (bst, 300000);
3202 BSOD_TEXT (bst, LEFT, "...\n");
3203 BSOD_CHAR_DELAY (bst, 0);
3204 BSOD_TEXT (bst, LEFT, "xinit: Can't kill server\n");
3205 BSOD_PAUSE (bst, 2000000);
3207 sprintf (buf, "\n%s Login: ", sysname);
3208 BSOD_TEXT (bst, LEFT, buf);
3209 BSOD_PAUSE (bst, 1000000);
3210 BSOD_TEXT (bst, LEFT,
3212 "Parallelizing fsck version 1.22 (22-Jun-2001)\n"
3213 "e2fsck 1.22, 22-Jun-2001 for EXT2 FS 0.5b, 95/08/09\n"
3214 "Warning! /dev/hda1 is mounted.\n"
3215 "/dev/hda1 contains a file system with errors, check forced.\n");
3216 BSOD_PAUSE (bst, 1000000);
3218 if (0 == random() % 2)
3219 BSOD_TEXT (bst, LEFT,
3220 "Couldn't find ext2 superblock, trying backup blocks...\n"
3221 "The filesystem size (according to the superblock) is 3644739 blocks\n"
3222 "The physical size of the device is 3636706 blocks\n"
3223 "Either the superblock or the partition table is likely to be corrupt!\n"
3225 BSOD_PAUSE (bst, 1000000);
3229 BSOD_TEXT (bst, LEFT, "Pass 1: Checking inodes, blocks, and sizes\n");
3230 BSOD_PAUSE (bst, 2000000);
3232 i = (random() % 60) - 20;
3235 int b = random() % 0xFFFF;
3236 sprintf (buf, "Deleted inode %d has zero dtime. Fix<y>? yes\n\n", b);
3237 BSOD_TEXT (bst, LEFT, buf);
3238 BSOD_PAUSE (bst, 1000);
3241 i = (random() % 40) - 10;
3244 int g = random() % 0xFFFF;
3245 int b = random() % 0xFFFFFFF;
3247 BSOD_PAUSE (bst, 1000000);
3249 sprintf (buf, "Warning: Group %d's copy of the group descriptors "
3250 "has a bad block (%d).\n", g, b);
3251 BSOD_TEXT (bst, LEFT, buf);
3253 b = random() % 0x3FFFFF;
3256 b += random() % 0xFFFF;
3258 "Error reading block %d (Attempt to read block "
3259 "from filesystem resulted in short read) while doing "
3260 "inode scan. Ignore error<y>?",
3262 BSOD_TEXT (bst, LEFT, buf);
3263 BSOD_PAUSE (bst, 10000);
3264 BSOD_TEXT (bst, LEFT, " yes\n\n");
3268 if (0 == (random() % 10))
3270 BSOD_PAUSE (bst, 1000000);
3272 i = 3 + (random() % 10);
3275 BSOD_TEXT (bst, LEFT,
3276 "Could not allocate 256 block(s) for inode table: "
3277 "No space left on device\n");
3278 BSOD_PAUSE (bst, 1000);
3280 BSOD_TEXT (bst, LEFT, "Restarting e2fsck from the beginning...\n");
3281 BSOD_PAUSE (bst, 2000000);
3286 i = (random() % 20) - 5;
3289 BSOD_PAUSE (bst, 1000000);
3293 int j = 5 + (random() % 10);
3294 int w = random() % 4;
3298 int b = random() % 0xFFFFF;
3299 int g = random() % 0xFFF;
3301 if (0 == (random() % 10))
3303 else if (0 == (random() % 10))
3308 "Inode table for group %d not in group. (block %d)\n"
3309 "WARNING: SEVERE DATA LOSS POSSIBLE.\n"
3314 "Block bitmap for group %d not in group. (block %d)\n"
3319 "Inode bitmap %d for group %d not in group.\n"
3322 else /* if (w == 3) */
3324 "Bad block %d in group %d's inode table.\n"
3325 "WARNING: SEVERE DATA LOSS POSSIBLE.\n"
3329 BSOD_TEXT (bst, LEFT, buf);
3330 BSOD_TEXT (bst, LEFT, " yes\n\n");
3331 BSOD_PAUSE (bst, 1000);
3336 if (0 == random() % 10) goto PANIC;
3337 BSOD_TEXT (bst, LEFT, "Pass 2: Checking directory structure\n");
3338 BSOD_PAUSE (bst, 2000000);
3340 i = (random() % 20) - 5;
3343 int n = random() % 0xFFFFF;
3344 int o = random() % 0xFFF;
3345 sprintf (buf, "Directory inode %d, block 0, offset %d: "
3346 "directory corrupted\n"
3349 BSOD_TEXT (bst, LEFT, buf);
3350 BSOD_PAUSE (bst, 1000);
3351 BSOD_TEXT (bst, LEFT, " yes\n\n");
3353 if (0 == (random() % 100))
3355 sprintf (buf, "Missing '.' in directory inode %d.\nFix<y>?", n);
3356 BSOD_TEXT (bst, LEFT, buf);
3357 BSOD_PAUSE (bst, 1000);
3358 BSOD_TEXT (bst, LEFT, " yes\n\n");
3362 if (0 == random() % 10)
3365 BSOD_TEXT (bst, LEFT,
3366 "Pass 3: Checking directory connectivity\n"
3367 "/lost+found not found. Create? yes\n");
3368 BSOD_PAUSE (bst, 2000000);
3370 /* Unconnected directory inode 4949 (/var/spool/squid/06/???)
3371 Connect to /lost+found<y>? yes
3373 '..' in /var/spool/squid/06/08 (20351) is <The NULL inode> (0), should be
3374 /var/spool/squid/06 (20350).
3377 Unconnected directory inode 128337 (/var/spool/squid/06/???)
3378 Connect to /lost+found<y>? yes
3382 if (0 == random() % 10) goto PANIC;
3383 BSOD_TEXT (bst, LEFT, "Pass 4: Checking reference counts\n");
3384 BSOD_PAUSE (bst, 2000000);
3386 /* Inode 2 ref count is 19, should be 20. Fix<y>? yes
3388 Inode 4949 ref count is 3, should be 2. Fix<y>? yes
3392 Inode 128336 ref count is 3, should be 2. Fix<y>? yes
3394 Inode 128337 ref count is 3, should be 2. Fix<y>? yes
3399 if (0 == random() % 10) goto PANIC;
3400 BSOD_TEXT (bst, LEFT, "Pass 5: Checking group summary information\n");
3401 BSOD_PAUSE (bst, 2000000);
3403 i = (random() % 200) - 50;
3406 BSOD_TEXT (bst, LEFT, "Block bitmap differences: ");
3409 sprintf (buf, " %d", -(random() % 0xFFF));
3410 BSOD_TEXT (bst, LEFT, buf);
3411 BSOD_PAUSE (bst, 1000);
3413 BSOD_TEXT (bst, LEFT, "\nFix? yes\n\n");
3417 i = (random() % 100) - 50;
3420 BSOD_TEXT (bst, LEFT, "Inode bitmap differences: ");
3423 sprintf (buf, " %d", -(random() % 0xFFF));
3424 BSOD_TEXT (bst, LEFT, buf);
3425 BSOD_PAUSE (bst, 1000);
3427 BSOD_TEXT (bst, LEFT, "\nFix? yes\n\n");
3430 i = (random() % 20) - 5;
3433 int g = random() % 0xFFFF;
3434 int c = random() % 0xFFFF;
3436 "Free blocks count wrong for group #0 (%d, counted=%d).\nFix? ",
3438 BSOD_TEXT (bst, LEFT, buf);
3439 BSOD_PAUSE (bst, 1000);
3440 BSOD_TEXT (bst, LEFT, " yes\n\n");
3446 BSOD_TEXT (bst, LEFT, "\n\n");
3447 while (linux_panic[i])
3449 time_t t = time ((time_t *) 0);
3450 struct tm *tm = localtime (&t);
3453 if (*linux_panic[i])
3455 strftime (prefix, sizeof(prefix)-1, "%b %d %H:%M:%S ", tm);
3456 BSOD_TEXT (bst, LEFT, prefix);
3457 BSOD_TEXT (bst, LEFT, sysname);
3458 BSOD_TEXT (bst, LEFT, linux_panic[i]);
3459 BSOD_PAUSE (bst, 1000);
3462 BSOD_PAUSE (bst, 300000);
3466 BSOD_PAUSE (bst, 4000000);
3468 XClearWindow(dpy, window);
3474 * Linux (hppa) panic, by Stuart Brady <sdbrady@ntlworld.com>
3475 * Output courtesy of M. Grabert
3477 static struct bsod_state *
3478 hppa_linux (Display *dpy, Window window)
3480 struct bsod_state *bst =
3481 make_bsod_state (dpy, window, "hppalinux", "HPPALinux");
3484 const char *release, *sysname, *gccversion, *version;
3485 long int linedelay = 0;
3492 struct { long int delay; const char *string; } linux_panic[] =
3493 {{ 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"
3494 "\n\n\n\n\n\n\n\n\n\n\n\n\n" },
3495 { 0, "Linux version %s (root@%s) (gcc version %s) %s\n" },
3496 { 4000, "FP[0] enabled: Rev 1 Model 16\n" },
3497 { 10, "The 32-bit Kernel has started...\n" },
3498 { -1, "Determining PDC firmware type: System Map.\n" },
3499 { -1, "model 00005bb0 00000481 00000000 00000002 7778df9f 100000f0 "
3500 "00000008 000000b2 000000b2\n" },
3501 { -1, "vers 00000203\n" },
3502 { -1, "CPUID vers 17 rev 7 (0x00000227)\n" },
3503 { -1, "capabilities 0x3\n" },
3504 { -1, "model 9000/785/C3000\n" },
3505 { -1, "Total Memory: 1024 Mb\n" },
3506 { -1, "On node 0 totalpages: 262144\n" },
3507 { -1, " DMA zone: 262144 pages, LIFO batch:16\n" },
3508 { -1, " Normal zone: 0 pages, LIFO batch:1\n" },
3509 { -1, " HighMem zone: 0 pages, LIFO batch:1\n" },
3510 { -1, "LCD display at f05d0008,f05d0000 registered\n" },
3511 { -1, "Building zonelist for node : 0\n" },
3512 { -1, "Kernel command line: ide=nodma root=/dev/sda3 HOME=/ ip=off "
3513 "console=ttyS0 TERM=vt102 palo_kernel=2/vmlinux-2.6\n" },
3514 { -1, "ide_setup: ide=nodmaIDE: Prevented DMA\n" },
3515 { -1, "PID hash table entries: 16 (order 4: 128 bytes)\n" },
3516 {500, "Console: colour dummy device 160x64\n" },
3517 { 10, "Memory: 1034036k available\n" },
3518 { -1, "Calibrating delay loop... 796.67 BogoMIPS\n" },
3519 { -1, "Dentry cache hash table entries: 131072 (order: 7, 524288 "
3521 { -1, "Inode-cache hash table entries: 65536 (order: 6, 262144 "
3523 { -1, "Mount-cache hash table entries: 512 (order: 0, 4096 bytes)\n" },
3524 { -1, "POSIX conformance testing by UNIFIX\n" },
3525 { -1, "NET: Registered protocol family 16\n" },
3526 { 100, "Searching for devices...\n" },
3527 { 25, "Found devices:\n" },
3528 { 10, "1. Astro BC Runway Port at 0xfed00000 [10] "
3529 "{ 12, 0x0, 0x582, 0x0000b }\n" },
3530 { -1, "2. Elroy PCI Bridge at 0xfed30000 [10/0] "
3531 "{ 13, 0x0, 0x782, 0x0000a }\n" },
3532 { -1, "3. Elroy PCI Bridge at 0xfed32000 [10/1] "
3533 "{ 13, 0x0, 0x782, 0x0000a }\n" },
3534 { -1, "4. Elroy PCI Bridge at 0xfed38000 [10/4] "
3535 "{ 13, 0x0, 0x782, 0x0000a }\n" },
3536 { -1, "5. Elroy PCI Bridge at 0xfed3c000 [10/6] "
3537 "{ 13, 0x0, 0x782, 0x0000a }\n" },
3538 { -1, "6. AllegroHigh W at 0xfffa0000 [32] "
3539 "{ 0, 0x0, 0x5bb, 0x00004 }\n" },
3540 { -1, "7. Memory at 0xfed10200 [49] { 1, 0x0, 0x086, 0x00009 }\n" },
3541 { -1, "CPU(s): 1 x PA8500 (PCX-W) at 400.000000 MHz\n" },
3542 { -1, "SBA found Astro 2.1 at 0xfed00000\n" },
3543 { -1, "lba version TR2.1 (0x2) found at 0xfed30000\n" },
3544 { -1, "lba version TR2.1 (0x2) found at 0xfed32000\n" },
3545 { -1, "lba version TR2.1 (0x2) found at 0xfed38000\n" },
3546 { -1, "lba version TR2.1 (0x2) found at 0xfed3c000\n" },
3547 { 100, "SCSI subsystem initialized\n" },
3548 { 10, "drivers/usb/core/usb.c: registered new driver usbfs\n" },
3549 { -1, "drivers/usb/core/usb.c: registered new driver hub\n" },
3550 { -1, "ikconfig 0.7 with /proc/config*\n" },
3551 { -1, "Initializing Cryptographic API\n" },
3552 { 250, "SuperIO: probe of 0000:00:0e.0 failed with error -1\n" },
3553 { 20, "SuperIO: Found NS87560 Legacy I/O device at 0000:00:0e.1 "
3555 { -1, "SuperIO: Serial port 1 at 0x3f8\n" },
3556 { -1, "SuperIO: Serial port 2 at 0x2f8\n" },
3557 { -1, "SuperIO: Parallel port at 0x378\n" },
3558 { -1, "SuperIO: Floppy controller at 0x3f0\n" },
3559 { -1, "SuperIO: ACPI at 0x7e0\n" },
3560 { -1, "SuperIO: USB regulator enabled\n" },
3561 { -1, "SuperIO: probe of 0000:00:0e.2 failed with error -1\n" },
3562 { -1, "Soft power switch enabled, polling @ 0xf0400804.\n" },
3563 { -1, "pty: 256 Unix98 ptys configured\n" },
3564 { -1, "Generic RTC Driver v1.07\n" },
3565 { -1, "Serial: 8250/16550 driver $" "Revision: 1.100 $ 13 ports, "
3566 "IRQ sharing disabled\n" },
3567 { -1, "ttyS0 at I/O 0x3f8 (irq = 0) is a 16550A\n" },
3568 { -1, "ttyS1 at I/O 0x2f8 (irq = 0) is a 16550A\n" },
3569 { -1, "Linux Tulip driver version 1.1.13 (May 11, 2002)\n" },
3570 { 150, "tulip0: no phy info, aborting mtable build\n" },
3571 { 10, "tulip0: MII transceiver #1 config 1000 status 782d "
3572 "advertising 01e1.\n" },
3573 { -1, "eth0: Digital DS21143 Tulip rev 65 at 0xf4008000, "
3574 "00:10:83:F9:B4:34, IRQ 66.\n" },
3575 { -1, "Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2\n" },
3576 { -1, "ide: Assuming 33MHz system bus speed for PIO modes; "
3577 "override with idebus=xx\n" },
3578 { 100, "SiI680: IDE controller at PCI slot 0000:01:06.0\n" },
3579 { 10, "SiI680: chipset revision 2\n" },
3580 { -1, "SiI680: BASE CLOCK == 133\n" },
3581 { -1, "SiI680: 100% native mode on irq 128\n" },
3582 { -1, " ide0: MMIO-DMA at 0xf4800000-0xf4800007 -- "
3583 "Error, MMIO ports already in use.\n" },
3584 { -1, " ide1: MMIO-DMA at 0xf4800008-0xf480000f -- "
3585 "Error, MMIO ports already in use.\n" },
3586 { 5, "hda: TS130220A2, ATA DISK drive\n" },
3587 { -1, " _______________________________\n" },
3588 { -1, " < Your System ate a SPARC! Gah! >\n" },
3589 { -1, " -------------------------------\n" },
3590 { -1, " \\ ^__^\n" },
3591 { -1, " \\ (xx)\\_______\n" },
3592 { -1, " (__)\\ )\\/\\\n" },
3593 { -1, " U ||----w |\n" },
3595 { -1, "swapper (pid 1): Breakpoint (code 0)\n" },
3597 { -1, " YZrvWESTHLNXBCVMcbcbcbcbOGFRQPDI\n" },
3598 { -1, "PSW: 00000000000001001111111100001111 Not tainted\n" },
3599 { -1, "r00-03 4d6f6f21 1032f010 10208f34 103fc2e0\n" },
3600 { -1, "r04-07 103fc230 00000001 00000001 0000000f\n" },
3601 { -1, "r08-11 103454f8 000f41fa 372d3980 103ee404\n" },
3602 { -1, "r12-15 3ccbf700 10344810 103ee010 f0400004\n" },
3603 { -1, "r16-19 f00008c4 f000017c f0000174 00000000\n" },
3604 { -1, "r20-23 fed32840 fed32800 00000000 0000000a\n" },
3605 { -1, "r24-27 0000ffa0 000000ff 103fc2e0 10326010\n" },
3606 { -1, "r28-31 00000000 00061a80 4ff98340 10208f34\n" },
3607 { -1, "sr0-3 00000000 00000000 00000000 00000000\n" },
3608 { -1, "sr4-7 00000000 00000000 00000000 00000000\n" },
3610 { -1, "IASQ: 00000000 00000000 IAOQ: 00000000 00000004\n" },
3611 { -1, " IIR: 00000000 ISR: 00000000 IOR: 00000000\n" },
3612 { -1, " CPU: 0 CR30: 4ff98000 CR31: 1037c000\n" },
3613 { -1, " ORIG_R28: 55555555\n" },
3614 { -1, " IAOQ[0]: 0x0\n" },
3615 { -1, " IAOQ[1]: 0x4\n" },
3616 { -1, " RP(r2): probe_hwif+0x218/0x44c\n" },
3617 { -1, "Kernel panic: Attempted to kill init!\n" },
3620 bst->scroll_p = True;
3622 bst->left_margin = bst->right_margin = 10;
3623 bst->top_margin = bst->bottom_margin = 10;
3625 release = "2.6.0-test11-pa2";
3627 version = "#2 Mon Dec 8 06:09:27 GMT 2003";
3631 if (uname (&uts) >= 0)
3633 sysname = uts.nodename;
3634 if (!strcmp (uts.sysname, "Linux"))
3636 release = uts.release;
3637 version = uts.version;
3640 s = strchr (sysname, '.');
3643 # endif /* !HAVE_UNAME */
3645 # if (defined (__GNUC__) && defined (__VERSION__))
3646 gccversion = __VERSION__;
3647 # else /* !(defined (__GNUC__) && defined (__VERSION__)) */
3648 gccversion = "3.3.2 (Debian)";
3649 # endif /* !(defined (__GNUC__) && defined (__VERSION__)) */
3651 /* Insert current host name into banner on line 2 */
3653 snprintf (ss, 1024, linux_panic[1].string,
3654 release, sysname, gccversion, version);
3655 linux_panic[1].string = ss;
3658 BSOD_PAUSE (bst, 100000);
3659 while (linux_panic[i].string)
3661 if (linux_panic[i].delay != -1)
3662 linedelay = linux_panic[i].delay * 1000;
3663 BSOD_PAUSE (bst, linedelay);
3664 BSOD_TEXT (bst, LEFT, linux_panic[i].string);
3668 bst->y = bst->xgwa.height - bst->yoff
3669 - bst->font->ascent - bst->font->descent;
3671 XClearWindow(dpy, window);
3676 /* VMS by jwz (text sent by Roland Barmettler <roli@barmettler.net>)
3678 static struct bsod_state *
3679 vms (Display *dpy, Window window)
3681 struct bsod_state *bst = make_bsod_state (dpy, window, "vms", "VMS");
3683 const char *sysname;
3685 int dot_delay = 40000;
3686 int chunk_delay = 500000;
3696 const char *lines[] = {
3697 "%CNXMAN, Lost connection to system #\n"
3698 "%SHADOW-I-VOLPROC, DSA0: shadow master has changed. "
3699 "Dump file WILL be written if system crashes.\n"
3703 "%CNXMAN, Quorum lost, blocking activity\n"
3704 "%CNXMAN, Timed-out lost connection to system #\n"
3705 "%CNXMAN, Timed-out lost connection to system #\n"
3706 "%CNXMAN, Timed-out lost connection to system #\n"
3707 "%CNXMAN, Proposing reconfiguration of the VMScluster\n",
3710 "%CNXMAN, Removed from VMScluster system #\n"
3711 "%CNXMAN, Removed from VMScluster system #\n"
3712 "%CNXMAN, Removed from VMScluster system #\n"
3713 "%CNXMAN, Completing VMScluster state transition\n",
3716 "**** OpenVMS (TM) Alpha Operating system V7.3-1 - BUGCHECK ****\n"
3718 "** Bugcheck code = 000005DC: CLUEXIT, Node voluntarily exiting "
3720 "** Crash CPU: 00 Primary CPU: 00 Active CPUs: 00000001\n"
3721 "** Current Process = NULL\n"
3722 "** Current PSB ID = 00000001\n"
3725 "** Dumping error log buffers to HBVS unit 0\n"
3726 "**** Unable to dump error log buffers to remaining shadow set members\n"
3727 "** Error log buffers not dumped to HBVS unit 200\n"
3729 "** Dumping memory to HBVS unit 0\n"
3730 "**** Starting compressed selective memory dump at #...\n",
3735 "**** Memory dump complete - not all processes or global pages saved\n",
3743 "HALT instruction executed\n"
3744 "PC = ffffffff800c3884\n",
3750 "resetting all I/O buses\n"
3757 bst->scroll_p = True;
3759 bst->left_margin = bst->right_margin = 10;
3760 bst->top_margin = bst->bottom_margin = 10;
3765 if (uname (&uts) >= 0)
3766 sysname = uts.nodename;
3767 s = strchr (sysname, '.');
3770 # endif /* !HAVE_UNAME */
3772 args[0] = malloc (strlen(sysname) + 7);
3773 strcpy (args[0], sysname);
3776 /* Pick three numbers, 1-9, no overlaps. */
3777 ids[0] = 1 + (random() % 9);
3778 do { ids[1] = 1 + (random() % 9); } while (ids[1]==ids[0]);
3779 do { ids[2] = 1 + (random() % 9); } while (ids[2]==ids[0] || ids[2]==ids[1]);
3781 i = strlen(args[0])-1;
3783 args[0][i] = '0' + ids[0];
3786 for (s = args[0]; *s; s++)
3787 if (isalpha(*s)) *s = toupper (*s);
3789 args[1] = strdup (args[0]);
3790 args[2] = strdup (args[0]); args[2][i] = '0' + ids[1];
3791 args[3] = strdup (args[0]); args[3][i] = '0' + ids[2];
3793 args[4] = strdup (args[1]);
3794 args[5] = strdup (args[2]);
3795 args[6] = strdup (args[3]);
3798 time_t t = time ((time_t *) 0);
3799 struct tm *tm = localtime (&t);
3800 args[7] = malloc (30);
3801 strftime (args[7], 29, "%d-%b-%Y %H:%M", tm);
3802 for (s = args[7]; *s; s++)
3803 if (isalpha(*s)) *s = toupper (*s);
3807 for (i = 0; i < countof(lines); i++)
3809 const char *fmt = lines[i];
3810 if (! strcmp (fmt, "..."))
3812 int steps = 180 + (random() % 60);
3813 while (--steps >= 0)
3815 BSOD_TEXT (bst, LEFT, ".");
3816 BSOD_PAUSE (bst, dot_delay);
3821 char *fmt2 = malloc (strlen (fmt) * 2 + 1);
3822 for (s = (char *) fmt, s1 = fmt2; *s; s++)
3826 strcpy (s1, args[arg_count++]);
3833 BSOD_CHAR_DELAY (bst, char_delay);
3834 BSOD_TEXT (bst, LEFT, fmt2);
3836 BSOD_CHAR_DELAY (bst, 0);
3837 BSOD_PAUSE (bst, chunk_delay);
3841 for (i = 0; i < countof (args); i++)
3844 XClearWindow(dpy, window);
3849 /* HVX (formerly GCOS6) and TPS6 crash
3850 by Brian Garratt <brian-m.garratt@bull.co.uk>
3852 GCOS6 is a Unix-like operating system developed by Honeywell in the
3853 1970s in collaboration with MIT and AT&T (who called their version
3854 UNIX). Both are very much like MULTICS which Honeywell got from GE.
3856 HVX ("High-performance Virtual System on Unix") is an AIX application
3857 which emulates GCOS6 hardware on RS6000-like machines.
3859 static struct bsod_state *
3860 hvx (Display *dpy, Window window)
3862 struct bsod_state *bst = make_bsod_state (dpy, window, "hvx", "HVX");
3864 bst->scroll_p = True;
3866 bst->y = bst->xgwa.height - bst->bottom_margin - bst->yoff
3867 - bst->font->ascent;
3869 BSOD_CHAR_DELAY (bst, 10000);
3870 BSOD_TEXT (bst, LEFT,
3871 "(TP) Trap no E Effective address 00000000 Instruction D7DE\n"
3872 "(TP) Registers :\n"
3873 "(TP) B1 -> B7 03801B02 00000000 03880D45 038BABDB 0388AFFD"
3874 " 0389B3F8 03972317\n"
3875 "(TP) R1 -> R7 0001 0007 F10F 090F 0020 0106 0272\n"
3876 "(TP) P I Z M1 0388A18B 3232 0000 FF00\n"
3877 "(TP) Program counter is at offset 0028 from string YTPAD\n"
3878 "(TP) User id of task which trapped is LT 626\n"
3881 BSOD_PAUSE (bst, 1000000);
3883 BSOD_CHAR_DELAY (bst, 100000);
3884 BSOD_TEXT (bst, LEFT, " TP CLOSE ALL");
3886 BSOD_CHAR_DELAY (bst, 10000);
3887 BSOD_TEXT (bst, LEFT, "\n(TP)?\n");
3888 BSOD_PAUSE (bst, 1000000);
3890 BSOD_CHAR_DELAY (bst, 100000);
3891 BSOD_TEXT (bst, LEFT, " TP ABORT -LT ALL");
3893 BSOD_CHAR_DELAY (bst, 10000);
3894 BSOD_TEXT (bst, LEFT, "\n(TP)?\n");
3895 BSOD_PAUSE (bst, 1000000);
3897 BSOD_CHAR_DELAY (bst, 100000);
3898 BSOD_TEXT (bst, LEFT, " TP STOP KILL");
3900 BSOD_CHAR_DELAY (bst, 10000);
3901 BSOD_TEXT (bst, LEFT,
3904 "Core dumps initiated for selected HVX processes ...\n"
3905 "Core dumps complete.\n"
3906 "Fri Jul 19 15:53:09 2002\n"
3907 "Live registers for cp 0:\n"
3908 " P = 7de3 IW=0000 I=32 CI=30000000 S=80006013"
3909 " IV=aa0 Level=13\n"
3910 " R1-7 = 1f 913 13 4 8 0 0\n"
3911 " B1-7 = 64e71b a93 50e 64e73c 6c2c 7000 b54\n"
3912 "Memory dump starting to file /var/hvx/dp01/diag/Level2 ...\n"
3913 "Memory dump complete.\n"
3916 XClearWindow(dpy, window);
3921 /* HPUX panic, by Tobias Klausmann <klausman@schwarzvogel.de>
3923 static struct bsod_state *
3924 hpux (Display *dpy, Window window)
3926 struct bsod_state *bst = make_bsod_state (dpy, window, "hpux", "HPUX");
3927 const char *sysname;
3933 bst->scroll_p = True;
3934 bst->y = bst->xgwa.height - bst->bottom_margin - bst->yoff
3935 - bst->font->ascent;
3941 if (uname (&uts) >= 0)
3942 sysname = uts.nodename;
3943 s = strchr (sysname, '.');
3946 # endif /* !HAVE_UNAME */
3948 BSOD_TEXT (bst, LEFT,
3952 sprintf (buf, "%.100s [HP Release B.11.00] (see /etc/issue)\n", sysname);
3953 BSOD_TEXT (bst, LEFT, buf);
3954 BSOD_PAUSE (bst, 1000000);
3955 BSOD_TEXT (bst, LEFT,
3958 " ******* Unexpected HPMC/TOC. Processor HPA FFFFFFFF'"
3959 "FFFA0000 *******\n"
3960 " GENERAL REGISTERS:\n"
3961 "r00/03 00000000'00000000 00000000'00000000 00000000'00000000 00000000'"
3963 "r04/07 00000000'00000001 00000000'0126E328 00000000'00000000 00000000'"
3965 "r08/11 00000000'00000000 00000000'0198CFC0 00000000'000476FE 00000000'"
3967 "r12/15 00000000'40013EE8 00000000'08000080 00000000'4002530C 00000000'"
3969 "r16/19 00000000'7F7F2A00 00000000'00000001 00000000'00000000 00000000'"
3971 "r20/23 00000000'006C8048 00000000'00000001 00000000'00000000 00000000'"
3973 "r24/27 00000000'00000000 00000000'00000000 00000000'00000000 00000000'"
3975 "r28/31 00000000'00000000 00000000'007DD628 00000000'0199F2B0 00000000'"
3977 " CONTROL REGISTERS:\n"
3978 "sr0/3 00000000'0F3B4000 00000000'0C2A2000 00000000'016FF800 00000000'"
3980 "sr4/7 00000000'00000000 00000000'016FF800 00000000'0DBF1400 00000000'"
3982 "pcq = 00000000'00000000.00000000'00104950 00000000'00000000.00000000'"
3984 "isr = 00000000'10240006 ior = 00000000'67D9E220 iir = 08000240 rctr = "
3987 "pid reg cr8/cr9 00007700'0000B3A9 00000000'0000C5D8\n"
3988 "pid reg cr12/cr13 00000000'00000000 00000000'00000000\n"
3989 "ipsw = 000000FF'080CFF1F iva = 00000000'0002C000 sar = 3A ccr = C0\n"
3990 "tr0/3 00000000'006C76C0 00000000'00000001 00000000'00000000 00000000'"
3992 "tr4/7 00000000'03790000 0000000C'4FB68340 00000000'C07EE13F 00000000'"
3994 "eiem = FFFFFFF0'FFFFFFFF eirr = 80000000'00000000 itmr = 0000000C'"
3996 "cr1/4 00000000'00000000 00000000'00000000 00000000'00000000 00000000'"
3998 "cr5/7 00000000'00000000 00000000'00000000 00000000'"
4000 " MACHINE CHECK PARAMETERS:\n"
4001 "Check Type = 00000000 CPU STATE = 9E000001 Cache Check = 00000000\n"
4002 "TLB Check = 00000000 Bus Check = 00000000 PIM State = ? SIU "
4003 "Status = ????????\n"
4004 "Assists = 00000000 Processor = 00000000\n"
4005 "Slave Addr = 00000000'00000000 Master Addr = 00000000'00000000\n"
4008 "TOC, pcsq.pcoq = 0'0.0'104950 , isr.ior = 0'10240006.0'67d9e220\n"
4009 "@(#)B2352B/9245XB HP-UX (B.11.00) #1: Wed Nov 5 22:38:19 PST 1997\n"
4010 "Transfer of control: (display==0xd904, flags==0x0)\n"
4014 "*** A system crash has occurred. (See the above messages for details.)\n"
4015 "*** The system is now preparing to dump physical memory to disk, for use\n"
4016 "*** in debugging the crash.\n"
4018 "*** The dump will be a SELECTIVE dump: 40 of 256 megabytes.\n"
4019 "*** To change this dump type, press any key within 10 seconds.\n"
4020 "*** Proceeding with selective dump.\n"
4022 "*** The dump may be aborted at any time by pressing ESC.\n");
4028 for (i = 0; i <= steps; i++)
4030 if (i > steps) i = steps;
4032 "*** Dumping: %3d%% complete (%d of 40 MB) (device 64:0x2)\r",
4035 BSOD_TEXT (bst, LEFT, buf);
4036 BSOD_PAUSE (bst, 1500000);
4040 BSOD_TEXT (bst, LEFT, "\n*** System rebooting.\n");
4042 XClearWindow(dpy, window);
4047 /* IBM OS/390 aka MVS aka z/OS.
4048 Text from Dan Espen <dane@mk.telcordia.com>.
4049 Apparently this isn't actually a crash, just a random session...
4052 static struct bsod_state *
4053 os390 (Display *dpy, Window window)
4055 struct bsod_state *bst = make_bsod_state (dpy, window, "os390", "OS390");
4057 bst->scroll_p = True;
4058 bst->y = bst->xgwa.height - bst->bottom_margin - bst->yoff
4059 - bst->font->ascent;
4061 BSOD_LINE_DELAY (bst, 100000);
4062 BSOD_TEXT (bst, LEFT,
4063 "\n*** System rebooting.\n"
4064 "* ISPF Subtask abend *\n"
4065 "SPF ENDED DUE TO ERROR+\n"
4068 "IEA995I SYMPTOM DUMP OUTPUT\n"
4069 " USER COMPLETION CODE=0222\n"
4070 " TIME=23.00.51 SEQ=03210 CPU=0000 ASID=00AE\n"
4071 " PSW AT TIME OF ERROR 078D1000 859DAF18 ILC 2 INTC 0D\n"
4072 " NO ACTIVE MODULE FOUND\n"
4074 " DATA AT PSW 059DAF12 - 00181610 0A0D9180 70644710\n"
4075 " AR/GR 0: 00000000/80000000 1: 00000000/800000DE\n"
4076 " 2: 00000000/196504DC 3: 00000000/00037A78\n"
4077 " 4: 00000000/00037B78 5: 00000000/0003351C\n"
4078 " 6: 00000000/0000F0AD 7: 00000000/00012000\n"
4079 " 8: 00000000/059DAF10 9: 00000000/0002D098\n"
4080 " A: 00000000/059D9F10 B: 00000000/059D8F10\n"
4081 " C: 00000000/859D7F10 D: 00000000/00032D60\n"
4082 " E: 00000000/00033005 F: 01000002/00000041\n"
4083 " END OF SYMPTOM DUMP\n"
4084 "ISPS014 - ** Logical screen request failed - abend 0000DE **\n"
4085 "ISPS015 - ** Contact your system programmer or dialog developer.**\n"
4086 "*** ISPF Main task abend ***\n"
4087 "IEA995I SYMPTOM DUMP OUTPUT\n"
4088 " USER COMPLETION CODE=0222\n"
4089 " TIME=23.00.52 SEQ=03211 CPU=0000 ASID=00AE\n"
4090 " PSW AT TIME OF ERROR 078D1000 8585713C ILC 2 INTC 0D\n"
4091 " ACTIVE LOAD MODULE ADDRESS=05855000 OFFSET=0000213C\n"
4093 " DATA AT PSW 05857136 - 00181610 0A0D9180 D3304770\n"
4094 " GR 0: 80000000 1: 800000DE\n"
4095 " 2: 00015260 3: 00000038\n"
4096 " 4: 00012508 5: 00000000\n"
4097 " 6: 000173AC 7: FFFFFFF8\n"
4098 " 8: 05858000 9: 00012CA0\n"
4099 " A: 05857000 B: 05856000\n"
4100 " C: 85855000 D: 00017020\n"
4101 " E: 85857104 F: 00000000\n"
4102 " END OF SYMPTOM DUMP\n"
4105 BSOD_CURSOR (bst, CURSOR_LINE, 240000, 999999);
4107 XClearWindow(dpy, window);
4112 /* Compaq Tru64 Unix panic, by jwz as described by
4113 Tobias Klausmann <klausman@schwarzvogel.de>
4115 static struct bsod_state *
4116 tru64 (Display *dpy, Window window)
4118 struct bsod_state *bst = make_bsod_state (dpy, window, "tru64", "Tru64");
4119 const char *sysname;
4125 bst->scroll_p = True;
4126 bst->y = bst->xgwa.height - bst->bottom_margin - bst->yoff
4127 - bst->font->ascent;
4129 sysname = "127.0.0.1";
4132 if (uname (&uts) >= 0)
4133 sysname = uts.nodename;
4135 # endif /* !HAVE_UNAME */
4138 "Compaq Tru64 UNIX V5.1B (Rev. 2650) (%.100s) console\n"
4142 BSOD_TEXT (bst, LEFT, buf);
4143 BSOD_PAUSE (bst, 6000000);
4145 BSOD_TEXT (bst, LEFT,
4146 "panic (cpu 0): trap: illegal instruction\n"
4147 "kernel inst fault=gentrap, ps=0x5, pc=0xfffffc0000593878, inst=0xaa\n"
4148 "kernel inst fault=gentrap, ps=0x5, pc=0xfffffc0000593878, inst=0xaa\n"
4150 "DUMP: blocks available: 1571600\n"
4151 "DUMP: blocks wanted: 100802 (partial compressed dump) [OKAY]\n"
4152 "DUMP: Device Disk Blocks Available\n"
4153 "DUMP: ------ ---------------------\n"
4154 "DUMP: 0x1300023 1182795 - 1571597 (of 1571598) [primary swap]\n"
4155 "DUMP.prom: Open: dev 0x5100041, block 2102016: SCSI 0 11 0 2 200 0 0\n"
4156 "DUMP: Writing header... [1024 bytes at dev 0x1300023, block 1571598]\n"
4157 "DUMP: Writing data");
4161 int steps = 4 + (random() % 8);
4162 BSOD_CHAR_DELAY (bst, 1000000);
4163 for (i = 0; i < steps; i++)
4164 BSOD_TEXT (bst, LEFT, ".");
4165 BSOD_CHAR_DELAY (bst, 0);
4166 sprintf (buf, "[%dMB]\n", steps);
4167 BSOD_TEXT (bst, LEFT, buf);
4170 BSOD_TEXT (bst, LEFT,
4171 "DUMP: Writing header... [1024 bytes at dev 0x1300023, block 1571598]\n"
4172 "DUMP: crash dump complete.\n"
4173 "kernel inst fault=gentrap, ps=0x5, pc=0xfffffc0000593878, inst=0xaa\n"
4175 "DUMP: second crash dump skipped: 'dump_savecnt' enforced.\n");
4176 BSOD_PAUSE (bst, 4000000);
4178 BSOD_TEXT (bst, LEFT,
4183 "HALT instruction executed\n"
4184 "PC = fffffc00005863b0\n");
4185 BSOD_PAUSE (bst, 3000000);
4187 BSOD_TEXT (bst, LEFT,
4194 XClearWindow(dpy, window);
4201 static struct bsod_state *
4202 msdos (Display *dpy, Window window)
4204 struct bsod_state *bst = make_bsod_state (dpy, window, "msdos", "MSDOS");
4206 BSOD_CHAR_DELAY (bst, 10000);
4207 BSOD_TEXT (bst, LEFT, "C:\\WINDOWS>");
4208 BSOD_CURSOR (bst, CURSOR_LINE, 200000, 8);
4210 BSOD_CHAR_DELAY (bst, 200000);
4211 BSOD_TEXT (bst, LEFT, "dir a:");
4212 BSOD_PAUSE (bst, 1000000);
4214 BSOD_CHAR_DELAY (bst, 10000);
4215 BSOD_TEXT (bst, LEFT, "\nNot ready reading drive A\nAbort, Retry, Fail?");
4217 BSOD_CURSOR (bst, CURSOR_LINE, 200000, 10);
4218 BSOD_CHAR_DELAY (bst, 200000);
4219 BSOD_TEXT (bst, LEFT, "f");
4220 BSOD_PAUSE (bst, 1000000);
4222 BSOD_CHAR_DELAY (bst, 10000);
4223 BSOD_TEXT (bst, LEFT,
4224 "\n\n\nNot ready reading drive A\nAbort, Retry, Fail?");
4226 BSOD_CURSOR (bst, CURSOR_LINE, 200000, 10);
4227 BSOD_CHAR_DELAY (bst, 200000);
4228 BSOD_TEXT (bst, LEFT, "f");
4229 BSOD_PAUSE (bst, 1000000);
4231 BSOD_CHAR_DELAY (bst, 10000);
4232 BSOD_TEXT (bst, LEFT, "\nVolume in drive A has no label\n\n"
4233 "Not ready reading drive A\nAbort, Retry, Fail?");
4235 BSOD_CURSOR (bst, CURSOR_LINE, 200000, 12);
4236 BSOD_CHAR_DELAY (bst, 200000);
4237 BSOD_TEXT (bst, LEFT, "a");
4238 BSOD_PAUSE (bst, 1000000);
4240 BSOD_CHAR_DELAY (bst, 10000);
4241 BSOD_TEXT (bst, LEFT, "\n\nC:\\WINDOWS>");
4243 BSOD_CURSOR (bst, CURSOR_LINE, 200000, 999999);
4245 XClearWindow(dpy, window);
4252 * This is what happens if an Nvidia card goes into some crazy text mode.
4253 * Most often seen on the second screen of a dual-head system when the
4254 * proper driver isn't loaded.
4256 typedef struct { int fg; int bg; int bit; Bool blink; } nvcell;
4259 nvspatter (nvcell *grid, int rows, int cols, int ncolors, int nbits,
4262 int max = rows * cols;
4263 int from = fill_p ? 0 : random() % (max - 1);
4264 int len = fill_p ? max : random() % (cols * 4);
4265 int to = from + len;
4267 Bool noisy = ((random() % 4) == 0);
4268 Bool diag = (noisy || fill_p) ? 0 : ((random() % 4) == 0);
4270 int fg = random() % ncolors;
4271 int bg = random() % ncolors;
4272 int blink = ((random() % 4) == 0);
4273 int bit = (random() % nbits);
4275 if (to > max) to = max;
4279 int src = random() % (rows * cols);
4280 int len2 = (cols / 2) - (random() % 5);
4282 for (i = from; i < to; i++, j++)
4284 if (j > src + len2 || j >= max)
4286 if (i >= max) abort();
4287 if (j >= max) abort();
4292 for (i = from; i < to; i++)
4294 nvcell *cell = &grid[i];
4298 cell->blink = blink;
4302 fg = random() % ncolors;
4303 bg = random() % ncolors;
4304 blink = ((random() % 8) == 0);
4310 struct bsod_state *bst;
4317 unsigned long colors[256];
4323 nvidia_free (struct bsod_state *bst)
4325 nvstate *nvs = (nvstate *) bst->closure;
4327 XFreeColors (bst->dpy, bst->xgwa.colormap, nvs->colors, nvs->ncolors, 0);
4328 for (i = 0; i < countof(nvs->bits); i++)
4329 XFreePixmap (bst->dpy, nvs->bits[i]);
4330 XFreeGC (bst->dpy, nvs->gc1);
4336 nvidia_draw (struct bsod_state *bst)
4338 nvstate *nvs = (nvstate *) bst->closure;
4341 for (y = 0; y < nvs->rows; y++)
4342 for (x = 0; x < nvs->cols; x++)
4344 nvcell *cell = &nvs->grid[y * nvs->cols + x];
4345 unsigned long fg = nvs->colors[cell->fg];
4346 unsigned long bg = nvs->colors[cell->bg];
4347 Bool flip = cell->blink && (nvs->tick & 1);
4348 XSetForeground (bst->dpy, bst->gc, flip ? fg : bg);
4349 XSetBackground (bst->dpy, bst->gc, flip ? bg : fg);
4350 XCopyPlane (bst->dpy, nvs->bits[cell->bit], bst->window, bst->gc,
4351 0, 0, nvs->cellw, nvs->cellh,
4352 x * nvs->cellw, y * nvs->cellh, 1L);
4356 if ((random() % 5) == 0) /* change the display */
4357 nvspatter (nvs->grid, nvs->rows, nvs->cols, nvs->ncolors,
4358 countof(nvs->bits), False);
4364 static struct bsod_state *
4365 nvidia (Display *dpy, Window window)
4367 struct bsod_state *bst = make_bsod_state (dpy, window, "nvidia", "nVidia");
4368 nvstate *nvs = (nvstate *) calloc (1, sizeof (*nvs));
4375 bst->draw_cb = nvidia_draw;
4376 bst->free_cb = nvidia_free;
4380 nvs->cellw = bst->xgwa.width / nvs->cols;
4381 nvs->cellh = bst->xgwa.height / nvs->rows;
4382 if (nvs->cellw < 8 || nvs->cellh < 18)
4383 nvs->cellw = 8, nvs->cellh = 18;
4384 nvs->cols = (bst->xgwa.width / nvs->cellw) + 1;
4385 nvs->rows = (bst->xgwa.height / nvs->cellh) + 1;
4387 nvs->grid = (nvcell *) calloc (sizeof(*nvs->grid), nvs->rows * nvs->cols);
4392 for (i = 0; i < nvs->ncolors; i++)
4395 c.red = random() & 0xFFFF;
4396 c.green = random() & 0xFFFF;
4397 c.blue = random() & 0xFFFF;
4398 c.flags = DoRed|DoGreen|DoBlue;
4399 XAllocColor (dpy, bst->xgwa.colormap, &c);
4400 nvs->colors[i] = c.pixel;
4403 /* Construct corrupted character bitmaps
4405 for (i = 0; i < countof(nvs->bits); i++)
4409 nvs->bits[i] = XCreatePixmap (dpy, window, nvs->cellw, nvs->cellh, 1);
4410 if (!nvs->gc1) nvs->gc1 = XCreateGC (dpy, nvs->bits[i], 0, &gcv);
4412 XSetForeground (dpy, nvs->gc1, 0);
4413 XFillRectangle (dpy, nvs->bits[i], nvs->gc1, 0, 0,
4414 nvs->cellw, nvs->cellh);
4415 XSetForeground (dpy, nvs->gc1, 1);
4417 if ((random() % 40) != 0)
4418 for (j = 0; j < ((nvs->cellw * nvs->cellh) / 16); j++)
4419 XFillRectangle (dpy, nvs->bits[i], nvs->gc1,
4420 (random() % (nvs->cellw-2)) & ~1,
4421 (random() % (nvs->cellh-2)) & ~1,
4425 /* Randomize the grid
4427 nvspatter (nvs->grid, nvs->rows, nvs->cols, nvs->ncolors,
4428 countof(nvs->bits), True);
4429 for (i = 0; i < 20; i++)
4430 nvspatter (nvs->grid, nvs->rows, nvs->cols, nvs->ncolors,
4431 countof(nvs->bits), False);
4438 * Simulate various Apple ][ crashes. The memory map encouraged many programs
4439 * to use the primary hi-res video page for various storage, and the secondary
4440 * hi-res page for active display. When it crashed into Applesoft or the
4441 * monitor, it would revert to the primary page and you'd see memory garbage on
4442 * the screen. Also, it was common for copy-protected games to use the primary
4443 * text page for important code, because that made it really hard to
4444 * reverse-engineer them. The result often looked like what this generates.
4446 * The Apple ][ logic and video hardware is in apple2.c. The TV is emulated by
4447 * analogtv.c for maximum realism
4449 * Trevor Blackwell <tlb@tlb.org>
4452 static const char * const apple2_basic_errors[]={
4456 "RETURN WITHOUT GOSUB",
4460 "BAD SUBSCRIPT ERROR",
4463 "FORMULA TOO COMPLEX",
4468 "DEFAULT ARGUMENTS ARE NOT ALLOWED IN DECLARATION OF FRIEND "
4469 "TEMPLATE SPECIALIZATION"
4473 static const char * const apple2_dos_errors[]={
4477 "NO BUFFERS AVAILABLE",
4478 "PROGRAM TOO LARGE",
4481 static void a2controller_crash(apple2_sim_t *sim, int *stepno,
4482 double *next_actiontime)
4484 apple2_state_t *st=sim->st;
4493 if (!sim->controller_data)
4494 sim->controller_data = calloc(sizeof(struct mydata),1);
4495 mine=(struct mydata *) sim->controller_data;
4500 a2_init_memory_active(sim);
4501 sim->dec->powerup = 1000.0;
4503 if (random()%3==0) {
4505 *next_actiontime+=0.4;
4508 else if (random()%4==0) {
4509 st->gr_mode=A2_GR_LORES;
4510 if (random()%3==0) st->gr_mode |= A2_GR_FULL;
4511 *next_actiontime+=0.4;
4514 else if (random()%2==0) {
4515 st->gr_mode=A2_GR_HIRES;
4519 st->gr_mode=A2_GR_HIRES;
4520 *next_actiontime+=0.4;
4526 /* An illegal instruction or a reset caused it to drop into the
4527 assembly language monitor, where you could disassemble code & view
4529 if (random()%3==0) {
4532 int addr=0xd000+random()%0x3000;
4534 "%02X",random()%0xff);
4537 sprintf(sim->printing_buf,
4540 " A=%02X X=%02X Y=%02X S=%02X F=%02X\n"
4543 random()%0xff, random()%0xff,
4544 random()%0xff, random()%0xff,
4546 sim->printing=sim->printing_buf;
4554 *next_actiontime += 2.0 + (random()%1000)*0.0002;
4557 /* Lots of programs had at least their main functionality in
4558 Applesoft Basic, which had a lot of limits (memory, string
4559 length, etc) and would sometimes crash unexpectedly. */
4560 sprintf(sim->printing_buf,
4566 apple2_basic_errors[random() %
4567 (sizeof(apple2_basic_errors)
4569 (1000*(random()%(random()%59+1)) +
4570 100*(random()%(random()%9+1)) +
4571 5*(random()%(random()%199+1)) +
4572 1*(random()%(random()%(random()%2+1)+1))));
4573 sim->printing=sim->printing_buf;
4577 *next_actiontime += 2.0 + (random()%1000)*0.0002;
4582 if (random()%3==0) {
4583 /* This was how you reset the Basic interpreter. The sort of
4584 incantation you'd have on a little piece of paper taped to the
4585 side of your machine */
4586 sim->typing="CALL -1370";
4589 else if (random()%2==0) {
4590 sim->typing="CATALOG\n";
4594 *next_actiontime+=1.0;
4601 *next_actiontime += 0.5;
4608 for (s="APPLE ]["; *s; s++) a2_printc(st,*s);
4611 *next_actiontime+=1.0;
4616 if (random()%50==0) {
4617 sprintf(sim->printing_buf,
4618 "\nDISK VOLUME 254\n\n"
4622 sim->printing=sim->printing_buf;
4625 sprintf(sim->printing_buf,"\n?%s\n]",
4626 apple2_dos_errors[random()%
4627 (sizeof(apple2_dos_errors) /
4629 sim->printing=sim->printing_buf;
4632 *next_actiontime+=1.0;
4636 if (random()%2==0) {
4637 /* This was how you went back to text mode in the monitor */
4638 sim->typing="FB4BG";
4641 *next_actiontime+=1.0;
4652 *next_actiontime+=2.0;
4656 /* This reset things into Basic */
4657 if (random()%2==0) {
4658 sim->typing="FAA6G";
4663 *next_actiontime+=sim->delay;
4668 for (i=0; i<1500; i++) {
4669 a2_poke(st, mine->fillptr, mine->fillbyte);
4671 mine->fillbyte = (mine->fillbyte+1)&0xff;
4673 *next_actiontime += 0.08;
4674 /* When you hit c000, it changed video settings */
4675 if (mine->fillptr>=0xc000) {
4679 /* And it seemed to reset around here, I dunno why */
4680 if (mine->fillptr>=0xcf00) *stepno=130;
4686 case A2CONTROLLER_FREE:
4694 a2_draw (struct bsod_state *bst)
4696 apple2_sim_t *sim = (apple2_sim_t *) bst->closure;
4698 sim = apple2_start (bst->dpy, bst->window, 9999999, a2controller_crash);
4702 if (! apple2_one_frame (sim)) {
4710 a2_free (struct bsod_state *bst)
4712 apple2_sim_t *sim = (apple2_sim_t *) bst->closure;
4714 sim->stepno = A2CONTROLLER_DONE;
4715 a2_draw (bst); /* finish up */
4716 if (bst->closure) abort(); /* should have been freed by now */
4721 static struct bsod_state *
4722 apple2crash (Display *dpy, Window window)
4724 struct bsod_state *bst = make_bsod_state (dpy, window, "apple2", "Apple2");
4725 bst->draw_cb = a2_draw;
4726 bst->free_cb = a2_free;
4732 a2controller_ransomware(apple2_sim_t *sim, int *stepno,
4733 double *next_actiontime)
4735 apple2_state_t *st=sim->st;
4742 if (!sim->controller_data)
4743 sim->controller_data = calloc(sizeof(struct mydata),1);
4744 mine=(struct mydata *) sim->controller_data;
4749 st->gr_mode |= A2_GR_FULL;
4752 a2_prints(st, "APPLE ][");
4755 *next_actiontime += 2;
4759 a2_prints(st, "READY\n\n");
4761 *next_actiontime += 1;
4769 " _____________________________________\n"
4771 "! OOPS YOUR FILES HAVE BEEN ENCRYPTED !\n"
4772 "! ________________________ !\n"
4774 "! [/--\\] ! [ WHAT HAPPENED TO MY ] ! !\n"
4775 "! [!] [!] ! [ COMPUTER? ] ! !\n"
4777 "! [######] ! [ CAN I RECOVER MY ] ! !\n"
4778 "! [######] ! [ FILES? ] ! !\n"
4779 "! [######] ! ! !\n"
4780 "! [######] ! [ HOW DO I PAY? ] ! !\n"
4782 "! !________________________! !\n"
4784 "! BITCOIN ACCEPTED HERE !\n"
4785 "\\_____________________________________/\n"
4788 "WAITING FOR BLOCKCHAIN..@\n"
4790 "PLEASE INSERT NEXT FLOPPY: "
4796 char c = *mine->str;
4801 *next_actiontime += 30;
4813 *next_actiontime += 2;
4818 a2_printc_noscroll(st, c);
4820 *next_actiontime += 1;
4825 case A2CONTROLLER_FREE:
4832 a2_ransomware_draw (struct bsod_state *bst)
4834 apple2_sim_t *sim = (apple2_sim_t *) bst->closure;
4836 sim = apple2_start (bst->dpy, bst->window, 9999999,
4837 a2controller_ransomware);
4841 if (! apple2_one_frame (sim)) {
4848 static struct bsod_state *
4849 apple2ransomware (Display *dpy, Window window)
4851 struct bsod_state *bst = make_bsod_state (dpy, window, "apple2", "Apple2");
4852 bst->draw_cb = a2_ransomware_draw;
4853 bst->free_cb = a2_free;
4859 /* A crash spotted on a cash machine circa 2006, by jwz. I didn't note
4860 what model it was; probably a Tranax Mini-Bank 1000 or similar vintage.
4862 static struct bsod_state *
4863 atm (Display *dpy, Window window)
4865 struct bsod_state *bst = make_bsod_state (dpy, window, "atm", "ATM");
4868 int pix_w = atm_width;
4869 int pix_h = atm_height;
4873 XClearWindow (dpy, window);
4875 pixmap = XCreatePixmapFromBitmapData (dpy, window, (char *) atm_bits,
4876 atm_width, atm_height,
4877 bst->fg, bst->bg, bst->xgwa.depth);
4879 while (pix_w <= bst->xgwa.width * scale &&
4880 pix_h <= bst->xgwa.height * scale)
4882 pixmap = double_pixmap (dpy, bst->gc, bst->xgwa.visual, bst->xgwa.depth,
4883 pixmap, pix_w, pix_h);
4889 x = (bst->xgwa.width - pix_w) / 2;
4890 y = (bst->xgwa.height - pix_h) / 2;
4896 XSetForeground (dpy, bst->gc,
4897 get_pixel_resource (dpy, bst->xgwa.colormap,
4900 for (j = -1; j < pix_w; j += i+1)
4901 XDrawLine (bst->dpy, pixmap, bst->gc, j, 0, j, pix_h);
4902 for (j = -1; j < pix_h; j += i+1)
4903 XDrawLine (bst->dpy, pixmap, bst->gc, 0, j, pix_w, j);
4906 XCopyArea (dpy, pixmap, window, bst->gc, 0, 0, pix_w, pix_h, x, y);
4908 XFreePixmap (dpy, pixmap);
4914 /* An Android phone boot loader, by jwz.
4916 static struct bsod_state *
4917 android (Display *dpy, Window window)
4919 struct bsod_state *bst = make_bsod_state (dpy, window, "android", "Android");
4921 unsigned long bg = get_pixel_resource (dpy, bst->xgwa.colormap,
4922 "android.background",
4923 "Android.Background");
4924 unsigned long fg = get_pixel_resource (dpy, bst->xgwa.colormap,
4925 "android.foreground",
4926 "Android.Foreground");
4927 unsigned long c1 = get_pixel_resource (dpy, bst->xgwa.colormap,
4929 "Android.Foreground");
4930 unsigned long c2 = get_pixel_resource (dpy, bst->xgwa.colormap,
4932 "Android.Foreground");
4933 unsigned long c3 = get_pixel_resource (dpy, bst->xgwa.colormap,
4935 "Android.Foreground");
4936 unsigned long c4 = get_pixel_resource (dpy, bst->xgwa.colormap,
4938 "Android.Foreground");
4939 unsigned long c5 = get_pixel_resource (dpy, bst->xgwa.colormap,
4941 "Android.Foreground");
4942 unsigned long c6 = get_pixel_resource (dpy, bst->xgwa.colormap,
4944 "Android.Foreground");
4945 unsigned long c7 = get_pixel_resource (dpy, bst->xgwa.colormap,
4947 "Android.Foreground");
4949 const char *lines0[] = {
4950 "Calculating... please wait\n",
4951 "osbl: 0x499DF907\n",
4952 "amss: 0x73162409\n",
4953 "hboot: 0xE46C3327\n",
4954 "boot: 0xBA570E7A\n",
4955 "recovery: 0xC8BBA213\n",
4956 "system: 0x87C3B1F0\n",
4958 "Press power key to go back.\n",
4961 const char *lines1[] = {
4962 "Checking SD card update...\n",
4964 " SD Checking...\n",
4965 " Failed to open zipfile\n",
4966 " loading preload_content...\n",
4967 " [Caution] Preload Content Not Found\n",
4968 " loading HTCUpdateZipName image...\n",
4970 " Checking...[PG46IMG.zip]\n",
4971 "Please plug off USB\n",
4974 const char *lines2[] = {
4975 " SD Checking...\n",
4976 " Loading...[PK76DIAG.zip]\n",
4978 " Loading...[PK76DIAG.nbh]\n",
4979 " No image or wrong image!\n",
4980 " Loading...[PK76IMG.zip]\n",
4982 " Loading...[PK76IMG.nbh]\n",
4983 " No image or wrong image!\n",
4984 " Loading...[PK76IMG.tar]\n",
4986 " Loading...[PK76IMG.aes]\n",
4988 " Loading...[PK76IMG.enc]\n",
4992 int cw = (bst->font->per_char
4993 ? bst->font->per_char['n'-bst->font->min_char_or_byte2].width
4994 : bst->font->min_bounds.width);
4995 int line_height = bst->font->ascent + bst->font->descent;
5000 int pix_w = 0, pix_h = 0;
5003 pixmap = xpm_data_to_pixmap (dpy, window, (char **) android_skate,
5005 if (! pixmap) abort();
5006 bst->pixmap = pixmap;
5007 # endif /* DO_XPM */
5009 bst->left_margin = (bst->xgwa.width - (cw * 40)) / 2;
5010 if (bst->left_margin < 0) bst->left_margin = 0;
5013 unsigned long delay =
5015 state == countof(lines0) ||
5016 state == countof(lines0) + countof(lines1) ||
5017 state == countof(lines0) + countof(lines1) + countof(lines2))
5019 BSOD_LINE_DELAY (bst, delay);
5021 if (state <= countof(lines0) + countof(lines1) + countof(lines2))
5023 BSOD_COLOR (bst, bg, bg);
5024 BSOD_RECT (bst, True, 0, 0, bst->xgwa.width, bst->xgwa.height);
5025 BSOD_COLOR (bst, bg, c1);
5026 BSOD_MOVETO (bst, bst->left_margin + bst->xoff,
5027 bst->top_margin + bst->yoff + line_height);
5028 BSOD_TEXT (bst, LEFT, "*** UNLOCKED ***\n");
5029 BSOD_COLOR (bst, c2, bg);
5030 BSOD_TEXT (bst, LEFT,
5031 "PRIMOU PVT SHIP S-OFF RL\n"
5035 "RADIO-3831.17.00.23_2\n"
5036 "eMMC-bootmode: disabled\n"
5037 "CPU-bootmode : disabled\n"
5038 "HW Secure boot: enabled\n"
5039 "MODEM PATH : OFF\n"
5040 "May 15 2012, 10:28:15\n"
5042 BSOD_COLOR (bst, bg, c3);
5046 int x = (bst->xgwa.width - pix_w) / 2;
5047 int y = bst->xgwa.height - bst->yoff - pix_h;
5048 BSOD_PIXMAP (bst, 0, 0, pix_w, pix_h, x, y);
5052 if (state == countof(lines0) ||
5053 state == countof(lines0) + countof(lines1) ||
5054 state == countof(lines0) + countof(lines1) + countof(lines2))
5056 BSOD_TEXT (bst, LEFT, "HBOOT USB\n");
5057 BSOD_COLOR (bst, c4, bg);
5058 BSOD_TEXT (bst, LEFT,
5060 "<VOL UP> to previous item\n"
5061 "<VOL DOWN> to next item\n"
5062 "<POWER> to select item\n"
5064 BSOD_COLOR (bst, c5, bg); BSOD_TEXT (bst, LEFT, "FASTBOOT\n");
5065 BSOD_COLOR (bst, c6, bg); BSOD_TEXT (bst, LEFT, "RECOVERY\n");
5066 BSOD_COLOR (bst, c7, bg); BSOD_TEXT (bst, LEFT, "FACTORY RESET\n");
5067 BSOD_COLOR (bst, c3, bg); BSOD_TEXT (bst, LEFT, "SIMLOCK\n");
5068 BSOD_COLOR (bst, bg, c3); BSOD_TEXT (bst, LEFT, "HBOOT USB\n");
5069 BSOD_COLOR (bst, fg, bg); BSOD_TEXT (bst, LEFT, "IMAGE CRC\n");
5070 BSOD_COLOR (bst, c3, bg); BSOD_TEXT (bst, LEFT, "SHOW BARCODE\n");
5071 BSOD_PAUSE (bst, 3000000);
5073 else if (state < countof(lines0))
5075 BSOD_TEXT (bst, LEFT, "IMAGE CRC\n\n");
5076 BSOD_COLOR (bst, c5, bg);
5079 for (i = 0; i <= state; i++) {
5080 const char *s = lines0[i];
5081 BSOD_COLOR (bst, (strchr(s, ':') ? c7 : c3), bg);
5082 BSOD_TEXT (bst, LEFT, s);
5085 BSOD_PAUSE (bst, 500000);
5086 if (state == countof(lines0)-1)
5087 BSOD_PAUSE (bst, 2000000);
5089 else if (state < countof(lines0) + countof(lines1))
5091 BSOD_TEXT (bst, LEFT, "HBOOT\n\n");
5092 BSOD_COLOR (bst, c5, bg);
5095 for (i = countof(lines0); i <= state; i++) {
5096 const char *s = lines1[i - countof(lines0)];
5097 BSOD_COLOR (bst, (*s == ' ' ? c6 : c3), bg);
5098 BSOD_TEXT (bst, LEFT, s);
5101 BSOD_PAUSE (bst, 500000);
5102 if (state == countof(lines0) + countof(lines1) - 1)
5103 BSOD_PAUSE (bst, 2000000);
5105 else if (state < countof(lines0) + countof(lines1) + countof(lines2))
5107 BSOD_TEXT (bst, LEFT, "HBOOT USB\n\n");
5108 BSOD_COLOR (bst, c5, bg);
5111 for (i = countof(lines0) + countof(lines1); i <= state; i++) {
5112 const char *s = lines2[i - countof(lines0) - countof(lines1)];
5113 BSOD_COLOR (bst, (*s == ' ' ? c6 : c3), bg);
5114 BSOD_TEXT (bst, LEFT, s);
5117 BSOD_PAUSE (bst, 500000);
5118 if (state == countof(lines0) + countof(lines1) + countof(lines2)-1)
5119 BSOD_PAUSE (bst, 2000000);
5127 XClearWindow (dpy, window);
5135 /*****************************************************************************
5136 *****************************************************************************/
5139 static const struct {
5141 struct bsod_state * (*fn) (Display *, Window);
5143 { "Windows", windows_31 },
5144 { "NT", windows_nt },
5145 { "Win2K", windows_other },
5146 { "Win10", windows_10 },
5147 { "Ransomware", windows_ransomware },
5150 { "MacsBug", macsbug },
5155 { "HPPALinux", hppa_linux },
5156 { "SparcLinux", sparc_linux },
5160 { "BlitDamage", blitdamage },
5162 { "Solaris", sparc_solaris },
5163 { "Linux", linux_fsck },
5170 { "Nvidia", nvidia },
5171 { "Apple2", apple2crash },
5173 { "GLaDOS", glados },
5174 { "Android", android },
5175 { "VMware", vmware },
5179 struct driver_state {
5181 int only, which, next_one;
5183 int delay_remaining;
5185 Bool debug_p, cycle_p;
5186 struct bsod_state *bst;
5191 hack_title (struct driver_state *dst)
5195 XFetchName (dst->bst->dpy, dst->bst->window, &oname);
5196 if (oname && !strncmp (oname, "BSOD: ", 6)) {
5197 char *tail = oname + 4;
5198 char *s = strchr (tail+1, ':');
5201 nname = malloc (strlen (tail) + strlen (dst->name) + 20);
5202 sprintf (nname, "BSOD: %s%s", dst->name, tail);
5203 XStoreName (dst->bst->dpy, dst->bst->window, nname);
5206 # endif /* !HAVE_JWXYZ */
5210 bsod_init (Display *dpy, Window window)
5212 struct driver_state *dst = (struct driver_state *) calloc (1, sizeof(*dst));
5215 dst->mode_duration = get_integer_resource (dpy, "delay", "Integer");
5216 if (dst->mode_duration < 3) dst->mode_duration = 3;
5218 dst->debug_p = get_boolean_resource (dpy, "debug", "Boolean");
5222 s = get_string_resource(dpy, "doOnly", "DoOnly");
5223 if (s && !strcasecmp (s, "cycle"))
5226 dst->cycle_p = True;
5230 int count = countof(all_modes);
5231 for (dst->only = 0; dst->only < count; dst->only++)
5232 if (!strcasecmp (s, all_modes[dst->only].name))
5234 if (dst->only >= count)
5236 fprintf (stderr, "%s: unknown -only mode: \"%s\"\n", progname, s);
5248 static unsigned long
5249 bsod_draw (Display *dpy, Window window, void *closure)
5251 struct driver_state *dst = (struct driver_state *) closure;
5256 now = time ((time_t *) 0);
5257 time_left = dst->start + dst->mode_duration - now;
5259 if (dst->bst && dst->bst->img_loader) /* still loading */
5261 dst->bst->img_loader =
5262 load_image_async_simple (dst->bst->img_loader, 0, 0, 0, 0, 0);
5267 /* Rather than returning a multi-second delay from the draw() routine,
5268 meaning "don't call us again for N seconds", we quantize that down
5269 to 1/10th second intervals so that it's more responsive to
5270 rotate/reshape events.
5272 if (dst->delay_remaining)
5275 int this_delay = MIN (dst->delay_remaining, inc);
5276 dst->delay_remaining = MAX (0, dst->delay_remaining - inc);
5280 if (! dst->bst && time_left > 0) /* run completed; wait out the delay */
5283 fprintf (stderr, "%s: %s: %d left\n", progname, dst->name, time_left);
5285 if (time_left > 5) time_left = 5; /* Boooored now */
5286 dst->delay_remaining = 1000000 * time_left;
5289 else if (dst->bst) /* sub-mode currently running */
5291 int this_delay = -1;
5294 this_delay = bsod_pop (dst->bst);
5296 /* XSync (dpy, False); slows down char drawing too much on HAVE_JWXYZ */
5298 if (this_delay == 0)
5299 goto AGAIN; /* no delay, not expired: stay here */
5300 else if (this_delay >= 0)
5302 dst->delay_remaining = this_delay; /* return; time to sleep */
5306 { /* sub-mode run completed or expired */
5308 fprintf (stderr, "%s: %s: done\n", progname, dst->name);
5309 free_bsod_state (dst->bst);
5314 else /* launch a new sub-mode */
5316 if (dst->next_one >= 0)
5317 dst->which = dst->next_one, dst->next_one = -1;
5318 else if (dst->cycle_p)
5319 dst->which = (dst->which + 1) % countof(all_modes);
5320 else if (dst->only >= 0)
5321 dst->which = dst->only;
5324 int count = countof(all_modes);
5327 for (i = 0; i < 200; i++)
5329 char name[100], class[100];
5330 int new_mode = (random() & 0xFF) % count;
5332 if (i < 100 && new_mode == dst->which)
5335 sprintf (name, "do%s", all_modes[new_mode].name);
5336 sprintf (class, "Do%s", all_modes[new_mode].name);
5338 if (get_boolean_resource (dpy, name, class))
5340 dst->which = new_mode;
5347 fprintf (stderr, "%s: no display modes enabled?\n", progname);
5349 dst->which = dst->only = 0;
5354 fprintf (stderr, "%s: %s: launch\n", progname,
5355 all_modes[dst->which].name);
5357 /* Run the mode setup routine...
5359 if (dst->bst) abort();
5360 dst->name = all_modes[dst->which].name;
5361 dst->bst = all_modes[dst->which].fn (dpy, window);
5362 dst->start = (dst->bst ? time ((time_t *) 0) : 0);
5364 /* Reset the structure run state to the beginning,
5365 and do some sanitization of the cursor position
5366 before the first run.
5371 fprintf (stderr, "%s: %s: queue size: %d (%d)\n", progname,
5372 dst->name, dst->bst->pos, dst->bst->queue_size);
5376 dst->bst->x = dst->bst->current_left =
5377 dst->bst->left_margin + dst->bst->xoff;
5380 dst->bst->top_margin + dst->bst->yoff + dst->bst->font->ascent)
5382 dst->bst->top_margin + dst->bst->yoff + dst->bst->font->ascent;
5391 bsod_reshape (Display *dpy, Window window, void *closure,
5392 unsigned int w, unsigned int h)
5394 struct driver_state *dst = (struct driver_state *) closure;
5397 w == dst->bst->xgwa.width &&
5398 h == dst->bst->xgwa.height)
5402 fprintf (stderr, "%s: %s: reshape reset\n", progname, dst->name);
5404 /* just restart this mode and restart when the window is resized. */
5406 free_bsod_state (dst->bst);
5409 dst->delay_remaining = 0;
5410 dst->next_one = dst->which;
5412 XClearWindow (dpy, window);
5417 bsod_event (Display *dpy, Window window, void *closure, XEvent *event)
5419 struct driver_state *dst = (struct driver_state *) closure;
5420 Bool reset_p = False;
5422 /* pick a new mode and restart when mouse clicked, or certain keys typed. */
5424 if (screenhack_event_helper (dpy, window, event))
5430 fprintf (stderr, "%s: %s: manual reset\n", progname, dst->name);
5432 free_bsod_state (dst->bst);
5435 dst->delay_remaining = 0;
5437 XClearWindow (dpy, window);
5446 bsod_free (Display *dpy, Window window, void *closure)
5448 struct driver_state *dst = (struct driver_state *) closure;
5450 free_bsod_state (dst->bst);
5455 static const char *bsod_defaults [] = {
5464 "*doRansomware: True",
5471 "*doAtari: False", /* boring */
5472 "*doBSD: False", /* boring */
5474 "*doSparcLinux: False", /* boring */
5475 "*doHPPALinux: True",
5476 "*doBlitDamage: True",
5492 ".foreground: White",
5493 ".background: Black",
5495 ".windows.foreground: White",
5496 ".windows.background: #0000AA", /* EGA color 0x01. */
5498 ".nt.foreground: White",
5499 ".nt.background: #0000AA", /* EGA color 0x01. */
5501 ".windowslh.foreground: White",
5502 ".windowslh.background: #AA0000", /* EGA color 0x04. */
5503 ".windowslh.background2: #AAAAAA", /* EGA color 0x07. */
5505 ".win10.foreground: White",
5506 ".win10.background: #1070AA",
5508 ".ransomware.foreground: White",
5509 ".ransomware.background: #841212",
5510 ".ransomware.foreground2: Black", /* ransom note */
5511 ".ransomware.background2: White",
5512 ".ransomware.foreground3: Black", /* buttons */
5513 ".ransomware.background3: #AAAAAA",
5514 ".ransomware.link: #7BF9F6",
5515 ".ransomware.timerheader: #BDBE02",
5518 ".glaDOS.foreground: White",
5519 ".glaDOS.background: #0000AA", /* EGA color 0x01. */
5521 ".amiga.foreground: #FF0000",
5522 ".amiga.background: Black",
5523 ".amiga.background2: White",
5525 ".mac.foreground: #BBFFFF",
5526 ".mac.background: Black",
5528 ".atari.foreground: Black",
5529 ".atari.background: White",
5531 ".macsbug.foreground: Black",
5532 ".macsbug.background: White",
5533 ".macsbug.borderColor: #AAAAAA",
5535 ".mac1.foreground: Black",
5536 ".mac1.background: White",
5538 ".macx.foreground: White",
5539 ".macx.textForeground: White",
5540 ".macx.textBackground: Black",
5541 ".macx.background: #888888",
5543 ".macinstall.barForeground: #C0C0C0",
5544 ".macinstall.barBackground: #888888",
5546 ".sco.foreground: White",
5547 ".sco.background: Black",
5549 ".hvx.foreground: White",
5550 ".hvx.background: Black",
5552 ".linux.foreground: White",
5553 ".linux.background: Black",
5555 ".hppalinux.foreground: White",
5556 ".hppalinux.background: Black",
5558 ".sparclinux.foreground: White",
5559 ".sparclinux.background: Black",
5561 ".bsd.foreground: #c0c0c0",
5562 ".bsd.background: Black",
5564 ".solaris.foreground: Black",
5565 ".solaris.background: White",
5567 ".hpux.foreground: White",
5568 ".hpux.background: Black",
5570 ".os390.background: Black",
5571 ".os390.foreground: Red",
5573 ".tru64.foreground: White",
5574 ".tru64.background: #0000AA", /* EGA color 0x01. */
5576 ".vms.foreground: White",
5577 ".vms.background: Black",
5579 ".msdos.foreground: White",
5580 ".msdos.background: Black",
5582 ".os2.foreground: White",
5583 ".os2.background: Black",
5585 ".atm.foreground: Black",
5586 ".atm.background: #FF6600",
5588 ".android.foreground: Black",
5589 ".android.background: White",
5590 ".android.color1: #AA00AA", /* violet */
5591 ".android.color2: #336633", /* green1 */
5592 ".android.color3: #0000FF", /* blue */
5593 ".android.color4: #CC7744", /* orange */
5594 ".android.color5: #99AA55", /* green2 */
5595 ".android.color6: #66AA33", /* green3 */
5596 ".android.color7: #FF0000", /* red */
5598 ".vmware.foreground: White",
5599 ".vmware.foreground2: Yellow",
5600 ".vmware.background: #a700a8", /* purple */
5602 "*dontClearRoot: True",
5606 #ifdef HAVE_XSHM_EXTENSION
5613 # if defined(USE_IPHONE)
5615 "*font: PxPlus IBM VGA8 16, Courier-Bold 14",
5620 ".mac.font: Courier-Bold 18",
5621 ".macsbug.font: Courier-Bold 8",
5622 ".macx.font: Courier-Bold 14",
5623 ".macdisk.font: Courier-Bold 14",
5624 ".macinstall.font: Helvetica 12, Arial 12",
5625 ".macinstall.bigFont: Helvetica 12, Arial 12",
5626 ".msdos.font: PxPlus IBM VGA8 32, Courier-Bold 28",
5627 ".nt.font: PxPlus IBM VGA8 12, Courier-Bold 10",
5628 ".win10.font: Arial 12, Helvetica 12",
5629 ".win10.bigFont: Arial 12, Helvetica 12",
5630 ".win10.fontB: Arial 50, Helvetica 50",
5631 ".win10.fontC: Arial 9, Helvetica 9",
5632 ".win10.bigFont2: ",
5634 ".ransomware.font: Arial 10, Helvetica 10",
5635 ".ransomware.fontB: Arial 8, Helvetica 8",
5636 ".ransomware.fontC: Arial 10, Helvetica Bold 10",
5638 # elif defined(HAVE_ANDROID)
5640 "*font: PxPlus IBM VGA8 16",
5645 ".mac.font: -*-courier-bold-r-*-*-*-180-*-*-m-*-*-*",
5646 ".macsbug.font: -*-courier-bold-r-*-*-*-80-*-*-m-*-*-*",
5647 ".macx.font: -*-courier-bold-r-*-*-*-140-*-*-m-*-*-*",
5648 ".macdisk.font: -*-courier-bold-r-*-*-*-140-*-*-m-*-*-*",
5649 ".macinstall.font: -*-helvetica-medium-r-*-*-*-120-*-*-*-*-*-*",
5650 ".macinstall.bigFont: -*-helvetica-medium-r-*-*-*-120-*-*-*-*-*-*",
5651 ".msdos.font: PxPlus IBM VGA8 32",
5652 ".nt.font: PxPlus IBM VGA8 12",
5654 ".win10.font: -*-helvetica-medium-r-*-*-*-120-*-*-*-*-*-*",
5655 ".win10.bigFont: -*-helvetica-medium-r-*-*-*-120-*-*-*-*-*-*",
5656 ".win10.fontB: -*-helvetica-medium-r-*-*-*-500-*-*-*-*-*-*",
5657 ".win10.fontC: -*-helvetica-medium-r-*-*-*-90-*-*-*-*-*-*",
5658 ".win10.bigFont2: ",
5660 ".ransomware.font: -*-helvetica-medium-r-*-*-*-100-*-*-*-*-*-*",
5661 ".ransomware.fontB: -*-helvetica-medium-r-*-*-*-80-*-*-*-*-*-*",
5662 ".ransomware.fontC: -*-helvetica-bold-r-*-*-*-100-*-*-*-*-*-*",
5664 # elif defined(HAVE_COCOA)
5666 "*font: PxPlus IBM VGA8 8, Courier Bold 9",
5667 "*bigFont: PxPlus IBM VGA8 32, Courier Bold 24",
5671 ".mac.font: Monaco 10, Courier Bold 9",
5672 ".mac.bigFont: Monaco 18, Courier Bold 18",
5674 ".macsbug.font: Monaco 10, Courier Bold 9",
5675 ".macsbug.bigFont: Monaco 24, Courier Bold 24",
5677 ".macx.font: Courier Bold 9",
5678 ".macx.bigFont: Courier Bold 14",
5679 ".macdisk.font: Courier Bold 9",
5680 ".macdisk.bigFont: Courier Bold 18",
5681 ".macinstall.font: Helvetica 24, Arial 24",
5682 ".macinstall.bigFont: Helvetica 24, Arial 24",
5684 ".hvx.bigFont: PxPlus IBM VGA8 16, Courier Bold 14",
5685 ".hppalinux.bigFont: PxPlus IBM VGA8 16, Courier Bold 14",
5686 ".solaris.bigFont: PxPlus IBM VGA8 16, Courier Bold 14",
5687 ".linux.bigFont: PxPlus IBM VGA8 16, Courier Bold 14",
5688 ".hpux.bigFont: PxPlus IBM VGA8 16, Courier Bold 14",
5689 ".msdos.font: PxPlus IBM VGA8 16, Courier Bold 14",
5691 ".win10.font: Arial 24, Helvetica 24",
5692 ".win10.bigFont: Arial 24, Helvetica 24",
5693 ".win10.fontB: Arial 100, Helvetica 100",
5694 ".win10.fontC: Arial 16, Helvetica 16",
5695 ".win10.bigFont2: ",
5697 ".ransomware.font: Arial 24, Helvetica 24",
5698 ".ransomware.bigFont: Arial 24, Helvetica 24",
5699 ".ransomware.fontB: Arial 16, Helvetica 16",
5700 ".ransomware.fontC: Arial Bold 24, Helvetica Bold 24",
5705 "*font2: -*-courier-bold-r-*-*-*-120-*-*-m-*-*-*",
5706 "*bigFont: -*-courier-bold-r-*-*-*-180-*-*-m-*-*-*",
5707 "*bigFont2: -*-courier-bold-r-*-*-*-180-*-*-m-*-*-*",
5709 ".macsbug.font: -*-courier-medium-r-*-*-*-80-*-*-m-*-*-*",
5710 ".macsbug.bigFont: -*-courier-bold-r-*-*-*-140-*-*-m-*-*-*",
5712 ".macdisk.font: -*-courier-bold-r-*-*-*-80-*-*-m-*-*-*",
5713 ".macdisk.bigFont: -*-courier-bold-r-*-*-*-100-*-*-m-*-*-*",
5714 ".macinstall.font: -*-helvetica-medium-r-*-*-*-180-*-*-*-*-*-*",
5715 ".macinstall.bigFont: -*-helvetica-medium-r-*-*-*-180-*-*-*-*-*-*",
5717 ".sco.font: -*-courier-bold-r-*-*-*-140-*-*-m-*-*-*",
5718 ".hvx.font: -*-courier-bold-r-*-*-*-140-*-*-m-*-*-*",
5719 ".hppalinux.bigFont: -*-courier-bold-r-*-*-*-140-*-*-m-*-*-*",
5720 ".sparclinux.bigFont: -*-courier-bold-r-*-*-*-140-*-*-m-*-*-*",
5723 ".bsd.bigFont: -sun-console-medium-r-*-*-22-*-*-*-m-*-*-*",
5724 ".bsd.bigFont2: -*-courier-bold-r-*-*-*-140-*-*-m-*-*-*",
5726 ".solaris.font: -sun-gallant-*-*-*-*-19-*-*-*-*-120-*-*",
5727 ".hpux.bigFont: -*-courier-bold-r-*-*-*-140-*-*-m-*-*-*",
5728 ".os390.bigFont: -*-courier-bold-r-*-*-*-140-*-*-m-*-*-*",
5729 ".tru64.bigFont: -*-courier-bold-r-*-*-*-140-*-*-m-*-*-*",
5730 ".vms.bigFont: -*-courier-bold-r-*-*-*-140-*-*-m-*-*-*",
5731 ".msdos.bigFont: -*-courier-bold-r-*-*-*-140-*-*-m-*-*-*",
5733 ".win10.font: -*-helvetica-medium-r-*-*-*-180-*-*-*-*-*-*",
5734 ".win10.bigFont: -*-helvetica-medium-r-*-*-*-180-*-*-*-*-*-*",
5735 ".win10.fontB: -*-helvetica-medium-r-*-*-*-240-*-*-*-*-*-*",
5736 ".win10.fontC: -*-helvetica-medium-r-*-*-*-140-*-*-*-*-*-*",
5738 ".win10.bigFont2: ",
5740 ".ransomware.font: -*-helvetica-medium-r-*-*-*-180-*-*-*-*-*-*",
5741 ".ransomware.bigFont: -*-helvetica-medium-r-*-*-*-180-*-*-*-*-*-*",
5742 ".ransomware.fontB: -*-helvetica-medium-r-*-*-*-140-*-*-*-*-*-*",
5743 ".ransomware.fontC: -*-helvetica-bold-r-*-*-*-180-*-*-*-*-*-*",
5751 static const XrmOptionDescRec bsod_options [] = {
5752 { "-delay", ".delay", XrmoptionSepArg, 0 },
5753 { "-only", ".doOnly", XrmoptionSepArg, 0 },
5754 { "-debug", ".debug", XrmoptionNoArg, "True" },
5755 { "-windows", ".doWindows", XrmoptionNoArg, "True" },
5756 { "-no-windows", ".doWindows", XrmoptionNoArg, "False" },
5757 { "-nt", ".doNT", XrmoptionNoArg, "True" },
5758 { "-no-nt", ".doNT", XrmoptionNoArg, "False" },
5759 { "-2k", ".doWin2K", XrmoptionNoArg, "True" },
5760 { "-no-2k", ".doWin2K", XrmoptionNoArg, "False" },
5761 { "-win10", ".doWin10", XrmoptionNoArg, "True" },
5762 { "-no-win10", ".doWin10", XrmoptionNoArg, "False" },
5763 { "-ransomware", ".doRansomware", XrmoptionNoArg, "True" },
5764 { "-no-ransomware", ".doRansomware", XrmoptionNoArg, "False" },
5765 { "-amiga", ".doAmiga", XrmoptionNoArg, "True" },
5766 { "-no-amiga", ".doAmiga", XrmoptionNoArg, "False" },
5767 { "-mac", ".doMac", XrmoptionNoArg, "True" },
5768 { "-no-mac", ".doMac", XrmoptionNoArg, "False" },
5769 { "-mac1", ".doMac1", XrmoptionNoArg, "True" },
5770 { "-no-mac1", ".doMac1", XrmoptionNoArg, "False" },
5771 { "-macx", ".doMacX", XrmoptionNoArg, "True" },
5772 { "-no-macx", ".doMacX", XrmoptionNoArg, "False" },
5773 { "-atari", ".doAtari", XrmoptionNoArg, "True" },
5774 { "-no-atari", ".doAtari", XrmoptionNoArg, "False" },
5775 { "-macsbug", ".doMacsBug", XrmoptionNoArg, "True" },
5776 { "-no-macsbug", ".doMacsBug", XrmoptionNoArg, "False" },
5777 { "-apple2", ".doApple2", XrmoptionNoArg, "True" },
5778 { "-no-apple2", ".doApple2", XrmoptionNoArg, "False" },
5779 { "-sco", ".doSCO", XrmoptionNoArg, "True" },
5780 { "-no-sco", ".doSCO", XrmoptionNoArg, "False" },
5781 { "-hvx", ".doHVX", XrmoptionNoArg, "True" },
5782 { "-no-hvx", ".doHVX", XrmoptionNoArg, "False" },
5783 { "-bsd", ".doBSD", XrmoptionNoArg, "True" },
5784 { "-no-bsd", ".doBSD", XrmoptionNoArg, "False" },
5785 { "-linux", ".doLinux", XrmoptionNoArg, "True" },
5786 { "-no-linux", ".doLinux", XrmoptionNoArg, "False" },
5787 { "-hppalinux", ".doHPPALinux", XrmoptionNoArg, "True" },
5788 { "-no-hppalinux", ".doHPPALinux", XrmoptionNoArg, "False" },
5789 { "-sparclinux", ".doSparcLinux", XrmoptionNoArg, "True" },
5790 { "-no-sparclinux", ".doSparcLinux", XrmoptionNoArg, "False" },
5791 { "-blitdamage", ".doBlitDamage", XrmoptionNoArg, "True" },
5792 { "-no-blitdamage", ".doBlitDamage", XrmoptionNoArg, "False" },
5793 { "-nvidia", ".doNvidia", XrmoptionNoArg, "True" },
5794 { "-no-nvidia", ".doNvidia", XrmoptionNoArg, "False" },
5795 { "-solaris", ".doSolaris", XrmoptionNoArg, "True" },
5796 { "-no-solaris", ".doSolaris", XrmoptionNoArg, "False" },
5797 { "-hpux", ".doHPUX", XrmoptionNoArg, "True" },
5798 { "-no-hpux", ".doHPUX", XrmoptionNoArg, "False" },
5799 { "-os390", ".doOS390", XrmoptionNoArg, "True" },
5800 { "-no-os390", ".doOS390", XrmoptionNoArg, "False" },
5801 { "-tru64", ".doHPUX", XrmoptionNoArg, "True" },
5802 { "-no-tru64", ".doTru64", XrmoptionNoArg, "False" },
5803 { "-vms", ".doVMS", XrmoptionNoArg, "True" },
5804 { "-no-vms", ".doVMS", XrmoptionNoArg, "False" },
5805 { "-msdos", ".doMSDOS", XrmoptionNoArg, "True" },
5806 { "-no-msdos", ".doMSDOS", XrmoptionNoArg, "False" },
5807 { "-os2", ".doOS2", XrmoptionNoArg, "True" },
5808 { "-no-os2", ".doOS2", XrmoptionNoArg, "False" },
5809 { "-atm", ".doATM", XrmoptionNoArg, "True" },
5810 { "-no-atm", ".doATM", XrmoptionNoArg, "False" },
5811 { "-glados", ".doGLaDOS", XrmoptionNoArg, "True" },
5812 { "-no-glados", ".doGLaDOS", XrmoptionNoArg, "False" },
5813 { "-android", ".doAndroid", XrmoptionNoArg, "True" },
5814 { "-no-android", ".doAndroid", XrmoptionNoArg, "False" },
5815 { "-vmware", ".doVMware", XrmoptionNoArg, "True" },
5816 { "-no-vmware", ".doVMware", XrmoptionNoArg, "False" },
5822 XSCREENSAVER_MODULE ("BSOD", bsod)