Please help.. trying to use USB keyboard to open a shell on LCD display

Chan Kim ckim at etri.re.kr
Sun Mar 16 20:11:54 EDT 2014


There is no reponse yet to this question.. any help/hint would be appreciated.
I found that I may have to use getty in the /etc/inittab file to get tty for a vc.
For busybox, the example in init/init.c suggests entries like
tty4::respawn:/sbin/getty 38400 tty4

I earlier found the keyboard seems to be connected to tty1 and the printk output is switched to tty1 towards the end during the initialization. So I tried in the inittab
tty1::respawn:/sbin/getty 38400 tty1
and
1::respawn:/sbin/getty 38400 tty1
But didn't work.
I know how to start a shell on tty1 (using inittab). But How do I map tty1 to the vc and to the LCD using boot argument or busybox setting? This seems to be the key question.
Thansk,
Chan

________________________________
From : "Kim Chan" <ckim at etri.re.kr>
Sent : 2014-03-12 15:31:17 ( +09:00 )
To : kernelnewbies at kernelnewbies.org <kernelnewbies at kernelnewbies.org>
Cc :
Subject : Please help.. trying to use USB keyboard to open a shell on LCD display


Hello, folks,



It is a comfort to me that I have people to ask questions here and I hope I could be answering to some hard quetions someday.

I've beeing trying to attach a USB keyboard to our embedded system to open a shell on the LCD display using framebuffer console. The USB host controller is from the opencore(USB1.1) and it works for USB memory.

Some of the boot arguments are (I've tried some variants)

"console=tty1 "
"fbcon=map:0000,font:SUN8x16,vc:1-3 "
"root=/dev/ram "



The problem is, after the final sys_execve() which executes /sbin/init of the ramdisk, I cannot see any printf results frome the busybox init_main function not to mention the shell. So I cannot use shell commands like getty. Using uart as the console I can see printf results in the busybox init_main routine. (I use "console=ttyS,mmio,0xff003000,115200n8 " in that case)

Using some prints on separate uart print routine, I can see from the kbd_event function that the key value is going to current vc which is using tty1. The key value is then handed to put_queue function where the character is somehow copied to tty buffer. Flush_to_ldisc is scheduled for it and it will probably get passed on to the virtual console. By the way, I guess the keyboard data is delivered to current fg_console (vc 0 which is using tty1).



Added to this, there is a notifier_call_chain and the notifier block is registered by vcs_poll_data_get function which I don't know weather is necessary or not. So one of my questions is if vcs is necessary for my case. (I guess not. There is no other notifier blocks registered)



I gathered that without inittab (I don't use inittab which should be ok for most cases) the assumed default inittab tty2::askfirst:-/bin/sh tty3::askfirst:-/bin/sh tty4::askfirst:-/bin/sh is being applied by the busybox so there maybe 3 shells on tty2,tty3, and tty4 running somewhere.

But even if there are shells running I don't know how to switch to those ttys. I tried using Ctrl-Alt F2 (or F3, F4) using the USB keyboard to switch to tty2,3,4 to see if any shell comes up on the LCD but couldn't see it.

I tried using inittab with no avail before.



And I don't know how the printf in busybox is connected to the kernel.  I guess busybox talks with stdio(stdout,stdin..) and the file is connected to the kernel anyhow. I've digged up how vc driver is connected to the console switch functions and to the bit blitting functions and how the printk is handled in the kernel. But these console, tty, framebuffer console.. things are very complex to me. and I hope somebody could point me to what should be checked. Any hint will be deeply appreciated.



Best Regards,

Chan
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org<mailto:Kernelnewbies at kernelnewbies.org>
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140317/64cab90f/attachment.html 


More information about the Kernelnewbies mailing list