diff -urN /usr/src/sys/conf/files src/sys/conf/files --- /usr/src/sys/conf/files Fri Aug 19 19:36:24 2005 +++ src/sys/conf/files Mon Aug 22 23:19:27 2005 @@ -1240,6 +1240,7 @@ kern/subr_blist.c standard kern/subr_bus.c standard kern/subr_clock.c optional genclock +kern/subr_cow.c standard kern/subr_devstat.c standard kern/subr_disk.c standard kern/subr_eventhandler.c standard diff -urN /usr/src/sys/kern/kern_shutdown.c src/sys/kern/kern_shutdown.c --- /usr/src/sys/kern/kern_shutdown.c Tue Apr 12 07:45:58 2005 +++ src/sys/kern/kern_shutdown.c Mon Aug 22 23:24:38 2005 @@ -491,6 +491,7 @@ int bootopt, newpanic; va_list ap; static char buf[256]; + char tmpbuf[256]; #ifdef SMP /* @@ -519,11 +520,13 @@ if (newpanic) { (void)vsnprintf(buf, sizeof(buf), fmt, ap); panicstr = buf; - printf("panic: %s\n", buf); + printf(" "); + cowsay(buf); } else { - printf("panic: "); - vprintf(fmt, ap); - printf("\n"); + + (void)vsnprintf(tmpbuf, sizeof(tmpbuf), fmt, ap); + printf(" "); + cowsay(tmpbuf); } va_end(ap); #ifdef SMP diff -urN /usr/src/sys/kern/subr_cow.c src/sys/kern/subr_cow.c --- /usr/src/sys/kern/subr_cow.c Thu Jan 1 01:00:00 1970 +++ src/sys/kern/subr_cow.c Mon Aug 22 23:32:37 2005 @@ -0,0 +1,136 @@ +/*- + * Copyright (c) Suleiman Souhlal + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include + +const char cow[] = "\n \\ ^__^\n" + " \\ (oo)\\_______\n" + " (__)\\ )\\/\\\n" + " ||----w |\n" + " || ||\n"; + +const char sheep[] = " \\\n" + " \\n" + " __\n" + " UooU\\.'@@@@@@`.\n" + " \\__/(@@@@@@@@@@)\n" + " (@@@@@@@@)\n" + " `YY~~~~YY'\n" + " || ||\n"; + +const char bunny[] = " \\\n" + " \\ \\n" + " \\ /\\n" + " ( )\n" + " .( o ).\n"; + +const char koala[] = " ___\n" + " {~._.~}\n" + " ( Y )\n" + " ()~*~()\n" + " (_)-(_)\n"; + +const char beastie[] = " \\ , ,\n" + " \\ /( )`\n" + " \\ \\ \\___ / |\n" + " /- _ `-/ '\n" + " (/\\/ \\ \\ /\\\n" + " / / | ` \\\n" + " O O ) / |\n" + " `-^--'`< '\n" + " (_.) _ ) /\n" + " `.___/` /\n" + " `-----' /\n" + "<----. __ / __ \\\n" + "<----|====O)))==) \\) /====\n" + "<----' `--' `.__,' \\\n" + " | |\n" + " \\ /\n" + " ______( (_ / \\______\n" + " ,' ,-----' | \\\n" + " `--{__________) \\/\n"; + +const char kitty[] = " (\"`-' '-/\") .___..--' ' \"`-._\n" + " ` *_ * ) `-. ( ) .`-.__. `)\n" + " (_Y_.) ' ._ ) `._` ; `` -. .-'\n" + " _.. `--'_..-_/ /--' _ .' ,4\n" + " ( i l ),-'' ( l i),' ( ( ! .-'\n"; + +const char tuxstab[] = " \\ , ,\n" + " \\ /( )`\n" + " \\ \\ \\___ / |\n" + " \\ /- _ `-/ '\n" + " \\ (/\\/ \\ \\ /\\\n" + " \\ / / | ` \\\n" + " \\ O O ) / |\n" + " \\ `-^--'`< '\n" + " .--. (_.) _ ) /\n" + " |o_o | `.___/` /\n" + " |:_/ | `-----' /\n" + " //<- \\ \\----. __ / __ \\\n" + " (| <- | )---|====O)))==) \\) /====\n" + " /'\\ <- _/`\\---' `--' `.__,' \\\n" + " \\___)=(___/ | |\n" + " \\ /\n" + " ______( (_ / \\______\n" + " ,' ,-----' | \\\n" + " `--{__________) \\/\n"; + +const char stego[] = "\\ . .\n" + " \\ / `. .' \" \n" + " \\ .---. < > < > .---.\n" + " \\ | \\ \\ - ~ ~ - / / |\n" + " _____ ..-~ ~-..-~\n" + " | | \\~~~\\.' `./~~~/\n" + " --------- \\__/ \\__/\n" + " .' O \\ / / \\ \" \n" + " (_____, `._.' | } \\/~~~/\n" + " `----. / } | / \\__/\n" + " `-. | / | / `. ,~~|\n" + " ~-.__| /_ - ~ ^| /- _ `..-' \n" + " | / | / ~-. `-. _ _ _\n" + " |_____| |_____| ~ - . _ _ _ _ _>\n"; + +#define NUMCOWS 8 /* Must be a power of 2 */ + +const char *cows[] = { cow, sheep, bunny, koala, beastie, kitty, tuxstab, + stego }; + +void +cowsay(char *msg) +{ + int i; + + printf(" "); + for (i = 0; i < strlen(msg); i++) + printf("_"); + printf("\n< %s >\n ", msg); + for (i = 0; i < strlen(msg); i++) + printf("-"); + i = arc4random() & (NUMCOWS - 1); + printf(cows[i]); +} diff -urN /usr/src/sys/sys/systm.h src/sys/sys/systm.h --- /usr/src/sys/sys/systm.h Thu Apr 28 05:19:50 2005 +++ src/sys/sys/systm.h Mon Aug 22 23:18:44 2005 @@ -124,6 +124,7 @@ struct uio; struct _jmp_buf; +void cowsay(char *); int setjmp(struct _jmp_buf *); void longjmp(struct _jmp_buf *, int) __dead2; int dumpstatus(vm_offset_t addr, off_t count);