中国教程网论坛's Archiver

肥鱼 发表于 2006-3-16 15:38

X-windows显示配置通用解决方案

具体实现涉及四方面:

一个支持 VESA frame buffer的内核;
建立 frame buffer设备;
配置 lilo 的启动选项,使内核启动时能切换到指定的显示模式;
XFree86的 frame buffer Server(XF86_FBDev),以及在 XF86Config中为其配置一个Screen。

所需文件:

Linux 2.2.x kernel source (2.2.x内核原代码,如果要自行编译内核);
XFree86 Framebuffer Server: XF86_FBDev (Turbo Linux中文版,RedHat6.0 CD,ftp.xfree86.org 等地方都能找到);
gcc 等编译工具。
编译一个支持 VESA frame buffer的内核

如果有现成的支持 VESA frame buffer的内核可跳过这一步。如 Madrake 6.0中就带有支持 frame buffer的内核。

配置内核编译选项

在/usr/src/linux中键入make xconfig(XWindow下),或make menuconfig(命令行下)。
与 frame buffer device有关的选项有(其余编译选项请参考其它资料):

Code maturity level opetions
y Prompt for development and/or incomplete codes/drivers

Console drivers
y Video mode selection support
...
y Support for frame buffer devices
...
y VESA VGA graphics console
...
y Advance low level driver options
...
y 8 bpp packed pixels support
y 16 bpp packed pixels support
y 24 bpp packed pixels support

编译安装内核:

以 root身份登录,键入以下命令:

# cd /usr/src/linux
# make bzImage
# make modules
# make modules_install

把编译好的内核拷到 /boot目录,文件名可自定,如 
# cp /usr/src/linux/arch/i386/boot/bzImage /boot/vmlinuz-2.2.5-fb

建立 frame buffer设备

frame buffer设备的 major为 29,minor 为 0(fb0),32(fb1). . . 224(fb7)。

创建fb设备
# mknod /dev/fb0 c 29 0
....


配置 lilo 的启动选项

添加lilo启动配置

下面是典型的lilo.conf文件(位于/etc目录)

boot = /dev/hda2
timeout = 500
prompt
read-only
image = /boot/vmlinuz-2.2.x
label = linux
root = /dev/hda2
other = /dev/hda1
label = dos

添加一新配置需添加 image,label,root及配合VESA frame buffer的 vga等四项:

boot = /dev/hda2
timeout = 500
prompt
read-only
image = /boot/vmlinuz-2.2.x
label = linux
root = /dev/hda2
image = /boot/vmlinuz-2.2.5-fb (新编译的内核)
label = linuxfb (启动标号,可自定)
root = /dev/hda2 (着一句具体会有不同,照你自己的lilo.conf)
vga = 0x314 (显示模式,参照下表)
other = /dev/hda1
label = dos

Linux_kernel_mode_number = VESA_mode_number + 0x200

白日如梦 发表于 2008-4-3 13:35

等会儿去试试去~
我的x的分辨率总是弄不好~

页: [1]

Powered by Discuz! Archiver 6.1.0  © 2001-2007 Comsenz Inc.