VGA support

From coreboot
Revision as of 17:17, 29 April 2010 by Stepan (talk | contribs) (Extracting from the system)
Jump to: navigation, search

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:

 $ make menuconfig

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


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

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
cat /proc/iomem | grep 'Video ROM'
  • From the command line enter:
    dd if=/dev/mem of=vgabios.bin bs=1k count=64 skip=768
    This assumes you card's bios is cached at 0xc0000, and is 64K long.

dd if=/dev/mem of=video.bios.bin.4 bs=65536 count=1 skip=12

This works for many of the VIA Epia boards.
Alternatively you can automatically generate it using this nice script from Peter Stuge:

$ 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])
  • You now have a video bios image