Re: Boot messages (Was: Re: Ideas for v2.1) (fwd)

John Sullivan (js10039@thor.cam.ac.uk)
Sun, 23 Jun 1996 16:39:40 +0100


In article <4qef89$8n@melchior.cuivre.fdn.fr>,
Thomas Quinot <thomas@cuivre.fdn.fr> wrote:
>Now can we *please* drop this whole messages/animation/penguin noise
>and get back to real development ?

>[patch with quoted-printable corruption snipped]

Hey - who says the penguin business is just noise and not real
development?

I now present to you, a real live penguin boot-logo, with the
following caveats:
o It's a complete hack. Use at your own risk.
o It does some nasty things to vga hardware, so although it will
probably work on most vga compatible hardware, ega may be
be pushing it a little. Working over a serial console is right
out - don't even try it.
o Other than that, dunno. Should work. I like it. YMMV.
The logo is the official Larry Ewing one.

John

-- 
i built it up now i take it apart climbed up real high now fall down real far
no need for me to stay the last thing left i just threw it away
i put my faith in god and my trust in you
now there's nothing more fucked up i could do
<p><a href="file:///dev/null">Me.</a>

*** linux/init/main.c.orig Mon May 20 18:33:57 1996 --- linux/init/main.c Wed Jun 19 21:50:37 1996 *************** *** 63,68 **** --- 63,70 ---- extern void init_IRQ(void); extern void init_modules(void); extern long console_init(long, long); + extern void install_bootlogo(void); + extern void remove_bootlogo(void); extern long kmalloc_init(long,long); extern void sock_init(void); extern long pci_init(long, long); *************** *** 797,802 **** --- 809,815 ---- memory_start += prof_len * sizeof(unsigned int); } memory_start = console_init(memory_start,memory_end); + install_bootlogo(); #ifdef CONFIG_PCI memory_start = pci_init(memory_start,memory_end); #endif *************** *** 959,964 **** --- 975,982 ---- (void) open("/dev/tty1",O_RDWR,0); (void) dup(0); (void) dup(0); + + remove_bootlogo(); if (!execute_command) { execve("/etc/init",argv_init,envp_init); *** linux/drivers/char/console.c.orig Wed Jun 19 21:37:59 1996 --- linux/drivers/char/console.c Sat Jun 22 12:40:38 1996 *************** *** 88,93 **** --- 88,94 ---- #include <linux/sched.h> #include <linux/timer.h> #include <linux/interrupt.h> + #include <linux/delay.h> #include <linux/tty.h> #include <linux/tty_flip.h> #include <linux/config.h> *************** *** 181,186 **** --- 182,190 ---- static int blankinterval = 10*60*HZ; static int vesa_off_interval = 0; static long blank_origin, blank__origin, unblank_origin; + int pengon=0; + void plot_penguin(void); + void unplot_penguin(void); #ifdef CONFIG_SERIAL_ECHO *************** *** 591,596 **** --- 595,601 ---- if (b > video_num_lines || t >= b) return; + if (pengon) unplot_penguin(); if (t || b != video_num_lines) hardscroll = 0; if (hardscroll) { *************** *** 645,650 **** --- 650,656 ---- scr_writew(video_erase_char, d++); } } + if (pengon) plot_penguin(); } void *************** *** 2310,2312 **** --- 2316,2565 ---- { return set_get_font (arg,0,video_mode_512ch); } + + + /* + * Penguin boot-logo (grotty hack, use at own risk) + * July 1996 J Sullivan <js10039@chiark.chu.cam.ac.uk> + * + * Logo graphic by Larry Ewing for Linux 2.0 + */ + + #define PENG_H 118 + #define PENG_W 8 + #define PENGC (color_table[12]) + unsigned char pengfnt[944] = + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x01\x03\x1f\x60\x60\x60\x60\x70\x70\x70" + "\x60\x60\x40\x70\x1f\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x3f\x3f\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e\x0e" + "\x0e\x0e\x3f\x00\x00\x00\x00\x00\x00\x00\x0f\x3f\x3f\x3f\x3f\x3f" + "\x3f\x3f\x3e\x18\x10\x00" + + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x01\x01\x03\x07\x07\x07\x0f\x0f\x1f\x1f\x1f\x3f\x3f\x3f" + "\x7f\x7f\x7f\x07\x03\x81\x80\x80\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x80\xf8\x3f\x07\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x80\x80\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x0c" + "\x0c\x0c\xfd\x00\x00\x00\x00\x00\x03\xff\xff\xff\xff\xff\xff\xfe" + "\xf0\x80\x00\x00\x00\x00" + + "\x00\x00\x00\x01\x01\x03\x03\x03\x07\x07\x07\x07\x07\x07\x06\x07" + "\x07\x07\x07\x07\x07\x07\x07\x03\x03\x07\x0e\x0e\x1c\x3c\x3c\x78" + "\x78\xf8\xf8\xf0\xf0\xf0\xe0\xe0\xc0\xc0\xc0\x80\x80\x80\x80\x80" + "\x80\x80\x00\x80\xc0\xe0\xf0\x78\x7c\x3f\x1f\x1f\x0f\x07\x06\x03" + "\x03\x01\x01\x01\x03\x03\x9f\xff\xfc\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x60\xf0\xf0\x60\x00\x00\xf3\xf3\x70\x70\x70\x70\x70\x70" + "\x70\x70\xfb\x00\x00\x00\x00\x01\xff\xff\xff\xff\xff\xff\xe0\x00" + "\x00\x00\x00\x00\x00\x00" + + "\x00\x3f\x7f\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1f\x5f\xff\xee" + "\xee\xf3\x80\x00\x00\x00\x80\xff\xf8\xe1\x7f\x3e\x18\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x80\x00\x00\x00" + "\x60\xff\xbf\xbf\xff\xff\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xe1\xe1\xe1\xe1\xe1\xe1" + "\xe1\xe1\xf3\x00\x00\x00\x00\xff\xff\xff\xff\xff\xf8\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00" + + "\x00\xc0\xf8\xff\xff\xf7\xff\xff\xff\xff\xff\xcf\x07\x77\x73\x6b" + "\x7b\x7b\x1f\x07\x03\x1b\xe3\x17\xf7\xc3\x81\x01\x01\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x07" + "\x1f\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x87\xcf\xc3\xc3\xc3\xc3\xc3\xc3" + "\xc3\xc3\xf1\x00\x00\x00\x03\xff\xff\xff\xff\xf0\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00" + + "\x00\x00\x00\x00\x00\x80\xc0\xc0\xe0\xe0\xe0\xe0\xe0\xe0\xe0\xf0" + "\xf0\xf0\xf0\xf0\xf0\xf8\xf8\xbc\xdc\xfe\xfe\xff\xff\xff\xff\x7f" + "\x7f\x3f\x3d\x1e\x1e\x1f\x0f\x0f\x0f\x0f\x0f\x07\x07\x07\x07\x07" + "\x02\x03\x07\x1f\x37\x33\x23\x21\x20\x20\x20\x30\x30\xb0\xb0\xb0" + "\xf0\xf0\xf0\xe0\xf0\xf0\xfc\x3f\x1f\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x8f\x8f\x87\x87\x87\x87\x87\x87" + "\x87\xff\xf7\x00\x00\x00\xff\xff\xff\xff\xf0\x00\x78\xcc\x4c\x08" + "\x18\x30\x44\xfc\x00\x00" + + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x80\xc0\xc0" + "\xe0\xf0\xf0\xf8\xfc\xfc\xfe\xfe\xbe\xbe\xbf\xbf\xbf\xbf\xff\x7f" + "\x3f\xff\xff\xff\xfe\xfc\xf8\xf0\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x01\x07\x0e\x3c\xf0\xe0\xc0\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x3f\x0e\x07\x07\x03\x01\x01\x03" + "\x06\x0c\xfe\x00\x00\x00\xff\xff\xff\xf0\x00\x00\x0f\x19\x19\x19" + "\x19\x19\x99\xcf\x00\x00" + + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x80" + "\x80\x80\x00\x00\x00\x00\x80\xc0\x40\x40\x60\x78\x1c\x06\x02\x06" + "\x1c\x70\xe0\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00\x3c\x18\x30\xe0\xc0\xc0\xe0\xf0" + "\x78\x38\x7e\x00\x00\x00\xfe\xfc\xc0\x00\x00\x00\x00\x80\x80\x80" + "\x80\x80\x80\x00\x00\x00" + ; + + unsigned char pengofnt[(PENG_H+32)*PENG_W],olfnt[16384]; + unsigned short olscr[PENG_W*((PENG_H+7)/8)]; + unsigned char pengop[17][3]; + int penguon=0,pengych,pengrch,peng9px; + + static inline void pdelay(unsigned long q) + { + unsigned long b,c; + + for ( b=0 ; b<q ; b++ ) for ( c=0 ; c<1 ; c++ ) SLOW_DOWN_IO; + } + + void install_bootlogo(void) + { + int a,b,scan,ch; + + if (pengon) return; + + con_get_font(olfnt); + pengrch = 0; + for ( a=0,scan=0,ch=0x80 ; a<PENG_H ; a++,scan++ ) { + if (scan==video_font_height) { + scan=0; + ch += PENG_W; + if (a>=80 && !pengrch) pengrch = (ch-0x80)/PENG_W; + } + for ( b=0 ; b<PENG_W ; b++ ) { + pengofnt[PENG_H*b+a] = olfnt[32*(ch+b)+scan]; + olfnt[32*(ch+b)+scan] = pengfnt[PENG_H*b+a]; + } + } + while (scan<video_font_height) { + for ( b=0 ; b<PENG_W ; b++ ) { + pengofnt[PENG_H*b+a] = olfnt[32*(ch+b)+scan]; + olfnt[32*(ch+b)+scan] = 0; + } + scan++; + a++; + } + pengych = ((ch+PENG_W)-0x80)/PENG_W; + + con_set_font(olfnt,video_mode_512ch); + outb(1,0x3c4); + peng9px = inb(0x3c5); + if ((peng9px&1)==0) { + unsigned char t; + outb(1,0x3c4); + outb(peng9px ^ 1,0x3c5); + inb(0x3da); + outb(0x13,0x3c0); + t = inb(0x3c1); + inb(0x3da); + outb(0x33,0x3c0); + inb(0x3c1); + inb(0x3da); + outb(0x13,0x3c0); + outb(t&0xf0,0x3c0); + inb(0x3da); + outb(0x33,0x3c0); + outb(t&0xf0,0x3c0); + peng9px = 1; + } else peng9px = 0; + pengon = 1; + penguon = 0; + plot_penguin(); + if (peng9px) pdelay(250000); + con_get_cmap((unsigned char *)pengop); + for ( b=0 ; b<3 ; b++ ) pengop[16][b] = pengop[PENGC][b]; + for ( ; pengop[PENGC][0]>3 ; pengop[PENGC][0]-=4 ) { con_set_cmap((unsigned char *)pengop); pdelay(1000); } + for ( ; pengop[PENGC][1]<252 ; pengop[PENGC][1]+=4 ) { con_set_cmap((unsigned char *)pengop); pdelay(1000); } + for ( ; pengop[PENGC][1]>3 ; pengop[PENGC][1]-=4 ) { con_set_cmap((unsigned char *)pengop); pdelay(1000); } + for ( ; pengop[PENGC][2]<252 ; pengop[PENGC][2]+=4 ) { con_set_cmap((unsigned char *)pengop); pdelay(1000); } + for ( ; pengop[PENGC][2]>3 ; pengop[PENGC][2]-=4 ) { con_set_cmap((unsigned char *)pengop); pdelay(1000); } + for ( ; pengop[PENGC][0]<pengop[16][0] ; pengop[PENGC][0]+=4 ) { con_set_cmap((unsigned char *)pengop); pdelay(1000); } + for ( b=0 ; b<3 ; b++ ) pengop[PENGC][b] = pengop[16][b]; + con_set_cmap((unsigned char *)pengop); + } + + void plot_penguin(void) + { + int currcons=fg_console; + int a,b; + void *vp; + unsigned short *sp,wcv; + + if (!pengon || penguon) return; + + vp = (void *)origin + 2*video_num_columns - 2*PENG_W; + sp = olscr; + wcv = 0x7080; + + for ( a=0 ; a<pengych ; a++ ) { + if (a==pengrch) wcv = 0x7c00|(wcv&0xff); + for ( b=0 ; b<2*PENG_W ; b+=2 ) { + *sp++ = scr_readw(vp+b); + scr_writew(wcv++,vp+b); + } + vp += 2*video_num_columns; + } + penguon = 1; + } + + void unplot_penguin(void) + { + int a,b,currcons=fg_console; + void *vp; + unsigned short *sp; + + if (!pengon || !penguon) return; + + vp = (void *)origin + 2*video_num_columns - 2*PENG_W; + sp = olscr; + + for ( a=0 ; a<pengych ; a++ ) { + for ( b=0 ; b<2*PENG_W ; b+=2 ) { + scr_writew(*sp++,vp+b); + } + vp += 2*video_num_columns; + } + penguon = 0; + } + + void remove_bootlogo(void) + { + int a,b,scan,ch; + + if (!pengon) return; + + unplot_penguin(); + for ( a=0,scan=0,ch=0x80 ; ch<pengych+0x80 ; a++ ) { + for ( b=0 ; b<PENG_W ; b++ ) { + olfnt[32*(ch+b)+scan] = pengofnt[PENG_H*b+a]; + } + if (++scan==video_font_height) { + scan = 0; + ch += PENG_W; + } + } + con_set_font(olfnt,video_mode_512ch); + if (peng9px) { + unsigned char t; + + outb(1,0x3c4); + peng9px = inb(0x3c5); + outb(1,0x3c4); + outb(peng9px ^ 1,0x3c5); + inb(0x3da); + outb(0x13,0x3c0); + t = inb(0x3c1); + inb(0x3da); + outb(0x33,0x3c0); + inb(0x3c1); + inb(0x3da); + outb(0x13,0x3c0); + outb((t&0xf0)|8,0x3c0); + inb(0x3da); + outb(0x33,0x3c0); + outb((t&0xf0)|8,0x3c0); + udelay(1000000); + } + pengon = 0; + } + +