特殊:Badtitle/NS100:ConsoleFramebuffer:修订间差异

来自Ubuntu中文
跳到导航跳到搜索
杏林小草留言 | 贡献
无编辑摘要
Wikibot留言 | 贡献
无编辑摘要
 
(未显示2个用户的5个中间版本)
第2行: 第2行:
{{Languages|UbuntuHelp:ConsoleFramebuffer}}
{{Languages|UbuntuHelp:ConsoleFramebuffer}}
== Introduction ==
== Introduction ==
In most GNU/Linux systems, you are provided with multiple TTYs or virtual consoles.  Typically 6.  These are accessed by pressing Ctrl+Alt+F1 through F6 with your XServer typically running on TTY7 or Ctrl+Alt+F7 and the console logging done to TTY8 or TTY12. (Ctrl+Alt+F8 or F12).  The default resolution for these console screens is 80 columns by 25 rows.  This default resolution is inconvenient for most activities done on the console.  Thankfully, this is an old problem and has been solved for a long time.
The following instructions will provide you the necessary steps to increase the resolution of console screens through the use of the vga kernel option.
'''Warning: Be careful to not chose a resolution that is higher than what your display device supports.  Doing so will require you to boot a rescue disk and adjust the vga mode to a supported value.'''
== Increase the resolution of the virtual consoles ==
=== Chose preferred console resolution ===
The default size of the console is 25x80 chars using vga (640x480 pixels) for historical reasons. In order to utilize modern display resolution you will need to override this settings during the operation system boot process. Please note that widescreen format support is very limited in the VESA standards. Pick a appropriate value from the matrix below, e.g. '''791''' for 16 bit 1280x1024.
<pre><nowiki>
320×200 640×400 640×480 800×500 800×600 896×672 1024×640
16 colors 770
256 colors 768 769 879 771 815 874
15-bit 781 801 784 880 787 816 875
16-bit 782 802 785 881 788 817 876
24-bit 783 803 786 882 789 818 877
32-bit 804 809 883 814 819 878


If you are having trouble with an embedded system giving you the following message
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Console: switching to colour frame buffer device 80x30 <br>
then this answer will help you.


