Re: Kernel messages...

Paul Gortmaker (linux@rasty.ph.unimelb.edu.au)
Thu, 14 May 1998 23:58:18 +1000 (EST)


> Has anyone given any thought to the idea of pulling kernel messages out of
> the kernel binary itself, and using numerical referencing for them
> instead, in an attempt to see how much space would be preserved in the
> final kernel image?

Rough guess, based on 2.1.101 kernel:
# strings -n8 `find . -name '*.o'` | wc -c
168467
(Note some of that already gets tossed via __initfunc)

> What I'm thinking of is possibly a module (which could be compiled into
> the kernel, of course) which handles the translation of numerical kernel
> messages to their string equivilents, with a hook in printk to handle the
> communication with that piece.
>
> Alternatively, no textual messages in the kernel at all, and offload the
> translation functionality to syslog, using something akin to System.map to
> register the mapping of value to message text.

Linux-lite kind of does this -- in that it does it for panic("...");
messages but not printk("..."); messages. (I figured the printk's are
something you really can't do without, but if you panic you are screwed
anyways, and you can look things up in System.map after rebooting.) So
a panic simply prints "kernel panic at 0xNNNNNN" and nothing else.
Some semi-clever macro trickery limits the change to a couple of files
and ensures GCC tosses out all the strings.

I might even have a patch to v2.0 floating around that does this.

Paul.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu