用framebuffer驱动,设置console 模式下的分辨率
时间:2010-08-20 来源:wuliqingyt
小菜使用的RHEL5在console模式下,分辨率只有800*600,字体看起来很大,看得不清楚,一直想修改console的分辨率,网上绝大多数教程是说修改/etc/X11/xorg.conf文件,但是修改此文件影响的是X-window的分辨率,而非console模式。会对朋友们产生一定的误导,在此将我的解决方法记录如下,仅供需要的朋友参考
在这里用到了内核里的framebuffer驱动来修改默认分辨率。
如果你的内核是支持 framebuffer 驱动的,可以跳过Step1,直接看Step2
Step1 编译内核,添加framebuffer驱动。
在此,重点说一下编译时要选中的项,以加入framebuffer驱动支持
VGA text console
Video mode selection support
Support for frame buffer devices (EXPERIMENTAL)
VESA VGA graphics console
Advanced low level driver options
<*> 8 bpp packed pixels support
<*> 16 bpp packed pixels support
<*> 24 bpp packed pixels support
<*> 32 bpp packed pixels support
<*> VGA characters/attributes support
Select compiled-in fonts
VGA 8x8 font
VGA 8x16 font
我们还要知道自己所用的显示卡,也有 framebuffer的驱动,所以也要一并选中,比如
<*> nVidia Framebuffer Support
<*> ATI Radeon display support
编译完成后,你的内核就支持framebuffer驱动了
Step2
选择你需要的分辨率
# Normal VGA console
# vga = normal
# VESA framebuffer console @ 1024x768x64k
# vga=791
# VESA framebuffer console @ 1024x768x32k
# vga=790
# VESA framebuffer console @ 1024x768x256
# vga=773
# VESA framebuffer console @ 800x600x64k
# vga=788
# VESA framebuffer console @ 800x600x32k
# vga=787
# VESA framebuffer console @ 800x600x256
# vga=771
# VESA framebuffer console @ 640x480x64k
# vga=785
# VESA framebuffer console @ 640x480x32k
# vga=784
# VESA framebuffer console @ 640x480x256
# vga=769
在此我选了第一个1024x768 64k色,并记住对应的vga的值为791
Step3
修改grub,在启动时向内核传递分辨率参数
以我的电脑为例,默认的grub.conf文件为
default=0
timeout=5
splashimage=(hd0,7)/boot/grub/splash.xpm.gz
#hiddenmenu
title Red Hat Linux5 (2.6.26.5)
root (hd0,2)
kernel /boot/vmlinuz-2.6.26.5 ro root=LABEL=/ rhgb quiet
initrd /boot/initrd-2.6.26.5.img
title WinXp
rootnoverify (hd0,0)
chainloader +1
然后添加内核参数vga=791 到grub.conf文件,告知内核以1024x768,64k色开启console,修改后如下
default=0
timeout=5
splashimage=(hd0,7)/boot/grub/splash.xpm.gz
#hiddenmenu
title Red Hat Linux5 (2.6.26.5)
root (hd0,2)
kernel /boot/vmlinuz-2.6.26.5 vga=791 ro root=LABEL=/ rhgb quiet
initrd /boot/initrd-2.6.26.5.img
title WinXp
rootnoverify (hd0,0)
chainloader +1
保存后重启系统 ,选择进入linux,则系统会以1024x768的分辨率进入console
console中文显示与输入: http://bbs.e5b.net/thread-15825-1-1.html
在这里用到了内核里的framebuffer驱动来修改默认分辨率。
如果你的内核是支持 framebuffer 驱动的,可以跳过Step1,直接看Step2
Step1 编译内核,添加framebuffer驱动。
在此,重点说一下编译时要选中的项,以加入framebuffer驱动支持
VGA text console
Video mode selection support
Support for frame buffer devices (EXPERIMENTAL)
VESA VGA graphics console
Advanced low level driver options
<*> 8 bpp packed pixels support
<*> 16 bpp packed pixels support
<*> 24 bpp packed pixels support
<*> 32 bpp packed pixels support
<*> VGA characters/attributes support
Select compiled-in fonts
VGA 8x8 font
VGA 8x16 font
我们还要知道自己所用的显示卡,也有 framebuffer的驱动,所以也要一并选中,比如
<*> nVidia Framebuffer Support
<*> ATI Radeon display support
编译完成后,你的内核就支持framebuffer驱动了
Step2
选择你需要的分辨率
# Normal VGA console
# vga = normal
# VESA framebuffer console @ 1024x768x64k
# vga=791
# VESA framebuffer console @ 1024x768x32k
# vga=790
# VESA framebuffer console @ 1024x768x256
# vga=773
# VESA framebuffer console @ 800x600x64k
# vga=788
# VESA framebuffer console @ 800x600x32k
# vga=787
# VESA framebuffer console @ 800x600x256
# vga=771
# VESA framebuffer console @ 640x480x64k
# vga=785
# VESA framebuffer console @ 640x480x32k
# vga=784
# VESA framebuffer console @ 640x480x256
# vga=769
在此我选了第一个1024x768 64k色,并记住对应的vga的值为791
Step3
修改grub,在启动时向内核传递分辨率参数
以我的电脑为例,默认的grub.conf文件为
default=0
timeout=5
splashimage=(hd0,7)/boot/grub/splash.xpm.gz
#hiddenmenu
title Red Hat Linux5 (2.6.26.5)
root (hd0,2)
kernel /boot/vmlinuz-2.6.26.5 ro root=LABEL=/ rhgb quiet
initrd /boot/initrd-2.6.26.5.img
title WinXp
rootnoverify (hd0,0)
chainloader +1
然后添加内核参数vga=791 到grub.conf文件,告知内核以1024x768,64k色开启console,修改后如下
default=0
timeout=5
splashimage=(hd0,7)/boot/grub/splash.xpm.gz
#hiddenmenu
title Red Hat Linux5 (2.6.26.5)
root (hd0,2)
kernel /boot/vmlinuz-2.6.26.5 vga=791 ro root=LABEL=/ rhgb quiet
initrd /boot/initrd-2.6.26.5.img
title WinXp
rootnoverify (hd0,0)
chainloader +1
保存后重启系统 ,选择进入linux,则系统会以1024x768的分辨率进入console
console中文显示与输入: http://bbs.e5b.net/thread-15825-1-1.html
相关阅读 更多 +
排行榜 更多 +