# video mode reverts after loading kernel

## mstyer

Hi all,

I've just got a basic new Gentoo installation working, but I'm having a strange issue.

I'm passing the vga=ask argument to the kernel in my grub.conf. When I choose a video mode from the menu, it switches to that resolution for a few seconds, but then as soon as it boots the kernel it switches back to the standard 80x30 or whatever it is. The livecd, on the other hand, works just fine.

First question: why is it doing that, and how do I get the kernel to hang onto the video mode I tell it to load?

Second question: once I've got that done, how do I tell the kernel always to load in that mode?

Thanks! Let me know if you need any other info to help out, I'd be happy to post it

----------

## Deathwing00

If you are using a >=2.6.9 kernel, the vga= option is deprecated, you will have to use video=vesafb:mtrr,ywrap,1280x1024-32@75

where vesafb is the framebuffer driver

where mtrr and ywrap are options of vesafb as it is

the resolution where 1280x1024 is the resolution

where 32 is the bits-per-pixel

and 75 is the frequency

--

Moved from Installing Gentoo.

----------

## mstyer

Thanks for the quick reply.

I am using a 2.6.9 kernel, so maybe this is the issue.

One problem with what you've suggested is that I get the following messages in dmesg:

```
vesafb: Sorry, pre-VBE 2.0 cards are not supported.

vesafb: vbe_init failed

vesafb: probe of vesafb0 failed with error -22

vga16fb: initializing

vga16fb: mapped to 0xc00a0000

Console: switching to colour frame buffer device 80x30

fb0: VGA16 VGA frame buffer device

```

I presume that means my graphics card doesn't support VBE 2.0, and that therefore I can't use vesafb; is that right?

If so, can I just replace 'vesafb' in the video= argument you proposed with 'vga'? Where can I find out what options the vga driver will accept, in place of "mtrr,ywrap,1280x1024-32@75', or will it accept the same options?

Thanks again!

----------

## Deathwing00

The options are usually the same... use an alternative driver, one that matches with your videocard.

----------

## mstyer

This may be a particulary n00bish question, but how do I figure out which driver I need for my card?

I know what card I have, so that's a start. It's a Diamond Speedstar Pro 1100, an ISA card, with a Cirrus CL-GD5429 chip and (I think) 1M RAM. Obviously (from the dmesg output) it doesn't support VBE 2.0; I don't know whether that means it does support VBE 1.2 or doesn't support VBE at all, or whether that matters.

So which driver is the right one, or where should I look to find out? I noticed in the dmesg output I posted before that after vesafb gives up because the card is too old, vga16fb takes over. Does that mean the driver I need is vga16fb?

Or should I use the cirrus driver I've seen mentioned somewhere? I wasn't sure about that because I read in one place that it supports all Cirrus chipsets and somewhere else that it only supports recent chipsets. I'm not even sure whether it's the same thing as vesafb and vga16fb.   :Confused: 

The livecd I have does the right thing "out of the box", so I could check on that... if I knew what to look at!

As you can see, I'm a bit confused...

----------

## mstyer

<bump for advice>

----------

## Deathwing00

Just keep on trying.

----------

## mstyer

Thanks. No offense, but that's not particularly helpful.  :Smile:  I've tried everything I can think of, but this seems to be one area of linux in general that is particularly lacking in documentation. I can't think of another Google search that I haven't already tried (and read everything available).

No matter what mode I set, either using vga= or video=, the console reverts to the standard 80x30 resolution after initially switching to the right mode. Is there something I forgot when compiling the kernel?

Where on the livecd would its console resolution be set? or what file should I look at to see what arguments get passed to the kernel? I don't know how the livecds work just yet.

Any and all (substantive) advice is appreciated!

----------

## Deathwing00

Did you try

```
# dmesg
```

or

```
# cat /var/log/messages

```

?

----------

## mstyer

Did you read my first reply?

