# How change booting stage resolution?

## pmam

I just installed ATI/Radeon driver according this wiki: https://wiki.gentoo.org/wiki/Fglrx

and everything working nice, however during booting stage there is low resolution.

I tried to follow grub wiki: https://wiki.gentoo.org/wiki/GRUB2#Using framebuffer display features display but no any change.

Please advise how to work it out and why in some drivers it is automatically setting and in others not?

----------

## Logicien

The first question to ask is are you booting in Bios or EFI mode? Because the framebuffer drivers available are not the same in each mode. I haven't use Fglrx since long but, to have something else than Vga resolution, you need to use vesafb or uvesafb as primary framebuffer for Bios mode. In Efi mode, you have efifb. simple framebuffer may be available too.

You have to make a search about which frambuffer drivers works in Bios and Efi mode with Fglrx. You may not have the native resolution of the screen. I depend on the features of the framebuffer driver in use. There will be a time steep between Linux video framebuffer driver and Xorg fglrx driver when you switch from Xorg terminal to virtual terminal and reverse.

If I am right, only Linux frambuffers who support KMS like nouveau, radeon and i915 give synchronisation between Linux and Xorg nouveau, radeon and intel video drivers.

According with the first link you give, Uvesafb seem's good with Fglrx. There's a link to.

----------

## pmam

Logicien,

Thanks for your nice explanation!

I am booting with Bios and followed the link in Fglrx's wiki that you mentioned: https://wiki.gentoo.org/wiki/Uvesafb

I have a problem with 'Initramfs inclusion' chapter: I guess that I have to have initramfs, in order to get right resolution - Right?

However if configure the kernel like this I get panic error during booting (BTW: the resolution is nice in this case):

```
General setup  --->

    [*] Initial RAM filesystem and RAM disk (initramfs/initrd) support

    (/usr/share/v86d/initramfs) Initramfs source file(s)
```

So I guess need to: 'Use dracut, genkernel, or another initramfs generator of choice to rebuild the initramfs.'

Please advise what tool to choose in order to rebuild initramfs? Just note that I am not using genkernel to build my kernel. 

I added GRUB_CMDLINE_LINUX_DEFAULT="linux video=uvesafb:1240x1024-32,mtrr:3,ywrap" in /etc/default/grub according the wiki.

 *Quote:*   

> If I am right, only Linux frambuffers who support KMS like nouveau, radeon and i915 give synchronisation between Linux and Xorg nouveau, radeon and intel video drivers.

 

When I used opensource radeon driver, I did not have resolution problem.

It just happened when I switched to propriety Fglrx... I thought it would be easier to work it out   :Sad: 

----------

## Logicien

Did you configure CONFIG_FB_UVESA=y in your kernel configuration? Note that you need to update the Grub2 configuration file after a modification? Something like

```
grub2-mkconfig -o /boot/grub2/grub.cfg
```

----------

## pmam

Logicien,

Yes I already done what you noted. Please advise if need to rebuild initramfs with genkernel as in wiki?

It is only thing that still have not done. 

Thanks

----------

## NeddySeagoon

pmam,

It all depends where your framebuffer support is.

If you added things that you want to work before root is mounted, you need to update the initrd.

If you don't mind waiting until root mounts to switch to framebuffer, your initrd may be OK.

----------

## pmam

AFAIK after reading this wiki: https://wiki.gentoo.org/wiki/Initramfs/Guide   I do not need initrd or initramfs.

So in order to have right resolution during boot stage I followed https://wiki.gentoo.org/wiki/Uvesafb and all steps were done except initramfs rebuild.

However still there is low resolution in booting. I faced this issue since switched from Radeon opensource driver to Fglrx propriety driver.

Please advise how to debug in order to find out the exact missing factor?

----------

## NeddySeagoon

pmam,

Try vesafb in the kernel.  The binary blob video drivers in general, do not play nicely with framebuffer consoles.

The nVidia driver emits dire warnings in dmesg.  Its been a while since I used fglrx.

The problem is the same in both cases.  The binary blobs assume that they have exclusive control of the Graphics chip.

When a framebuffer driver grabs it, or changes settings, things start to not work.

You need to choose a framebuffer driver that does not attempt to configure any hardware.

That doesn't leave many.