== The Blacklist Solution ==
1024×768 1152×720 1280×1024 1440×900 1600×1200
The reason the console switches to a frame buffer device is that during boot time a frame buffer driver was loaded for your hardware.  To discover what frame buffer driver was loaded, you will have to run
772 774
#lsmod
773 869 775 864 796
and look at the output.  For my system, I noticed this line
790 870 793 865 797
gxfb                    8832  1
791 871 794 866 798
Now the question is, "How do I prevent the frame buffer driver from being loaded?"  Well, Ubuntu has an unusual system for preventing the automatic loading of drivers.  In /etc/modprobe.d there are a set of blacklist files.  To fix my problem, I simply added
792 872 795 867 799
blacklist gxfb
824 873 829 868 834
to the blacklist-framebuffer file and the system no longer tried to switch to a frame buffer console.
== Increase the number of visible rows and columns in console ==
=== Chose preferred console resolution ===
The default size of the console is 25x80 chars using vga (640x480 pixels) for historical reasons. I order to utilize modern display resolution you will need to override this settings during the operation system boot process. Please note that widescreen format is currently not supported by the kernel console driver. Pick a appropriate value from the matrix below, e.g. '''0x31A''' for 16 bit 1280x1024.
<pre><nowiki>Colours  640x400 640x480 800x600 1024x768 1152x864 1280x1024 1600x1200
--------+--------------------------------------------------------------
4 bits |    ?      ?    0x302      ?        ?        ?        ?
8 bits |  0x300  0x301  0x303    0x305    0x161    0x307    0x31C
15 bits |    ?    0x310  0x313    0x316    0x162    0x319    0x31D
16 bits |    ?    0x311  0x314    0x317    0x163    0x31A    0x31E
24 bits |    ?    0x312  0x315    0x318      ?      0x31B    0x31F
32 bits |    ?      ?      ?        ?      0x164      ?        ?
</nowiki></pre>
</nowiki></pre>
A more complete description and table can be found on the [http://en.wikipedia.org/wiki/VESA_BIOS_Extensions Wikipedia VESA BIOS Extension article].
=== Edit /boot/grub/menu.lst ===
=== Edit /boot/grub/menu.lst ===
Append ''vga=0x31A'' in the end of the ''kernel'' line. Your root=UUID will look different and do '''not''' edit this since it will cause your computer to fail booting. Please be warned.  
Append ''vga=791'' in the end of the ''kernel'' line. Your root=UUID will look different .Do '''not''' edit this since it will cause your computer to fail booting. Please be warned.  
In the kernel line below the option ''splash'' is removed since it might cause LCD monitors to entering sleep mode during the boot process when using DVI input. This is not a serious error but a very annoying side-effect from changing the console resolution. This failure might apply on other configurations as well.
In the kernel line below the option ''splash'' is removed since it might cause LCD monitors to entering sleep mode during the boot process when using DVI input. This is not a serious error but a very annoying side-effect from changing the console resolution. This failure might apply on other configurations as well.
<pre><nowiki>title           Ubuntu 7.10, kernel 2.6.22-14-generic
<pre><nowiki>
root            (hd0,0)
title Ubuntu 8.10, kernel 2.6.27-9-generic
kernel         /vmlinuz-2.6.22-14-generic root=UUID=98c2b6c5-4f08-4fbf-bd9c-c470b286f614 ro vga=0x31A
uuid 636dc411-e53a-4776-a9e9-4fc9e277f445
initrd         /initrd.img-2.6.22-14-generic
kernel /boot/vmlinuz-2.6.27-9-generic root=UUID=636dc411-e53a-4776-a9e9-4fc9e277f445 ro quiet splash vga=791
initrd /boot/initrd.img-2.6.27-9-generic
quiet
quiet
</nowiki></pre>
* Tip, If you would like to test the setting but not make a permanent change as above it's possible to edit grub  options during computer booting. When grub is loading press ESC to enter the boot menu, chose to edit the kernel line and append vga=791. Continue to boot linux.
=== Set usplash resolution ===
To keep the Ubuntu slash logo centered, you must set the resolution to match what you chose from the table.
<pre><nowiki>
sudo vi /etc/usplash.conf
</nowiki></pre>
</nowiki></pre>
* Tip, If you would like to test the setting but not make a permanent change as above it's possible to edit grub  options during computer booting. When grub is loading press ESC to enter the boot menu, chose to edit the kernel line and append vga=0x31A. Continue to boot linux.
Change xres= to the first 1/2 of the resolution and yres= to the second 1/2. e.g.  
=== Edit /etc/initramfs-tools/modules ===
<pre><nowiki>
A framebuffer is the device forwarding the text to be outputted on your display. In order to make the operation system aware we changed the size of the console the framebuffer driver needs to be notified.
# Usplash configuration file
Add two lines containing '''vesafb''' and '''fbcon''' to ''/etc/initramfs-tools/modules''
xres=1024
<pre><nowiki>sudo bash
yres=768
echo vesafb >> /etc/initramfs-tools/modules
echo fbcon >> /etc/initramfs-tools/modules
</nowiki></pre>
</nowiki></pre>
=== Rebuild the kernel image ===
=== Rebuild the kernel image ===
This step is necessary to include these two modules in the kernel image being used upon next reboot. This step might also be necessary to perform after a kernel upgrade.
This step is necessary to rebuild the usplash graphics in the kernel image being used upon next reboot. This step might also be necessary to perform after a kernel upgrade.
<pre><nowiki>sudo update-initramfs -u
<pre><nowiki>
</nowiki></pre>
sudo update-initramfs -u
=== Edit /etc/modprobe.d/blacklist-framebuffer ===
Framebuffers are sometimes causing problems to wake up the computer from suspend mode and are hence disabled by default. Comment out the line ''blacklist vesafb'' to load the module anyway.
<pre><nowiki># blacklist vesafb
</nowiki></pre>
=== Edit /etc/modules ===
Although we stopped blacklisting the the vesa framebuffer we force to load it. Append one line with '''vesafb
''' in ''/etc/modules''
<pre><nowiki>echo vesafb >> /etc/modules
</nowiki></pre>
</nowiki></pre>
=== Reboot ===
=== Reboot ===
Hopefully you should see the boot messages with a smaller font upon the boot process.
Hopefully you should see the boot messages with a smaller font upon the boot process.
=== Hints ===
If you are interested in seeing the supported modes of your video card, you can set the vga= line to ask and reboot.
<code><nowiki>vga=ask</nowiki></code>
Upon Grub loading, it will present you with a table of the supported modes of your video card.  The format is X by Y by Color Depth in bits.  The number to the left of the resolution is the VESA mode.  You need to convert the code to Linux VGA modes.  This is typically done by adding 512 to the VESA mode.  This is not always the case and can be values greater or lower. 
=== Links ===
=== Links ===
This section was assembled using information from different sources.
This section was assembled using information from different sources.
第66行: 第66行:
* [http://ubuntuforums.org/showthread.php?p=1505142]
* [http://ubuntuforums.org/showthread.php?p=1505142]
* [https://bugs.launchpad.net/ubuntu/+source/linux-source-2.6.15/+bug/61285]
* [https://bugs.launchpad.net/ubuntu/+source/linux-source-2.6.15/+bug/61285]
* [http://www.nnbfn.net/2008/11/28/ubuntu-810-console-framebuffer/]
----
----
[[category:CategoryDocumentation]]


[[category:UbuntuHelp]]
[[category:UbuntuHelp]]

2009年11月17日 (二) 18:49的最新版本

{{#ifexist: :ConsoleFramebuffer/zh | | {{#ifexist: ConsoleFramebuffer/zh | | {{#ifeq: {{#titleparts:ConsoleFramebuffer|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:ConsoleFramebuffer|1|-1|}} | zh | | }}

Introduction

In most GNU/Linux systems, you are provided with multiple TTYs or virtual consoles. Typically 6. These are accessed by pressing Ctrl+Alt+F1 through F6 with your XServer typically running on TTY7 or Ctrl+Alt+F7 and the console logging done to TTY8 or TTY12. (Ctrl+Alt+F8 or F12). The default resolution for these console screens is 80 columns by 25 rows. This default resolution is inconvenient for most activities done on the console. Thankfully, this is an old problem and has been solved for a long time. The following instructions will provide you the necessary steps to increase the resolution of console screens through the use of the vga kernel option. Warning: Be careful to not chose a resolution that is higher than what your display device supports. Doing so will require you to boot a rescue disk and adjust the vga mode to a supported value.

Increase the resolution of the virtual consoles

Chose preferred console resolution

The default size of the console is 25x80 chars using vga (640x480 pixels) for historical reasons. In order to utilize modern display resolution you will need to override this settings during the operation system boot process. Please note that widescreen format support is very limited in the VESA standards. Pick a appropriate value from the matrix below, e.g. 791 for 16 bit 1280x1024.

		320×200	640×400	640×480	800×500	800×600 896×672 1024×640	
16 colors 					770 				
256 colors 		768 	769 	879 	771 	815 	874 		
15-bit 		781 	801 	784 	880 	787 	816 	875 		
16-bit 		782 	802 	785 	881 	788 	817 	876 		
24-bit 		783 	803 	786 	882 	789 	818 	877 		
32-bit			804 	809 	883 	814 	819 	878 		


1024×768 	1152×720 	1280×1024 	1440×900 	1600×1200
772 				774
773 		869 		775 		864 		796
790 		870 		793 		865 		797
791 		871 		794 		866 		798
792 		872 		795 		867 		799
824 		873 		829 		868 		834

A more complete description and table can be found on the Wikipedia VESA BIOS Extension article.

Edit /boot/grub/menu.lst

Append vga=791 in the end of the kernel line. Your root=UUID will look different .Do not edit this since it will cause your computer to fail booting. Please be warned. In the kernel line below the option splash is removed since it might cause LCD monitors to entering sleep mode during the boot process when using DVI input. This is not a serious error but a very annoying side-effect from changing the console resolution. This failure might apply on other configurations as well.

title		Ubuntu 8.10, kernel 2.6.27-9-generic
uuid		636dc411-e53a-4776-a9e9-4fc9e277f445
kernel		/boot/vmlinuz-2.6.27-9-generic root=UUID=636dc411-e53a-4776-a9e9-4fc9e277f445 ro quiet splash vga=791
initrd		/boot/initrd.img-2.6.27-9-generic
quiet

  • Tip, If you would like to test the setting but not make a permanent change as above it's possible to edit grub options during computer booting. When grub is loading press ESC to enter the boot menu, chose to edit the kernel line and append vga=791. Continue to boot linux.

Set usplash resolution

To keep the Ubuntu slash logo centered, you must set the resolution to match what you chose from the table.

sudo vi /etc/usplash.conf

Change xres= to the first 1/2 of the resolution and yres= to the second 1/2. e.g.

# Usplash configuration file
xres=1024
yres=768

Rebuild the kernel image

This step is necessary to rebuild the usplash graphics in the kernel image being used upon next reboot. This step might also be necessary to perform after a kernel upgrade.

sudo update-initramfs -u

Reboot

Hopefully you should see the boot messages with a smaller font upon the boot process.

Hints

If you are interested in seeing the supported modes of your video card, you can set the vga= line to ask and reboot. vga=ask Upon Grub loading, it will present you with a table of the supported modes of your video card. The format is X by Y by Color Depth in bits. The number to the left of the resolution is the VESA mode. You need to convert the code to Linux VGA modes. This is typically done by adding 512 to the VESA mode. This is not always the case and can be values greater or lower.

Links

This section was assembled using information from different sources.