Question

(Wow it took me a while to post this question because of the formatting problem coming from special characters..)

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..)

I have a feeling that it's a configuration problem. In init/main.c, there is
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.)

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

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

exec /bin/busybox init
### 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.

Was it helpful?

Solution

This question was solved months ago and I forgot to answer to this question myself. Adding CONFIG_FRAMEBUFFEr and CONFIG_FBCONSOLE and setting console=ttyS,.. was all that is necessary. In my case, I had another bug in DMA that was causing the frambe buffer console's text not appear on the LCD. So I can use 3 virtual consoles on the LCD (switch using Alt-F2, Alt-F3, .. ) by default. Long storyg short, console is a console(on serial port), and we have 3 (by default busybox setting) virtual console on the LCD.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top