Skip to contentSkip to conversation

Stop printk printing non-printable chars

PATCH Albert Cahalan 3 participants 3 messages Jun 20, 2004

lore
Share & tools
lore
#0 lore raw
Quoted 10 lines
Quoted 3 lines

It is dangerous to let the 0x9b character go out to a serial console. It means the same as ESC [ does when you have a normal 8-bit terminal.

Get real: either you *want* to get those codes interpreted (think about full-blown ncurses apps being run over serial link), or you *don't* (think about simply recording serial console's output). You just have to choose the correct application for your task.

If there are full-blown ncurses apps being routed through printk -- that is, the KERNEL log -- then we have far bigger issues.

The 0x9b character must be blocked, at least when a serial console is in use. (apps on such a console may of course use 0x9b as desired -- just not printk)

#1 lore raw
Quoted 1 line · Albert Cahalan

The 0x9b character must be blocked,

Why do you say 'must be blocked' instead of 'should not be printed'?

The former implies some kind of post-processing to work around buggy kernel code printing crap. Surely it's better just to refrain from printing the crap in the first place?

Btw, your replies lack a correct References: and In-Reply-To: header, in violation of a 'SHOULD' in RFC2822 §3.6.4. Please fix this if you wish to participate in public fora.

Signature · 1 line
dwmw2
#2 lore raw
In reply to Albert Cahalan

On Sun, 2004-06-20 00:02:58 -0400, Albert Cahalan <[email protected]> wrote in message <1087704177.8185.951.camel@cube>:

Quoted 10 lines
Quoted 6 lines

Get real: either you *want* to get those codes interpreted (think about full-blown ncurses apps being run over serial link), or you *don't* (think about simply recording serial console's output). You just have to choose the correct application for your task.

If there are full-blown ncurses apps being routed through printk -- that is, the KERNEL log -- then we have far bigger issues.

You're right, I mixed up the ways for console output and for userspace apps using a shell over the very same serial line (what I commonly do).

Quoted 3 lines

The 0x9b character must be blocked, at least when a serial console is in use. (apps on such a console may of course use 0x9b as desired -- just not printk)

I still don't see a need to filter out *anything*. To be exact, I've seen other places where a \r is added when a \n occures. Not always a great idea, too... Just keep it as it is, I think it's fine...

MfG, JBG

Signature · 4 lines
   Jan-Benedict Glaw       [email protected]    . +49-172-7608481
   "Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg
    fuer einen Freien Staat voll Freier Bürger" | im Internet! |   im Irak!
   ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));