Skip to contentSkip to conversation

Custom serial keyboard: playing dirty with the serial console

DISCUSSION Paolo Scaffardi 3 participants 3 messages Sep 21, 2000

lore
Share & tools
lore
#0 lore raw

We have a custom IR keyboard & mouse, that i have attached to the serial port of my board (i have an embedded powerpc). Its protocol is called 4PPM, and i had to write a driver that intercepts these serial characters, decodes and convert them to standard XT scancodes.

Serial routines were implemented, yet, and i decided to 'insert' my 4PPM layer inside of the serial console driver.

Everything is now ok: i receive correct packets, convert them to XT scancodes and call 'handle_scancode' to process them.

But 'handle_scancode' only prints characters to the console, without apparently processing them. I see everything i write, but when i press enter (scancode 0x1c), i only see a new line in the console, not any new bash prompt.

Why this? Is it correct to intercept the serial console and not returning single characters from inside it but from 'handle_scancode' mode?

Who know that?

THANX!

- may the pinguin b with u -

Have a nice day,
Paolo Scaffardi.
AIRVENT SAM s.p.a. - RIMINI - ITALY

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

#1 lore raw
Quoted 10 lines · Paolo Scaffardi

We have a custom IR keyboard & mouse, that i have attached to the serial port of my board (i have an embedded powerpc). Its protocol is called 4PPM, and i had to write a driver that intercepts these serial characters, decodes and convert them to standard XT scancodes.

Serial routines were implemented, yet, and i decided to 'insert' my 4PPM layer inside of the serial console driver.

Everything is now ok: i receive correct packets, convert them to XT scancodes and call 'handle_scancode' to process them.

handle_scancode() is indeed the correct routine to feed scancodes into the system.

Quoted 7 lines

But 'handle_scancode' only prints characters to the console, without apparently processing them. I see everything i write, but when i press enter (scancode 0x1c), i only see a new line in the console, not any new bash prompt.

Why this? Is it correct to intercept the serial console and not returning single characters from inside it but from 'handle_scancode' mode?

Are you in serial console mode, or in normal console mode?

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

#2 lore raw
In reply to Paolo Scaffardi
Quoted 2 lines

From [email protected] Thu Sep 21 16:18:37 2000

Newsgroups:
Date: Thu, 21 Sep 2000 16:18:37 +0200 (CEST)
From: Michael Schmitz <[email protected]>
To: Paolo Scaffardi <[email protected]>
cc: [email protected]
Subject: Re: Custom serial keyboard: playing dirty with the serial console
Fcc: sent-mail
In-Reply-To: <003601c02397$670ccd60$0a00010a@paoloweb>
Message-ID: <Pine.LNX.4.10.10009211614300.28518@opal.biophys.uni-duesseldorf.de>
X-Reply-UID: (2 > )(1 940426103 5996)/home/opal/schmitz/mail/linuxppc-dev
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII

Quoted 10 lines

Everything is now ok: i receive correct packets, convert them to XT scancodes and call 'handle_scancode' to process them.

But 'handle_scancode' only prints characters to the console, without apparently processing them. I see everything i write, but when i press enter (scancode 0x1c), i only see a new line in the console, not any new bash prompt.

Why this? Is it correct to intercept the serial console and not returning single characters from inside it but from 'handle_scancode' mode?

I don't think so - serial console is supposed to be used with terminals or terminal emulators which send ASCII codes not scancodes. Try to directly call handle_scancode (possibly via some glue code like keyboard_input for ADB) from the serial interrupt without going over the tty line discpline.

Michael

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/