[lkml]   [1997]   [Jan]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Jive -> Kernel (International Linux)
On Sat, 18 Jan 1997, William Sowerbutts wrote:

> At 23:16 17/01/97 +0000, Philip Blundell wrote:
> >On Thu, 16 Jan 1997, William Sowerbutts wrote:
> >> Of course, I've no idea how to code this, I'm not a kernel hacker ;) Maybe
> >> an "enhanced_printk" type function? This would allow existing kernel code
> >> to function, but new code could supplement the existing code. The
> >> enhanced_printk function could be implemented merely as a wrapper around
> >> the existing printk?
> >
> >You could do this with modules. Create a global variable
> >printk_language_hook, which defaults to NULL. Then amend printk() to say:
> >
> >asmlinkage int printk(const char *fmt, ...)
> >{
> > [...]
> > if (printk_language_hook)
> > fmt = printk_language_hook(fmt);
> > [...]
> >}
> >
> >Thus, you can load modules that define printk_language_hook to be a
> >pointer to some function that substitutes the original English text with
> >something in the chosen language. You'd have to deal with parameters
> >somehow, I suppose...
> Yes, but this would mean overriding EVERY message the kernel was likely to
> give. I still think it's unreasonable to expect every message to be

Not necessarily. The `locale module' that one loaded could just have a
list of (original English message, translated message) tuples, with some
hashing function to let it do quick lookups. printk() doesn't happen very
often, so performance wouldn't be that much of an issue, and you'd just
have to accept the memory drain. Then if there was no match in the locale
it would just return the original string.

> defaults for others. How could we implement this on a per-user basis?

You can't. Kernel messages aren't directed to a user. Per-machine is all
the granularity you can get.

Frankly, I'm not sure that the idea is particularly worthwhile, but we'll


 \ /
  Last update: 2005-03-22 13:38    [W:0.051 / U:0.488 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site