Reviving linux-tiny
Posted Sep 27, 2007 20:33 UTC (Thu) by
moxfyre (subscriber, #13847)
In reply to:
Reviving linux-tiny by felixfix
Parent article:
Reviving linux-tiny
> Why not change all printk to a message number and parameters, and bundle all messages into the source tree only? Waaaay back in mainframe days, you had to look up errors by number for just that reason. I realize it wouldn't be as handy, but for the ones that only developers care about, wouldn't that be good enough? I suppose you could have a build-time option to include the full text, but wouldn't most production system be better off with just a message ID?
I think that's a pretty good idea! For embedded systems, the console is usually a serial port connected to a desktop computer. That computer could run a translator that would simply convert the numeric codes to strings, so the user would see the same thing.
For example, the embedded system might send out a kernel message like:
0xDEADBEEF,/dev/hda,123
... and the translator would convert that to:
<CRITICAL>sata-driver: CRC error on /dev/hda in block 123
Basically, you'd be compressing the kernel by converting human-readable strings to 32-bit numbers. The numbers wouldn't even have to be globally unique! Just unique to that particular kernel build! When you built a kernel for such a system, in addition to a bzImage you would get a Strings.db file. Put the bzImage into the device firmware, and give Strings.db to your serial console translator... voila, ready to debug. This could be a really seamless solution.
(
Log in to post comments)