Re: Kernel Language support

Peter T. Breuer (ptb@it.uc3m.es)
Sun, 19 Jan 1997 17:10:38 +0000 (WET)


"A month of sundays ago Alan Cox wrote:"
> > FWIW, I liked the idea about the
> > #define ERROR_CONDITION "Error Condition";
> > printk(KERN_LEVEL, ERROR_CONDITION);
>
> The problem is almost that what you need to be able to do is tell gcc
> that printk's argument lives in a different segment via an indirect pointer.
> I'm not sure if there is enough gcc magic to do that

Pardon me for asking, but shouldn´t it just be printk that lives in the
different segment - along with all its strings, of course.

I was imagining a kernel module called "printk.o". The kernel hardly
ever needs to use it so it can be as expensive to use as you like.
Just put printk in the exported symbols list, then do the following:

1) make a list of all current printk´s
2) number the above and replace each printk with printk(KEN_LEVEL, n)
3) in the printk module make printk a big switch statement, or
something more intelligent.

---------------------------------------------------------------------
Peter T. Breuer Phd. Ing.,
Area de Ingenieria Telematica E-mail: ptb@it.uc3m.es
Dpto. Ingenieria Tel: +34 1 624 99 47
Universidad Carlos III de Madrid Fax: +34 1 624 94 30/65
Butarque 15, E-28911 Leganes URL: http://www.it.uc3m.es/~ptb
Spain