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

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的问题也差不多了:)

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值