<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style>P {MARGIN-TOP: 0mm; MARGIN-BOTTOM: 0mm}</style>
</head>
<body>
<div style="FONT-FAMILY: 굴림; FONT-SIZE: 10pt" id="ezFormProc_div">
<div id="msgbody">
<div>
<div style="LINE-HEIGHT: 15pt">&nbsp;</div>
<div style="LINE-HEIGHT: 15pt">I tried &quot;console=tty0 console=tty1 console=tty2 &quot; in the boot argument and the prints were coming out both on the LCD and uart console.</div>
<div style="LINE-HEIGHT: 15pt">But after kernel_execve systemcall with /sbin/init, nothing is displayed.</div>
<div style="LINE-HEIGHT: 15pt">&nbsp;</div>
<div style="LINE-HEIGHT: 15pt">And I found that busybox printf seems to be using libraries like glibc.so which contains printf, putchar, puts,..</div>
<div style="LINE-HEIGHT: 15pt">The symbolic links for some .so files including glibc.so were broken in my ramdisk image.</div>
<div style="LINE-HEIGHT: 15pt">Could this be the reason for busybox to not work correctly?
</div>
<div style="LINE-HEIGHT: 15pt">(Now I'm at home and can write the library file to the NAND flash tomorrow)<br>
Maybe not, because busybox works fine using uart console..<br>
<br>
Any help would be deeply appreciated.</div>
<div style="LINE-HEIGHT: 15pt">Chan</div>
<div style="LINE-HEIGHT: 15pt">
<hr tabindex="-1">
</div>
<div style="LINE-HEIGHT: 15pt"><b>From : </b>&quot;김찬&quot; &lt;ckim@etri.re.kr&gt;<br>
<b>Sent : </b>2014-02-26 18:17:53 ( &#43;09:00 )<br>
<b>To : </b>kernelnewbies@kernelnewbies.org &lt;kernelnewbies@kernelnewbies.org&gt;<br>
<b>Cc : </b><br>
<b>Subject : </b>trying to open a shell on LCD with USB keyboard..<br>
<br>
</div>
<style>P {
        MARGIN-TOP: 0mm; MARGIN-BOTTOM: 0mm
}
</style>
<div style="LINE-HEIGHT: 15pt; FONT-FAMILY: 굴림; FONT-SIZE: 10pt" id="ezFormProc_div">
<div id="msgbody">
<div>
<div style="LINE-HEIGHT: 15pt"><br>
Hi, folks!</div>
<div style="LINE-HEIGHT: 15pt">Nice to get to know this email list. I hope I finally arrived to the right group.
</div>
<div style="LINE-HEIGHT: 15pt">( 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..)<br>
</div>
<div style="LINE-HEIGHT: 15pt" id="MailSign"></div>
<div style="LINE-HEIGHT: 15pt">
<p>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..</p>
<p>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..). </p>
<p>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.</p>
<p>&nbsp;</p>
<p>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..)</p>
<p>As you can see, in init/main.c,&nbsp;near the end in init_post function,&nbsp;there is (I'm using linux3.3 by the way)<br>
run_init_process(ramdisk_execute_command);<br>
(In my case, ramdisk_execute_command = &quot;/sbin/init&quot;)</p>
<p>And this immediately calls<br>
kernel_execve(init_filename, argv_init, envp_init);<br>
// above, init_filename and argv_init are &quot;/sbin/init&quot; same. </p>
<p>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.</p>
<p>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.)</p>
<p>&nbsp;</p>
<p>in kernel source directory,</p>
<p>#### arch/sparc/boot/ourprocessor/prom_stage.c : #####<br>
// &quot;console=ttyS,mmio,0xff003000,115200n8 &quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;== serial port case<br>
&quot;console=tty0 &quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;= frame buffer console case (below line too)<br>
&quot;fbcon=font:SUN8x16,map:0 &quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;= Is this boot argment correct?..</p>
<p>&nbsp;</p>
<p>in ramdisk image,</p>
<p>#### /sbin/init: #####<br>
#!/bin/busybox sh<br>
export LD_LIBRARY_PATH=/lib<br>
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/mnt/nand/lib</p>
<p>exec /bin/busybox init<br>
### /etc/init.d/rcS #####<br>
mknod /dev/tty0 c 4 0 &lt;== Do I need to explicitly make tty0 and tty1 like this?<br>
mknod /dev/tty1 c 4 1<br>
mknod /dev/tty2 c 4 2<br>
mknod /dev/tty3 c 4 3<br>
mknod /dev/tty4 c 4 4</p>
<p>### .config #####<br>
CONFIG_FRAMEBUFFER_CONSOLE=y &lt;= LCD/framebuffer console case. Otherwise none.<br>
CONFIG_FONT_SUN8x16=y<br>
CONFIG_LOGO=y</p>
<p><br>
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<br>
tty2::askfirst:/bin/sh<br>
tty3::askfirst:/bin/sh<br>
tty4::askfirst:/bin/sh<br>
(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..
</p>
<p>Any hint would be deeply appreciated.</p>
<p><br>
Thank you in advance.</p>
<p>Chan</p>
<p>&nbsp;</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>