logo
Published on KernelTrap (http://kerneltrap.org)

Linux: Humor In Kernel Code

By Jeremy
Created Jan 4 2003 - 19:25

A recent query on the lkml [1] asked for opinions as to what are "the most frightening pieces of the kernel". The many responses offered more humor than fright, with a handful of snippets that prove entertaining to read through. From colorful metaphors, to burning printers, to happy meals...

I suspect there's plenty of other entertaining pieces of kernel code to be shared. What else have you come across in your own kernel efforts that brought you a smile? Please feel free to post some snippets...


From: Maciej Soltysiak
Subject: [STUPID] Best looking code to transfer to a t-shirt
Date: 	Fri, 3 Jan 2003 14:25:09 +0100 (CET)

Hi,

I am in a t-shirt transfering frenzy and was wondering which part of the
kernel code it would be best to have on my t-shirt.
I was looking at my favourite: netfilter code, but it is to clean, short
and simple functions, no tons of pointers, no mallocs, no hex numbers, too
many defines used. I was looking for something terribly complicated and
looking awesome to the eye.

How about we have a poll of the most frightening pieces of the kernel ?
What are your ideas?

Regards,
Maciej Soltysiak


From: Jose Celestino Subject: Re: [STUPID] Best looking code to transfer to a t-shirt Date: Fri, 3 Jan 2003 13:26:04 +0000 Words by Maciej Soltysiak [Fri, Jan 03, 2003 at 02:25:09PM +0100]: > Hi, > > I am in a t-shirt transfering frenzy and was wondering which part of the > kernel code it would be best to have on my t-shirt. > I was looking at my favourite: netfilter code, but it is to clean, short > and simple functions, no tons of pointers, no mallocs, no hex numbers, too > many defines used. I was looking for something terribly complicated and > looking awesome to the eye. > > How about we have a poll of the most frightening pieces of the kernel ? > What are your ideas? > [root@morgoth:/usr/src/linux]# egrep -ir "( fuck)|( shit)" * and choose. -- Jose Celestino | http://xpto.org/~japc/files/japc-pgpkey.asc [2] ---------------------------------------------------------------- "Don't summarize. Don't abbreviate. Don't interpret." -- djb
From: Matthias Schniedermeyer Subject: Re: [STUPID] Best looking code to transfer to a t-shirt Date: Fri, 3 Jan 2003 15:55:14 +0100 On Fri, Jan 03, 2003 at 02:25:09PM +0100, Maciej Soltysiak wrote: > Hi, > > I am in a t-shirt transfering frenzy and was wondering which part of the > kernel code it would be best to have on my t-shirt. > I was looking at my favourite: netfilter code, but it is to clean, short > and simple functions, no tons of pointers, no mallocs, no hex numbers, too > many defines used. I was looking for something terribly complicated and > looking awesome to the eye. > > How about we have a poll of the most frightening pieces of the kernel ? > What are your ideas? egrep -ir "(on fire)" * drivers/usb/printer.c:static char *usblp_messages[] = { "ok", "out of paper", "off-line", "on fire" }; :-) Bis denn -- Real Programmers consider "what you see is what you get" to be just as bad a concept in Text Editors as it is in women. No, the Real Programmer wants a "you asked for it, you got it" text editor -- complicated, cryptic, powerful, unforgiving, dangerous.
From: Anders Gustafsson Subject: Re: [STUPID] Best looking code to transfer to a t-shirt Date: Fri, 3 Jan 2003 16:03:38 +0100 On Fri, Jan 03, 2003 at 03:55:14PM +0100, Matthias Schniedermeyer wrote: > egrep -ir "(on fire)" * > > drivers/usb/printer.c:static char *usblp_messages[] = { "ok", "out of > paper", "off-line", "on fire" }; A good explanation of that message by Jesse Pollard can be found here: http://marc.theaimsgroup.com/?l=linux-kernel&m=102893054014512&w=2 [3] -- Anders Gustafsson - andersg@0x63.nu [4] - http://0x63.nu/ [5]
From: Rik van Riel [5] Subject: Re: [STUPID] Best looking code to transfer to a t-shirt Date: Fri, 3 Jan 2003 20:58:50 -0200 (BRST) On Fri, 3 Jan 2003, Maciej Soltysiak wrote: > I am in a t-shirt transfering frenzy and was wondering which part of the > kernel code it would be best to have on my t-shirt. > How about we have a poll of the most frightening pieces of the kernel ? How about drivers/net/sunhme.c ? It's not scary, but it is absolutely hilarious, even to people who don't even know C. static void happy_meal_tcvr_write(struct happy_meal *hp, unsigned long tregs, int reg, unsigned short value) { int tries = TCVR_WRITE_TRIES; ASD(("happy_meal_tcvr_write: reg=0x%02x value=%04xn", reg, value)); /* Welcome to Sun Microsystems, can I take your order please? */ if (!hp->happy_flags & HFLAG_FENABLE) return happy_meal_bb_write(hp, tregs, reg, value); /* Would you like fries with that? */ hme_write32(hp, tregs + TCVR_FRAME, (FRAME_WRITE | (hp->paddr From: William Lee Irwin III [5] Subject: Re: [STUPID] Best looking code to transfer to a t-shirt Date: Fri, 3 Jan 2003 15:39:27 -0800 On Fri, Jan 03, 2003 at 02:25:09PM +0100, Maciej Soltysiak wrote: > I am in a t-shirt transfering frenzy and was wondering which part of the > kernel code it would be best to have on my t-shirt. > I was looking at my favourite: netfilter code, but it is to clean, short > and simple functions, no tons of pointers, no mallocs, no hex numbers, too > many defines used. I was looking for something terribly complicated and > looking awesome to the eye. > How about we have a poll of the most frightening pieces of the kernel ? > What are your ideas? sheer bulk: include/asm-ia64/sn/sn2/shub_mmr.h most typedefs: include/asm-ia64/sn/sn2/shub_mmr_t.h bizarre (and ugly) idiom: fs/devfs/*.c just plain ugly: arch/i386/kernel/cpu/mtrr/generic.c really crusty-looking: drivers/char/*tty*.c terrifying ultra-legacyness: drivers/ide/legacy/hd.c fishiness: drivers/usb/serial/pl2303.c why so much code?: drivers/char/dz.c highly cleanup-resistant: mm/slab.c unusual preprocessor games: kernel/cpufreq.c contrived inefficiency: fs/proc/inode.c:proc_fill_super() Bill
From: Ranjeet Shetye To: Subject: RE: [STUPID] Best looking code to transfer to a t-shirt Date: Fri, 3 Jan 2003 16:20:43 -0800 I vote for "panic ()" in kernel/panic.c The panic output makes my heart sink everytime single time. If only the Linux kernel had something as heart-warming as FreeBSD's "diediedie ()". :D Ranjeet Shetye Senior Software Engineer
From: Maciej Soltysiak Subject: RE: [STUPID] Best looking code to transfer to a t-shirt Date: Sat, 4 Jan 2003 14:47:46 +0100 (CET) Thank you all for your suggestions, i found this very entertaining, lot of laughs i must say. Also the ammount of 'shit' and 'fuck' words totally blew me off :) I think i'll put on my t-shirt: - panic() - risc logos (on the sides) - printer "on fire" line (btw. 2.4.20 doesn't have "on fire", just: "unknown error", 2.5.54 has it in drivers/usb/class/usblp.c) - the elegant idle routine - also nice to have. maybe on the back I'll look also through William's suggestions. Thank you all very much. Have a really nice day.


Related Links

  • Slashdot Discussion [7]
  • Related Everything2 Page [8]
  • Comments From Linux Kernel Version 0.01 [9]
  • /* You are not expected to understand this */ [10]

  • Source URL:
    http://kerneltrap.org/node/542