Yes, I've looked extensively through both my dmesg output and the dmesg output from the livecd. I've read every relevant page I've found on google for searches including 'vesafb', 'vga16fb', 'linux video modes', and everything else I can think of. /var/log/messages has, as I'm sure you're aware, the same information as dmesg. It does provide the benefit of keeping a record of previous boots, so I can see if and when anything changed, but other than that it's no more helpful.

I've read through the kernel source code of vga16fb.c, and although the kernel documentation says you're supposed to be able to figure out which options the driver accepts by looking at the source file, the function that deals with driver options is as follows:

```
int vga16fb_setup(char *options)

{

        char *this_opt;

if (!options || !*options)

                return 0;

        while ((this_opt = strsep(&options, ",")) != NULL) {

                if (!*this_opt) continue;

        }

        return 0;

}
```

It may be perfectly obvious to a C programmer which options this function accepts, but to me, a Perl programmer, I can't see what it's doing with the options it gets passed.

Documentation/svga.txt describes the video mode selection feature, i.e. the use of vga= as a kernel argument, but as we've already determined that doesn't work because (it seems) it's deprecated (or possibly because it doesn't play nicely with vga16fb?).

Documentation/fb/vesafb.txt is irrelevant because my card is too old, and there simply isn't a Documentation/fb/vga16fb.txt.

So as far as figuring out what options I can pass to vga16fb to make it do what I want, I'm stuck. No matter what mode I pass it, it reverts to the standard resolution.

I could just disable fb support altogether, and just use vga=..., but I would very much like to figure out what is going on here. Also, if what you're saying is true, i.e. vga= is deprecated, I'd like to understand what effect that is going to have if I continue to use it, and what alternatives are recommended.

Any other thoughts?

----------

## Deathwing00

 *mstyer wrote:*   

> 
> 
> I could just disable fb support altogether, and just use vga=..., but I would very much like to figure out what is going on here. Also, if what you're saying is true, i.e. vga= is deprecated, I'd like to understand what effect that is going to have if I continue to use it, and what alternatives are recommended.
> 
> Any other thoughts?

 

Since kernel 2.6.9 'vga=' does not work and is marked OBSOLETE, not deprecated. It was marked DEPRECATED long before.

What I advise you to do is to compile the kernel with all drivers built-in and try them all one by one if STW doesn't work.

----------

## mstyer

OK, but I only even learned that vga= is "deprecated" from you a few posts earlier. In any case, whatever vga= is marked as, it works with the 2.6.9-nitro3 kernel. I've just recompiled the kernel without framebuffer support, and setting vga=3486 works just fine.

So the question is, if it's not supposed to work why is it working, and in any case how do I get vga16fb to work and what options can I pass it?

----------

## Deathwing00

 *mstyer wrote:*   

> OK, but I only even learned that vga= is "deprecated" from you a few posts earlier. In any case, whatever vga= is marked as, it works with the 2.6.9-nitro3 kernel. I've just recompiled the kernel without framebuffer support, and setting vga=3486 works just fine.
> 
> So the question is, if it's not supposed to work why is it working, and in any case how do I get vga16fb to work and what options can I pass it?

 

Did you try video=vga16fb ? Try options like mtrr or ywrap

----------

## jeremy whiting

hello,

  I just got vga16fb to work miracusously, heres my append line from lilo.conf

```
append="video=vga16fb:800x600-4@56"
```

  I found the right mode using fbset -g 800 600 800 600 4 finally did it, then fbset -i told me it was running at 56Hz

so I tried the sile above, reran lilo and voila 800x600 full screen text mode on my old lappy

hope that helps if you're still looking to get this working well

Edit: Actually I spoke too soon, what did it was the line fb:2345:wait:/usr/sbin/fbset -a -g 800 600 800 600 4 -hsync high -vsync high but it turns out that only fixes the resolution on vc1 after all for some reason, dang this thing seems impossible

----------

