VGA support

From coreboot
Jump to navigation Jump to search

The wiki is being retired!

Documentation is now handled by the same processes we use for code: Add something to the Documentation/ directory in the coreboot repo, and it will be rendered to https://doc.coreboot.org/. Contributions welcome!

VGA initialization in coreboot

Since coreboot v4 you can configure VGA initialization in Kconfig. For older versions of coreboot check the history of this page.

First do:

<source lang="bash">

$ make menuconfig

</source>

Then go

    Chipset  --->
     [*] Setup bridges on path to VGA adapter 
     [*] Run VGA option ROMs
     Option ROM execution type (Native mode)  --->

Alternatively you can choose the "Secure mode" to run the VGA option rom in a contained environment.

If you have no on-board graphics, you are done configuring coreboot at this point. You may exit configuration, and run make to get your VGA enabled coreboot image.

On-board Video Devices

If you run coreboot on a system with on-board graphics, you have to embed a VGA on the top level, enter the file name of your option rom and the PCI ID of the associated graphics device in the form <vendor_id>,<device_id>:

   VGA BIOS  --->
    [*] Add a VGA BIOS image
    (oprom-0.rom) VGA BIOS path and filename
    (8086,27a2) VGA device PCI IDs

That's it, exit configuration, and run make to get your VGA enabled coreboot image.

How to retrieve a good video bios

RECOMMENDED: Extracting from your vendor bios image

The recommended method is to take your mainboard vendor's BIOS image and extract the VGA BIOS using a tool called bios_extract.

This is the most reliable way:

  • You are guaranteed to get an image that fits to your onboard VGA
  • Even if your VGA BIOS uses self-modifying code you get a correct image

Downloading

There are sites that have video bios roms on their website. (I know of this one for nvidia cards: [1])

For Intel onboard graphics you can download the vbios(vga bios) from Intel's download section. The vbios is included with some versions of the graphics driver. The summary will say something like "NOTE:These materials are intended for use by developers.Includes VBIOS". The actual vbios file is the *.dat file included with the graphics driver.

Extracting from the system (if everything else fails)

However you might be able to retrieve your on-board video bios with Linux as well.

  • Boot up a machine with a commercial bios (not coreboot) with the video card you wish to work under coreboot.
  • You can see where and how much your card's bios is using by doing a

<source lang="bash">cat /proc/iomem | grep 'Video ROM'</source>

  • From the command line enter:
    <source lang="bash">dd if=/dev/mem of=vgabios.bin bs=1k count=64 skip=768</source> This assumes you card's bios is cached at 0xc0000, and is 64K long.


<source lang="bash">dd if=/dev/mem of=video.bios.bin.4 bs=65536 count=1 skip=12</source> This works for many of the VIA Epia boards.
Alternatively you can automatically generate it using this nice script from Peter Stuge:
<source lang="bash"> $ cat /proc/iomem | grep 'Video ROM' | (read m; m=${m/ :*}; s=${m/-*}; e=${m/*-}; \ $ dd if=/dev/mem of=vgabios.bin bs=1c skip=$[0x$s] count=$[$[0x$e]-$[0x$s]+1]) </source>

  • You now have a video bios image