Linux X-window显卡配置通用解决方法(转)[@more@]Linux X-window显卡配置通用解决方法
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
640x480 800x600 1024x768 1280x1024
256 0x301 0x303 0x305 0x307
32k 0x310 0x313 0x316 0x319
64k 0x311 0x314 0x317 0x31A
16M 0x312 0x315 0x318 0x31B
更新启动程序, 运行lilo,重启,出现 lilo: 时键入linuxfb (或自定的标号)。这时如果linux切换成图形模式,并有一小企鹅logo出现,那就大功告成一半。配置frame buffer Server ,为 frame buffer Server配置Screen .参照 XF86Config (位于/etc/X11、/usr/X11R6/lib)中 vga16的配置。
例如:
Section "Screen"
Driver "vga16"
Device "My Video Card"
Monitor "MAG XJ500T"
Subsection "Display"
Modes "640x480" "800x600"
ViewPort 0 0
EndSubsection
EndSection
改动Driver, Modes, Depth三项,其余照抄:
Section "Screen"
Driver "fbdev"
Device "My Video Card"
Monitor "MAG XJ500T"
Subsection "Display"
Depth 16 (色彩深度,必须与前面所选的显示模式的色彩深度一致,必须!)
Modes "default"
ViewPort 0 0
EndSubsection
EndSection
让X 指向 XF86_FBDev ,把 XF86_FBDev文件拷到 /usr/X11R6/bin目录。
在 /usr/X11R6/bin和 /etc/X11里都有一个文件名为 X 的文件,它其实是一个类似Windows的快捷方式的东西,它指向一个实际的 X Server文件,如XF86_VGA16.startx 脚本调用 X 启动 Server而不管具体是哪个 Server.因此,一定要把上面两个目录中的 X 都指向 XF86_FBDev,不同版本可能调用其中任意一个。
具体方法是改名(或删除)原来的 X:
cd /etc/X11
mv X X.bat
然后把 X 指向 XF86_FBDev:
ln -snf /usr/X11R6/bin/XF86_FBDev X
如果一切顺利,这时startx,就会…… good luck!
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
640x480 800x600 1024x768 1280x1024
256 0x301 0x303 0x305 0x307
32k 0x310 0x313 0x316 0x319
64k 0x311 0x314 0x317 0x31A
16M 0x312 0x315 0x318 0x31B
更新启动程序, 运行lilo,重启,出现 lilo: 时键入linuxfb (或自定的标号)。这时如果linux切换成图形模式,并有一小企鹅logo出现,那就大功告成一半。配置frame buffer Server ,为 frame buffer Server配置Screen .参照 XF86Config (位于/etc/X11、/usr/X11R6/lib)中 vga16的配置。
例如:
Section "Screen"
Driver "vga16"
Device "My Video Card"
Monitor "MAG XJ500T"
Subsection "Display"
Modes "640x480" "800x600"
ViewPort 0 0
EndSubsection
EndSection
改动Driver, Modes, Depth三项,其余照抄:
Section "Screen"
Driver "fbdev"
Device "My Video Card"
Monitor "MAG XJ500T"
Subsection "Display"
Depth 16 (色彩深度,必须与前面所选的显示模式的色彩深度一致,必须!)
Modes "default"
ViewPort 0 0
EndSubsection
EndSection
让X 指向 XF86_FBDev ,把 XF86_FBDev文件拷到 /usr/X11R6/bin目录。
在 /usr/X11R6/bin和 /etc/X11里都有一个文件名为 X 的文件,它其实是一个类似Windows的快捷方式的东西,它指向一个实际的 X Server文件,如XF86_VGA16.startx 脚本调用 X 启动 Server而不管具体是哪个 Server.因此,一定要把上面两个目录中的 X 都指向 XF86_FBDev,不同版本可能调用其中任意一个。
具体方法是改名(或删除)原来的 X:
cd /etc/X11
mv X X.bat
然后把 X 指向 XF86_FBDev:
ln -snf /usr/X11R6/bin/XF86_FBDev X
如果一切顺利,这时startx,就会…… good luck!
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10617731/viewspace-961494/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/10617731/viewspace-961494/