# vesafb vga mode codes

## alecjw

I'm trying to get vesafb to work in 1280x1024x32, but i'm not sure what video mode to use. The only way i can get it to work at the moment is by using vga=ask then selecting 324. I've tried 829, which i looked up in a table, 836 (which is 324+512) and 13D (which i found in another table elsewhere). But all of these get me an error which says that the video mode doesnt exist. Does anyone know which one i need to use?

Thanks

----------

## jfp

I could be wrong, but I think those old codes are obsolete. This is from my /boot/grub/grub.conf

```
title=Gentoo Linux 2.6.32-tuxonice-r7

kernel /boot/kernel-2.6.32-tuxonice-r7 root=/dev/sda6 resume=swap:/dev/sda5 video=uvesafb:1024x768-24@60,mtrr:3,ywrap splash=verbose,theme:natural_gentoo console=tty1 idebus=66 acpi_apic_instance=2

```

----------

## alecjw

 *jfp wrote:*   

> I could be wrong, but I think those old codes are obsolete. This is from my /boot/grub/grub.conf
> 
> ```
> title=Gentoo Linux 2.6.32-tuxonice-r7
> 
> ...

 

I haven't had any luck with uvesafb myself, vesafb seems to be the only one which works. I tried your video options and got no framebuffer.

I'd be happy to go with uvesafb or radeonfb if anyone can point me in the right direction, but so far vesafb's seemed the most promising

----------

## Spidey

 *jfp wrote:*   

> I could be wrong, but I think those old codes are obsolete. This is from my /boot/grub/grub.conf
> 
> ```
> title=Gentoo Linux 2.6.32-tuxonice-r7
> 
> ...

 

Do you use an initrd image?

----------

## alecjw

 *Spidey wrote:*   

>  *jfp wrote:*   I could be wrong, but I think those old codes are obsolete. This is from my /boot/grub/grub.conf
> 
> ```
> title=Gentoo Linux 2.6.32-tuxonice-r7
> 
> ...

 

You mean me? Nope, i just compile everything straight into the kernel and avoid modules so that i don't need an initrd (they sound scary :s)

----------

## jfp

I have and nvidia card and use the binary nvidia drivers, but I don't think that matters.

You do need Userspace VESA VGA graphics support in the kernel and sys-apps/v86d

```
Userspace VESA VGA graphics support (FB_UVESA)

CONFIG_FB_UVESA:

This is the frame buffer driver for generic VBE 2.0 compliant

graphic cards. It can also take advantage of VBE 3.0 features,

such as refresh rate adjustment.

This driver generally provides more features than vesafb but

requires a userspace helper application called 'v86d'. See

<file:Documentation/fb/uvesafb.txt> for more information.

```

```
zippy ~ # eix v86d

[I] sys-apps/v86d

     Available versions:  0.1.3-r1 0.1.9 {debug x86emu}

     Installed versions:  0.1.9(12:05:57 AM 03/25/2010)(x86emu -debug)

     Homepage:            http://dev.gentoo.org/~spock/projects/uvesafb/

     Description:         A daemon to run x86 code in an emulated environment.

```

```
zippy ~ # equery f sys-apps/v86d

 * Searching for v86d in sys-apps ...

 * Contents of sys-apps/v86d-0.1.9:

/sbin

/sbin/v86d

/usr

/usr/share

/usr/share/doc

/usr/share/doc/v86d-0.1.9

/usr/share/doc/v86d-0.1.9/ChangeLog.bz2

/usr/share/doc/v86d-0.1.9/README.bz2

/usr/share/v86d

/usr/share/v86d/initramfs

```

You do NOT need to specify an initrd in your grub.conf, instead you can tell the kernel to use the /usr/share/v86d/initramfs in:

General setup

--> Initial RAM filesystem and RAM disk ....

--> --> Initramfs source file(s)

EDIT: fixed typo

----------

## alecjw

 *jfp wrote:*   

> I have and nvidia card and use the binary nvidia drivers, but I don't think that matters.
> 
> You do need Userspace VESA VGA graphics support in the kernel and sys-apps/v86d
> 
> ```
> ...

 

Thanks for the advice, I just installed that, and used the video= options which you recommended. I've already compiled the kernel, so i used initrd=/usr/share/v86d/initramfs instead, but it didnt work, still no framebuffer. When i built my kernel, i enabled the uvesafb option.

My full grub.conf line:

kernel /boot/linux-2.6.31-gentoo-r10-b7 root=/dev/sda7 video=uvesafb:1024x768-24@60,mtrr:3,ywrap initrd=/usr/share/v86d/initramfs

----------

## rjw8703

I'm using vga=0x345 in my kernel line in grub.conf.  This works for me.  I think the 0x needs to be attached to the code for it to work.

----------

## dmpogo

I am not sure if 1280c1024 is a VESA standard mode (say widescreens are not).  If not, then the code 

for non-standard modes depends on the manufacturer and the card (an whether your card manufacturer bothered to program support for it)

Download something like vbespy to find what framebuffer modes your card supports and convert the code you see into vesafb code 

by adding 512 and converting to hex. 

For example, my NVIDIA card supports 1680x1050 in 8x8x8 true color under the code 361 according to vbetest (part of vbespy). 

My kernel line reads 

video=vesafb:ypan,vga=0x369 

where 369 is obtained as 361+512=873 converted into hex (873 = 0x369) 

on my laptop, the same mode means completely different thing !

----------

## jfp

 *Quote:*   

> My full grub.conf line:
> 
> kernel /boot/linux-2.6.31-gentoo-r10-b7 root=/dev/sda7 video=uvesafb:1024x768-24@60,mtrr:3,ywrap initrd=/usr/share/v86d/initramfs

 

From its name I guess /usr/share/v86d/initramfs  is a initramfs. I don't think I know what the difference is between an initrd and a initramfs, but I assume they are different.

It seems to me that uvesafb is much easier to use if you can get it to work. Why not add /usr/share/v86d/initramfs to your kernel, recompile, and reboot? Remove the initrd part of your grub kernel command line of course.

 *Quote:*   

> --> Initial RAM filesystem and RAM disk ....
> 
> --> --> Initramfs source file(s) 

 

----------

## alecjw

 *rjw8703 wrote:*   

> I'm using vga=0x345 in my kernel line in grub.conf.  This works for me.  I think the 0x needs to be attached to the code for it to work.

 

Excellent, that worked perfectly, thanks!

Thanks for your time too, jfp and dmpomgo, but i think i'll keep vesafb for the time being - you know what they say: if it aint broke, dont fix it  :Smile: 

----------

## dmpogo

 *alecjw wrote:*   

>  *rjw8703 wrote:*   I'm using vga=0x345 in my kernel line in grub.conf.  This works for me.  I think the 0x needs to be attached to the code for it to work. 
> 
> Excellent, that worked perfectly, thanks!
> 
> Thanks for your time too, jfp and dmpomgo, but i think i'll keep vesafb for the time being - you know what they say: if it aint broke, dont fix it 

 

My advice was about vesafb, I also keep it  :Smile: 

----------