Post your grub.cfg, possibly on a pastebin.  It may be that the resolution settings are not being passed to the kernel.

----------

## Logicien

To be sure that it is Uvesafb who is the active framebuffer, disable any other framebuffer in the Linux kernel configuration including vga. Your kernel configuration can be helpfull.

After booting check the kernel boot parameters. Show us

```
cat /proc/cmdline
```

to be sure that the uvesafb parameters have been pass correctly to the kernel. Check if /dev/fb0 exist. In dmesg look for vga, vesa and uvesafb messages to know which driver in fact control the Linux display.

You can try Vesafb instead of Uvesafb. In Bios mode it work out of the box but can only give 4/3 resolutions. I ever use Uvesafb and I have been able to make it work with Fglrx I think.

----------

## NeddySeagoon

Logicien,

I had forgotten about /proc/cmdline.  That's much easier.

Thank you.

----------

## Logicien

It' nothing Neddy.

----------

## pmam

Neddy & Logicien,

Thanks for your support! Your advise looks the right way to find out what is wrong.. 

Here my kernel configuration - Hope this is the right file (what name and where this file is located?) - I took it from /usr/src/linux > kwrite .config:

http://pastebin.com/Bdw9Hsd6

I disabled any other framebuffer in the Linux kernel configuration - still low resolution...

```
cat /proc/cmdline

BOOT_IMAGE=/vmlinuz-4.4.6-gentoo root=/dev/sda4 ro linux video=uvesafb:1024x768-32,mtrr:3,ywrap
```

Looks the right parameter as I took from wiki: https://wiki.gentoo.org/wiki/Uvesafb but there is no /dev/fb0 as you noted.

I will check other data later on.

Thanks

----------

## Logicien

 *pmam wrote:*   

> 
> 
> ```
> cat /proc/cmdline
> 
> ...

 

You have an invalid Linux parameter, linux . It should be

```
BOOT_IMAGE=/vmlinuz-4.4.6-gentoo root=/dev/sda4 ro video=uvesafb:1024x768-32,mtrr:3,ywrap
```

linux is a Grub command to specify the kernel image and the parameters that are passed to it. It is not a Linux parameter. Add this entry to the file /etc/grub.d/40_custom

```
menuentry "Gentoo personnal" {

set root=(hd0,4)

linux /vmlinuz-4.4.6-gentoo root=/dev/sda4 ro video=uvesafb:1024x768-32,mtrr:3,ywrap

initrd /path/to/the/initramfs

}
```

If you do not use an initramfs, remove the line "initrd /path/to/the/initramfs" otherwise, give the full path to the initramfs. Update the Grub2 configuration file with grub2-mkconfig and use this entry to boot next time.

Just a question: is the package sys-apps/v86d have been emerged and does the file /usr/share/v86d/initramfs exist?

----------

## pmam

Logicien,

 *Quote:*   

> You have an invalid Linux parameter, linux .

 

I also had suspected this 'linux' parameter and try to omit but it did not help... 

I too this line with 'linux' from wiki - need to correct it?

Anyway, I tried to add your entry to /etc/grub.d/40_custom (without initrd line) but when I use this entry it is not booting:

I get a message: "Press any key..." and it returns to boot menu. 

 *Quote:*   

>  is the package sys-apps/v86d have been emerged and does the file /usr/share/v86d/initramfs exist?

 

Yes I installed it and there is initramfs file with this content:

```
dir /dev 0755 0 0

nod /dev/console 0600 0 0 c 5 1

nod /dev/tty1 0600 0 0 c 4 1

nod /dev/zero 0600 0 0 c 1 5

nod /dev/mem 0600 0 0 c 1 1

dir /root 0700 0 0

dir /sbin 0755 0 0

file /sbin/v86d /sbin/v86d 0755 0 0
```

Thanks

----------

## Logicien

If  you have an initramfs in your Grub entry it may conflict with /usr/share/v86d/initramfs in the kernel image. An alternative is to give /usr/share/v86d/initramfs as an initramfs in a Grub entry. Otherwise you can try Vesafb.

About the entry I suggest to  you, the line set root=(hd0,4) may have to be ajust to the good partition where is /vmlinuz-4.4.6-gentoo .

I hope you will succeed.

----------

