EmbeddedRelated.com
Forums
Memfault Beyond the Launch

outputting kernel tty1 input (HID keyboard) also on ttyS0 on ARM Linux target

Started by Microbit_Ubuntu January 14, 2010
Hi group,

While there's some guru activity, a check if anyone can put me back on
track with a Linux question (tried on newbies for days, no avail).

I'm running SAM9-L9260 board with 2.6.31.6 kernel on it.
I'm using buildroot-2009.11, BR2's toolchain arm-linux-gcc
My system console normally is ttyS0.
I'm still using as part of console kernel command :
...console=ttyS0,115200 console=tty1 ..

I've connected a USB HID keyboard and after lots of tracing, figured how
to get it all going on the target (temp solution).

The idea is that I can log in from tty1 and/or ttyS0, and the kernel
output should always print on ttyS0, whether I'm logged in on ttyS0 or
tty1.
At first I thought scancode/keycode was an issue, nope, all OK.

I temporarily solved this by using ttysnoop. I'm running ttysnoops from
my tty1 getty, and /etc/snooptab assigns tty1 as tty and /dev/ttyS0 as
snoopdevice.
After fiddling, this works fine providing :
1. I use 0.12d version.
When I compile and use 0.12d.k26 (kernel 2.6 version) everything
stops working. I find I have to enable legacy PTYS in kernel
regardless. (even enabling getpt() in uClibc no go).
2. The kernel is compiled with system console through Atmel_serial
turned OFF. I can only access Kernel info thru log, but it gets
login on tty1 (USB HID) working.
3. I actually don't get where the client ttysnoop comes in on it :-),
the login started from : getty 38400 tty1 -l /sbin/ttysnoops seems to
do the trick....

Does anyone know of a better solution to get HID keyboard to work on ARM
embedded board ?
The kbd handler is there fine, I have /sys/class/input/input0 & 1, all
OK.

The idea still would be to be able to log in on the HID keyboard ttyX,
but have all kernel traffic go to ttyS0 serial output, regardless.
I first wondered about a pipe, but it seems I must run a handler in user
space then, and I'm back at handling raw scan codes etc. then ????

Any help much appreciated, I've spent days on this and googled till the
cows came home, no go... :-(
--
Best regards,
Kris

On Friday 15 January 2010 03:59:45 am Microbit_Ubuntu wrote:
> Hi group,
>

Hi,

[...]

>
> The idea still would be to be able to log in on the HID keyboard ttyX,
> but have all kernel traffic go to ttyS0 serial output, regardless.
> I first wondered about a pipe, but it seems I must run a handler in user
> space then, and I'm back at handling raw scan codes etc. then ????
>

I always lost in tty stuff myself but I guess here is a confusion about system
login console and kernel console. You want kernel messages on ttyS0 so you
leave kernel command line "console=ttyS0,115200..." and remove "console=tty1".
Then in order to login from tty1, you should put a "getty" on tty1 in your
inittab.

> Any help much appreciated, I've spent days on this and googled till the
> cows came home, no go... :-(
>

I hope I do not confuse it more.

Regards,
Caglar
Hi Caglar,

On Fri, 2010-01-15 at 11:36 +0200, Caglar Akyuz wrote:
> On Friday 15 January 2010 03:59:45 am Microbit_Ubuntu wrote:
> > Hi group,
> > Hi,
>
> [...]
>
> >
> > The idea still would be to be able to log in on the HID keyboard ttyX,
> > but have all kernel traffic go to ttyS0 serial output, regardless.
> > I first wondered about a pipe, but it seems I must run a handler in user
> > space then, and I'm back at handling raw scan codes etc. then ????
> > I always lost in tty stuff myself but I guess here is a confusion about system
> login console and kernel console. You want kernel messages on ttyS0 so you
> leave kernel command line "console=ttyS0,115200..." and remove "console=tty1".
> Then in order to login from tty1, you should put a "getty" on tty1 in your
> inittab.
>
> > Any help much appreciated, I've spent days on this and googled till the
> > cows came home, no go... :-(
> > I hope I do not confuse it more.
>
> Regards,
> Caglar
>
On Thursday 28 January 2010 12:15:01 pm Microbit_Ubuntu wrote:
> Hi Caglar,
>
> On Fri, 2010-01-15 at 11:36 +0200, Caglar Akyuz wrote:
> > On Friday 15 January 2010 03:59:45 am Microbit_Ubuntu wrote:
> > > Hi group,
> >
> > Hi,
> >
> > [...]
> >
> > > The idea still would be to be able to log in on the HID keyboard ttyX,
> > > but have all kernel traffic go to ttyS0 serial output, regardless.
> > > I first wondered about a pipe, but it seems I must run a handler in
> > > user space then, and I'm back at handling raw scan codes etc. then ????
> >
> > I always lost in tty stuff myself but I guess here is a confusion about
> > system login console and kernel console. You want kernel messages on
> > ttyS0 so you leave kernel command line "console=ttyS0,115200..." and
> > remove "console=tty1". Then in order to login from tty1, you should put a
> > "getty" on tty1 in your inittab.
> >
> > > Any help much appreciated, I've spent days on this and googled till the
> > > cows came home, no go... :-(
> >
> > I hope I do not confuse it more.
> >
> > Regards,
> > Caglar
> >
> >
> >
> >
> >
Hi Caglar,

On Thu, 2010-01-28 at 12:50 +0200, Caglar Akyuz wrote:
> On Thursday 28 January 2010 12:15:01 pm Microbit_Ubuntu wrote:
> > Hi Caglar,
> >
> > On Fri, 2010-01-15 at 11:36 +0200, Caglar Akyuz wrote:
> > > On Friday 15 January 2010 03:59:45 am Microbit_Ubuntu wrote:
> > > > Hi group,
> > >
> > > Hi,
> > >
> > > [...]
> > >
> > > > The idea still would be to be able to log in on the HID keyboard ttyX,
> > > > but have all kernel traffic go to ttyS0 serial output, regardless.
> > > > I first wondered about a pipe, but it seems I must run a handler in
> > > > user space then, and I'm back at handling raw scan codes etc. then ????
> > >
> > > I always lost in tty stuff myself but I guess here is a confusion about
> > > system login console and kernel console. You want kernel messages on
> > > ttyS0 so you leave kernel command line "console=ttyS0,115200..." and
> > > remove "console=tty1". Then in order to login from tty1, you should put a
> > > "getty" on tty1 in your inittab.
> > >
> > > > Any help much appreciated, I've spent days on this and googled till the
> > > > cows came home, no go... :-(
> > >
> > > I hope I do not confuse it more.
> > >
> > > Regards,
> > > Caglar
> > >
> > >
> > >
> > >
> > >

Memfault Beyond the Launch