T60p Extract VGABIOS - bibanon/Coreboot-ThinkPads GitHub Wiki
In this method, we will grab the VGABIOS from the computer's working memory. This is the simplest, and probably most reliable method, since the VGABIOS will patch itself with the necessary graphics card IDs at every boot. As a result, the VGABIOS is unique to every device.
-
Open up a Linux Terminal.
-
Become root with
su
orsudo su
. -
Use this nice little Bash one-liner (by Peter Stuge) to automatically detect the location of the VGABIOS in memory, and dump it with
dd
.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])
-
The VGABIOS has now been extracted (in the current directory) as
vgabios.bin
.
Now that the VGABIOS has been extracted, we must figure out the PCI IDs. We will use the romheaders
tool from the FCode Suite.
-
Install the FCode Suite.
sudo apt-get install fcode-utils
-
Run the following command on the
vgabios.bin
extracted in the previous section.romheaders vgabios.bin
-
You will get an output that looks like the following:
Image 1:
PCI Expansion ROM Header:
Signature: 0x55aa (Ok)
CPU unique data: 0x7f 0xe9 0x77 0x02 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
Pointer to PCI Data Structure: 0x0238
PCI Data Structure:
Signature: 0x50434952 'PCIR' (Ok)
Vendor ID: 0x1002
Device ID: 0x7145
Vital Product Data: 0x0000
PCI Data Structure Length: 0x0018 (24 bytes)
PCI Data Structure Revision: 0x00
Class Code: 0x030000 (VGA Display controller)
Image Length: 0x007f blocks (65024 bytes)
Revision Level of Code/Data: 0x090c
Code Type: 0x00 (Intel x86)
Last-Image Flag: 0x80 (last image in rom)
Reserved: 0x0000
Platform specific data for x86 compliant option rom:
Initialization Size: 0x7f (65024 bytes)
Entry point for INIT function: 0x27d
- From this example, the
(<vendor_id>,<device_id>)
for the T60 with ATI GPU is(1002,7145)
. Remember these numbers when building Coreboot.