trying to open a shell on LCD with USB keyboard..

김찬 ckim at etri.re.kr
Wed Feb 26 08:49:18 EST 2014


I tried "console=tty0 console=tty1 console=tty2 " in the boot argument and the prints were coming out both on the LCD and uart console.
But after kernel_execve systemcall with /sbin/init, nothing is displayed.

And I found that busybox printf seems to be using libraries like glibc.so which contains printf, putchar, puts,..
The symbolic links for some .so files including glibc.so were broken in my ramdisk image.
Could this be the reason for busybox to not work correctly?
(Now I'm at home and can write the library file to the NAND flash tomorrow)
Maybe not, because busybox works fine using uart console..

Any help would be deeply appreciated.
Chan
________________________________
From : "김찬" <ckim at etri.re.kr>
Sent : 2014-02-26 18:17:53 ( +09:00 )
To : kernelnewbies at kernelnewbies.org <kernelnewbies at kernelnewbies.org>
Cc :
Subject : trying to open a shell on LCD with USB keyboard..


Hi, folks!
Nice to get to know this email list. I hope I finally arrived to the right group.
( I posted my question on stackoverflow 2 weeks ago but there's no reply. I'm analyzing the console-related code, it's too complex..)

I'm trying to bring up virtual terminal on our embedded system's LCD usnig USB keyboard which is also connected to the system. I have UART connection to my PC so I've been using UART for console till now but I want to switch to framebuffer console on LCD during the boot at some point..

The USB host controller seems to work fine because I've seen USB memory is attached, read and written ok. And when I connect a keyboard and print the events at keyboard_event function, it prints events that seem normal and corresponding to my action(type of key, press or release..).

The problem is that when I configure the framebuffer console in, I cannot see the prints from the busybox code. Maybe our system could have a problem in framebuffer driver (but we can run a application using the framebuffer /dev/fb0) with it not fully supporting framebuffer console.



But I have another feeling that it might be just a configuration problem. (So I want to know the right configuration at least to concentrate further..)

As you can see, in init/main.c, near the end in init_post function, there is (I'm using linux3.3 by the way)
run_init_process(ramdisk_execute_command);
(In my case, ramdisk_execute_command = "/sbin/init")

And this immediately calls
kernel_execve(init_filename, argv_init, envp_init);
// above, init_filename and argv_init are "/sbin/init" same.

I expect busybox to run after this.. (ramdisk had been installed before by a bootloader-like part) but I cannot see any prints on the LCD after this point. But I can see printks on the LCD until just before calling kernel_execve above. I'm using linux 3.3.

I understand I have to open a frame buffer console on LCD and connect it to a tty but I don't know how. Below are printed the current releavant settings. (In serial UART connection case, linux boots ok up to the final busybox shell prompt printing things in busybox initialization after kernel_execve call. and #cat /proc/fb0 returns 0 for your info. Only LCD/framebuffer console mode stops after kernel_execve.)



in kernel source directory,

#### arch/sparc/boot/ourprocessor/prom_stage.c : #####
// "console=ttyS,mmio,0xff003000,115200n8 "        <== serial port case
"console=tty0 "                        <= frame buffer console case (below line too)
"fbcon=font:SUN8x16,map:0 "               <= Is this boot argment correct?..



in ramdisk image,

#### /sbin/init: #####
#!/bin/busybox sh
export LD_LIBRARY_PATH=/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/mnt/nand/lib

exec /bin/busybox init
### /etc/init.d/rcS #####
mknod /dev/tty0 c 4 0 <== Do I need to explicitly make tty0 and tty1 like this?
mknod /dev/tty1 c 4 1
mknod /dev/tty2 c 4 2
mknod /dev/tty3 c 4 3
mknod /dev/tty4 c 4 4

### .config #####
CONFIG_FRAMEBUFFER_CONSOLE=y <= LCD/framebuffer console case. Otherwise none.
CONFIG_FONT_SUN8x16=y
CONFIG_LOGO=y

By the way, I'm not using /etc/inittab.(so use default init). The busybox init/init.c code says if there isn't the inittab file and console is not the serial port, it runs
tty2::askfirst:/bin/sh
tty3::askfirst:/bin/sh
tty4::askfirst:/bin/sh
(starting shell on tty 2, 3 and 4) then How do make tty2's shell appear on the LCD/framebuffer/framebuffer console? It's confusing and books are not so kind..

Any hint would be deeply appreciated.

Thank you in advance.

Chan


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140226/82d38d8a/attachment.html 


More information about the Kernelnewbies mailing list