Difference between revisions of "Uvesafb"

m (Added somme <console>'s)
m (Changed the wording of a few sections of the page.)
 
(28 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
== ''How to'' : Framebuffer: Userspace VESA VGA graphics support ==
 
== ''How to'' : Framebuffer: Userspace VESA VGA graphics support ==
Uvesafb is an improved framebuffer driver for Linux systems with some enhancements compared to vesa.  
+
Uvesafb is an improved framebuffer driver for Linux systems with some enhancements compared to vesa. Uvesafb can allow you to get a full-resolution console, even if you have installed a graphics driver that does not support full-resolution consoles, such as [[Package:AMD_Catalyst_Video_Drivers| ati-drivers]] or NVidia-drivers.
=Kernel configuration=
+
  
<pre>Device Drivers ->
+
== Kernel configuration ==
 +
Before we emerge the required packages for uvesafb functionality, we have to configure the kernel properly:
 +
{{Kernelop|title=|desc=
 +
Device Drivers --->
 
     <*> Connector - unified userspace <-> kernelspace linker  --->
 
     <*> Connector - unified userspace <-> kernelspace linker  --->
     Graphics support ->
+
 
 +
     Graphics support --->
 +
        Frame buffer devices --->
 
         [*] Support for frame buffer devices  --->
 
         [*] Support for frame buffer devices  --->
 
             [*] Enable firmware EDID
 
             [*] Enable firmware EDID
             Console display driver support ->
+
             <*> Userspace VESA VGA graphics support
                [*] Video mode selection support
+
}}
                [*] Video mode handling helpers
+
            Frame buffer hardware drivers
+
            [*] Userspace VESA VGA graphics support
+
  
CONFIG_CONNECTOR=y
+
{{Note|Build the kernel {{c|make}} from the kernel sources directory ({{c|/usr/src/linux}}, but do not install the kernel and modules ({{c|make install modules_install}}). You can choose uvesafb as a module, unlike vesa.}}
CONFIG_FB_UVESA=y
+
== Install required packages ==
</pre>
+
Emerge {{Package|dev-libs/klibc}}. Klibc has to be compiled against a kernel that includes uvesafb support. This only has to be done once:
 +
{{console|body=
 +
###i## emerge klibc
 +
}}
 +
After {{c|klibc}} has been installed, the userspace helper, {{Package|sys-apps/v86d}}, can be installed. Uvesafb will not work without {{c|v86d}}:
 +
{{console|body=
 +
###i## emerge v86d
 +
}}
 +
== Back to kernel configuration ==
 +
Reconfigure the kernel to include {{c|/usr/share/v86d/initramfs}} as an initramfs source file:
 +
{{Kernelop|title=|desc=
 +
General Setup--->
 +
    [*] Initial RAM filesystem and RAM disk (initramfs/initrd) support
 +
    (/usr/share/v86d/initramfs)    Initramfs source file(s)
 +
}}
 +
After building in {{c|/usr/share/v86d/initramfs}} as an initramfs file in the kernel, rebuild your kernel sources ({{c|make}}) and install the newly compiled kernel and its modules ({{c|make install modules_install}}).
 +
== Bootloader configuration ==
 +
If you compiled uvesafb into the kernel (not as a module), you can configure its behavior by editing the {{c|params +=}} line in {{c|/etc/boot.conf}}. Below, some of the more common arguments used with uvesafb are explained:
 +
* <code>video=uvesafb:<screen y-res>x<screen x-res>-<color depth></code>: Tells the kernel that you want to use the uvesafb driver for console output. Also specifies that you will be using uvesafb at a set screen resolution, and color depth. Set the first part to the size of your screen (in pixels) and the second part to the color depth of your screen (most monitors now have a depth of 32). For example, if I had a 1920x1080 screen and a color depth of 32, I would add the following: <code>video=uvesafb:1920x1080-32</code>
  
Build the kernel, do not install the kernel and modules. Note, that you can choose uvesafb as module, unlike vesa.
+
* {{c|mtrr:x}}: X represents the number 0 or 3. This option allows you to set up the memory type range registers for uvesafb. Setting x=0 disables mtrr and setting x=3 enables mtrr. x=3 is the default setting for this switch. {{c|mtrr:3}} is recommended.
  
=Klibc=
+
* {{c|ywrap}}: Add support for display panning. Recommended.
  
<console>
+
{{Tip|For more information regarding these arguments, check out http://www.mjmwired.net/kernel/Documentation/fb/uvesafb.txt}}
##i### emerge -av klibc
+
</console>
+
  
This step is necessary because klibc has to be compiled against a kernel that includes uvesafb, you need to do it once, if you planning to update the kernel anytime.
+
Now that you have a basic understanding of a few of the different arguments, you can configure your {{c|/etc/boot.conf}} to allow booting with the uvesafb framebuffer:
  
=v86d=
+
{{file|name=/etc/boot.conf|desc= |body=
<code>v86d</code> is the userspace helper that runs an x86 code in emulated environment. uvesafb will not work without v86d.
+
boot {
 
+
<console>
+
##i### emerge v86d
+
</console>
+
 
+
=Back to kernel configuration=
+
Reconfigure the kernel
+
<pre>General Setup->
+
(*)Initial RAM filesystem and RAM disk (initramfs/initrd) support
+
 
+
and use /usr/share/v86d/initramfs in Initramfs source file(s)
+
 
+
CONFIG_INITRAMFS_SOURCE="/usr/share/v86d/initramfs"</pre>
+
 
+
rebuild the kernel: make and install it, install the modules
+
 
+
=Bootloader configuration=
+
add <code>video=uvesafb:1440x900-32,mtrr:3,ywrap</code> (or similar) to your kernel command line, like in example <code>boot.conf</code>
+
 
+
<pre>boot {
+
 
         generate grub
 
         generate grub
         default "Funtoo Linux uvesafb"  
+
         default "Funtoo Linux: uvesafb"  
 
         timeout 3  
 
         timeout 3  
 
}
 
}
   "Funtoo Linux uvesafb" {  
+
   "Funtoo Linux: uvesafb" {  
         kernel bzImage-uvesafb[-v]
+
         kernel bzImage[-v]
         params += video=uvesafb:1440x900-32,mtrr:3,ywrap
+
         params += video=uvesafb:1920x1080-32,mtrr:3,ywrap
}</pre>
+
}
 +
}}
 +
{{Note|Realize that the configuration in the above file will not work on every computer. You must change the resolution (and possibly other switches) to best suite your needs.}}
 +
 
 +
After you have finished editing your {{c|/etc/boot.conf}}, run the following:
 +
{{console|body=
 +
###i## boot-update
 +
}}
 +
Finally, reboot your computer so that you can test out uvesafb:
 +
{{console|body=
 +
###i## reboot
 +
}}
  
Then run
 
{{root|boot-update}}
 
and
 
{{root|reboot}}
 
and enjoy uvesafb!
 
 
[[Category:HOWTO]]
 
[[Category:HOWTO]]

Latest revision as of 13:26, June 30, 2015

How to : Framebuffer: Userspace VESA VGA graphics support

Uvesafb is an improved framebuffer driver for Linux systems with some enhancements compared to vesa. Uvesafb can allow you to get a full-resolution console, even if you have installed a graphics driver that does not support full-resolution consoles, such as ati-drivers or NVidia-drivers.

Kernel configuration

Before we emerge the required packages for uvesafb functionality, we have to configure the kernel properly:

Device Drivers --->
    <*> Connector - unified userspace <-> kernelspace linker  --->

    Graphics support --->
        Frame buffer devices --->
        [*] Support for frame buffer devices  --->
            [*] Enable firmware EDID
            <*> Userspace VESA VGA graphics support
Note

Build the kernel make from the kernel sources directory (/usr/src/linux, but do not install the kernel and modules (make install modules_install). You can choose uvesafb as a module, unlike vesa.

Install required packages

Emerge No results. Klibc has to be compiled against a kernel that includes uvesafb support. This only has to be done once:

# emerge klibc

After klibc has been installed, the userspace helper, No results, can be installed. Uvesafb will not work without v86d:

# emerge v86d

Back to kernel configuration

Reconfigure the kernel to include /usr/share/v86d/initramfs as an initramfs source file:

General Setup--->
    [*] Initial RAM filesystem and RAM disk (initramfs/initrd) support
    (/usr/share/v86d/initramfs)    Initramfs source file(s)

After building in /usr/share/v86d/initramfs as an initramfs file in the kernel, rebuild your kernel sources (make) and install the newly compiled kernel and its modules (make install modules_install).

Bootloader configuration

If you compiled uvesafb into the kernel (not as a module), you can configure its behavior by editing the {{{1}}} line in /etc/boot.conf. Below, some of the more common arguments used with uvesafb are explained:

  • video=uvesafb:<screen y-res>x<screen x-res>-<color depth>: Tells the kernel that you want to use the uvesafb driver for console output. Also specifies that you will be using uvesafb at a set screen resolution, and color depth. Set the first part to the size of your screen (in pixels) and the second part to the color depth of your screen (most monitors now have a depth of 32). For example, if I had a 1920x1080 screen and a color depth of 32, I would add the following: video=uvesafb:1920x1080-32
  • mtrr:x: X represents the number 0 or 3. This option allows you to set up the memory type range registers for uvesafb. Setting x=0 disables mtrr and setting x=3 enables mtrr. x=3 is the default setting for this switch. mtrr:3 is recommended.
  • ywrap: Add support for display panning. Recommended.
Tip

For more information regarding these arguments, check out http://www.mjmwired.net/kernel/Documentation/fb/uvesafb.txt

Now that you have a basic understanding of a few of the different arguments, you can configure your /etc/boot.conf to allow booting with the uvesafb framebuffer:

/etc/boot.conf
boot {
        generate grub
        default "Funtoo Linux: uvesafb" 
        timeout 3 
}
  "Funtoo Linux: uvesafb" { 
        kernel bzImage[-v]
        params += video=uvesafb:1920x1080-32,mtrr:3,ywrap
}
Note

Realize that the configuration in the above file will not work on every computer. You must change the resolution (and possibly other switches) to best suite your needs.

After you have finished editing your /etc/boot.conf, run the following:

# boot-update

Finally, reboot your computer so that you can test out uvesafb:

# reboot