想在Ubuntu中启用Buffer,这样不进入图形界面直接在字符界面下也能有比较好的视觉效果,甚至能看看电影什么的。不过Ubuntu server 8.10中似乎不能直接在/boot/grub/menu.lst的内核参数中直接加入vga=xxx来开启Buffer。需要做一些额外的工作。
1. 编辑 /etc/initramfs-tools/modules,在其中加入:
fbcon
vesafb
vga16fb
2. 编辑 /etc/modprobe.d/blacklist-buffer,注释掉以下两行:
blacklist vesafb
blacklist vga16fb
3. 修改/boot/grub/ 内的menu.lst ,找到类似如下几行代码,在kernel一行结尾加入fb分辨率参数:
例如:
title Ubuntu 8.10, kernel 2.6.27-9-generic
uuid 328eed5f-0f89-41b8-b021-730ae3f167d1
kernel /boot/vmlinuz-2.6.27-9-generic root=UUID=328eed5f-0f89-41b8-b021-730ae3f167d1 ro quiet splash vga=0x314 或者 vga=0x0317 表示1024*768的16位色配置
initrd /boot/initrd.img-2.6.27-9-generic
quiet
注:vga=0×314 即为800*600 16位
终端的分辨率可以用fbset设置。
|640×480 800×600 1024×768 1280×1024
—-+————————————-
256 | 0x301 0x303 0x305 0x307
32k | 0x310 0x313 0x316 0x319
64k | 0x311 0x314 0x317 0x31A
16M | 0x312 0x315 0x318 0x31B
4. 刷新并重新启动
sudo update-initramfs -u
5.如何判断buffer是否启用
首先确认内核是否支持 buffer ,查看 /proc/fb 文件是否存在,http://ubuntuone.cn/存在则说明支持,否则,说明不支持。其次查看 buffer 设备是否已激活,若 /dev/fb0 文件存在,则说明已经激活;否则说明没有激活。
6.安装zhcon显示中文
如果源里有该软件可以直接终端输入下面命令安装:
$sudo apt-get install zhcon
启动zhcon:
zhcon –utf8 –drv=fb
7.在控制台下播放电影
例如:
mplayer abc.mov -vo fbdev
视频输出用fbdev2也可以。
PS:
通过自己的实践[luther.gliethttp],发现我的笔记本,直接使用上面的第3个步骤,就可以完成控制台之间
framebuffer下切换,但是台式机就出现了死机现象,
台式机下首先且到ctrl+alt+f1文本控制台,然后执行/dev/fb0操作,之后alt+f7切回到Ubuntu的GUI时,GUI就死掉了,很奇怪,后来实验了各种方式,包括安装显卡驱动等[笔记本是安装了nvdia驱动的],
还是一样会死,后来只能切换GUI seesion,重新使用老早之前的wmii,发现一切正常,得了,只能使用wmii了,wmii的操作可以参考我以前的《wmii-3.1操作说明》
对于zhcon来说,比如想显示/vobs下的中文文件,不是
ls /vobs然后回车,而是使用tab,这样中文就可以正常显示了,zhcon总体效果还是很差,不太推荐使用[luther.gliethttp].
在内核Documentation/fb/vesafb.txt文件中,有如下vesa-framebuffer的说明
Switching modes is done using the vga=… boot parameter. Read
Documentation/svga.txt for details.
You should compile in both vgacon (for text mode) and vesafb (for
graphics mode). Which of them takes over the console depends on
whenever the specified mode is text or graphics.
The graphic modes are NOT in the list which you get if you boot with
vga=ask and hit return. The mode you wish to use is derived from the
VESA mode number. Here are those VESA mode numbers:
| 640×480 800×600 1024×768 1280×1024
—-+————————————-
256 | 0x101 0x103 0x105 0x107 8位色
32k | 0x110 0x113 0x116 0x119 15位色
64k | 0x111 0x114 0x117 0x11A 16位色
16M | 0x112 0x115 0x118 0x11B 24位色
The video mode number of the Linux kernel is the VESA mode number plus
0x200.
Linux_kernel_mode_number = VESA_mode_number + 0x200
So the table for the Kernel mode numbers are:
| 640×480 800×600 1024×768 1280×1024
—-+————————————-
256 | 0x301 0x303 0x305 0x307 8位色
32k | 0x310 0x313 0x316 0x319 15位色
64k | 0x311 0x314 0x317 0x31A 16位色
16M | 0x312 0x315 0x318 0x31B 24位色
To enable one of those modes you have to specify “vga=ask” in the
lilo.conf file and rerun LILO. Then you can type in the desired
mode at the “vga=ask” prompt. For example if you like to use
1024x768x256 colors you have to say “305” at this prompt.
If this does not work, this might be because your BIOS does not support
linear framebuffers or because it does not support this mode at all.
Even if your board does, it might be the BIOS which does not. VESA BIOS
Extensions v2.0 are required, 1.2 is NOT sufficient. You will get a
“bad mode number” message if something goes wrong.
1. Note: LILO cannot handle hex, for booting directly with
“vga=mode-number” you have to transform the numbers to decimal.
2. Note: Some newer versions of LILO appear to work with those hex values,
if you set the 0x in front of the numbers.