ARM-Linux的启动的信息显示到framebuffer

来源:互联网 发布:windows 7 loader 3.1 编辑:程序博客网 时间:2024/06/17 18:52

Origin of question: 
When porting linux in imx27ads, uart serial port is usually used as console. I would like to know if I can have kernel booting message output on both of serial console and framebuffer console or switch from serial console to framebuffer console.

The way to Rome: 
1. Configure the kernel and enable the framebuffer as console device like this (take imx27ads kernel for example): 
CONFIG_FB=y 
CONFIG_FB_CFB_FILLRECT=y 
CONFIG_FB_CFB_COPYAREA=y 
CONFIG_FB_CFB_IMAGEBLIT=y

CONFIG_FB_MXC=y 
CONFIG_FB_MXC_SYNC_PANEL=y

CONFIG_DUMMY_CONSOLE=y 
CONFIG_FRAMEBUFFER_CONSOLE=y

CONFIG_FONT_8x8=y 
CONFIG_FONT_8x16=y

CONFIG_LOGO=y 
CONFIG_LOGO_LINUX_CLUT224=y

CONFIG_VT=y 
CONFIG_VT_CONSOLE=y

2. Pass right console parameters to kernel by kernel command line 
1) Only the uart1 as console 
console=ttymxc0,115200 
2) Only the framebuffer device as console 
console=tty0 
3) Both the framebuffer device and the uart1 as consoles and the uart1 takes input console 
console=tty0 console=ttymxc0,115200 
Actually, this will ensure that the boot messages are displayed on both the framebuffer (/dev/tty0) and the serial console (/dev/ttyS0); the last device named in a console= option will be the one that takes input, too, so with the settings above you can use the serial console to enter commands etc. For a more detailed description see http://www.tldp.org/HOWTO/Remote-Serial-

 

配置选项设置了:

Virtual terminal 
Support for console on virtual terminal

之后,就能够在液晶屏上看到小企鹅和控制台输出的启动信息了。这时超级终端上就看不到任何输出,也不能通过计算机的键盘输入任何东西了。 
因为fb0已经取代了ttyS0设备作为console的。 但是此时fb0设备是不能够进行输入, 怎样用fb0作为virtual terminal的输出设备同时用ttyS0作为virtual terminal的输入设备呢?


我在做lcd驱动的时候正好碰到这个问题作个总结:

首先我想把从ttyS0接受到的东东show到lcd上面上去,这样不就可以用我的pc键盘实现控制lcd的控制台了吗,于是我在init里面写了,sh < /dev/ttyS0 ,不幸的是我的sh根本不解析<啊,sash的功能不全啊,把这句话直接就打印出来了,晕!于是我换了busybox,现编的,以前没用过,鼓求了半天,在busybox执行的脚本中我还忘了加上#!/bin/sh 了,同事提醒了我,因为我一直用sash的init,所以习惯了,呵呵,修改了之后加上msh < /dev/ttyS0,就一且ok了。现在lcd驱动写好了,console的问题也差不多了:)

原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 幼儿园小朋友不爱写字怎么办 孩子懒散不积极怎么办 孩子不肯上幼儿园怎么办 孩子不肯去幼儿园怎么办 小孩记不住字怎么办 小孩不会写字要怎么办 一年级孩子不爱写字怎么办 一年级小孩不爱写字怎么办 孩子不爱写字怎么办呢 幼儿园孩子不爱写字怎么办 孩子上学没学籍怎么办 孩子上学务工证怎么办 孩子上学被欺负怎么办 孩子害怕上幼儿园怎么办 孩子写字肩膀疼怎么办 5岁不会写字怎么办 上中班不爱写字怎么办 孩子性子太慢怎么办 13小孩特别懒怎么办 小孩不肯上幼儿园怎么办 宝宝不肯上幼儿园怎么办 宝宝不肯去幼儿园怎么办 小孩子不肯去幼儿园怎么办 上幼儿园不说话怎么办 小孩写字不认真怎么办 游戏打开是乱码怎么办 小孩不写字该怎么办 小孩不喜欢穿袜子怎么办 宝宝不喜欢穿袜子怎么办 看到婆婆就烦怎么办 什么也不想吃怎么办 宝宝不喜欢带围兜怎么办 宝宝宝宝不喜欢脐疝带怎么办 中班小孩不写字怎么办 中班小孩不愿意写字怎么办 中班了不会写字怎么办 胃不舒服没胃口怎么办 不喜欢婆婆带孩子怎么办 小孩咳嗽吃饭吐怎么办 小孩吐不吃饭怎么办 小孩吃饭容易吐怎么办