Definition from wiki:
An Option ROM typically consists of firmware that is called by the system BIOS.
Give an example of option ROM. BIOS want to initialize video card, but BIOS vendors don't have the data sheet of the video card. They have to call some functions in the Option ROM of video card, and initialize the VGA card.
Usually, functions in Option ROM need to be executed during the real mode.
Like coreboot, most of code are executing at protected mode. So it need to switch back to real mode in order to initialize the VGA.
Showing posts with label coreboot. Show all posts
Showing posts with label coreboot. Show all posts
Thursday, April 7, 2011
Friday, April 1, 2011
SVN tips
1. find current version of the project: svn info
2. $ svn checkout --username fengwei --password hello123 URL
3. check out to a new name
$ svn co svn+ssh://username@servername.com/home/username/svnrepos/file newfilename
find
4. man page of svn co: svn check -h
5. $ svn diff --help
6.
cd into a working directory (doesn't need to be latest version)
$ svn diff -r 4 > diff.txt
this will generate the difference between current version 10 and version 4
2. $ svn checkout --username fengwei --password hello123 URL
3. check out to a new name
$ svn co svn+ssh://username@servername.com/home/username/svnrepos/file newfilename
find
4. man page of svn co: svn check -h
5. $ svn diff --help
6.
cd into a working directory (doesn't need to be latest version)
$ svn diff -r 4 > diff.txt
this will generate the difference between current version 10 and version 4
Monday, November 29, 2010
CMOS read/wirte in coreboot/Linux
0x70 is the CMOS memory address I/O port,and 0x71 is the CMOS memory data I/O port
There are 128 bytes data in CMOS, or say 1024 bits in CMOS. The layout format of CMOS is at:
/coreboot/src/mainboard/asus/m2v-mx_se/cmos.layout
or link
http://www.bioscentral.com/misc/cmosmap.htm
If you want to read the 125th byte of CMOS memory:
#include <arch/io.h>
unsigned char addr = 125;
unsigned char data
outb(addr, 0x70);
data = inb(0x71)
If you want to write to the 125th byte of CMOS memory:
#include <arch/io.h>
unsigned char addr = 125;
unsgined char data = 0x01;
outb(addr, 0x70);
outb(data, 0x71);
There are also cmos_read() and cmos_write function at /coreboot/src/include/pc80/mc146818rtc.h
There are 128 bytes data in CMOS, or say 1024 bits in CMOS. The layout format of CMOS is at:
/coreboot/src/mainboard/asus/m2v-mx_se/cmos.layout
or link
http://www.bioscentral.com/misc/cmosmap.htm
If you want to read the 125th byte of CMOS memory:
#include <arch/io.h>
unsigned char addr = 125;
unsigned char data
outb(addr, 0x70);
data = inb(0x71)
If you want to write to the 125th byte of CMOS memory:
#include <arch/io.h>
unsigned char addr = 125;
unsgined char data = 0x01;
outb(addr, 0x70);
outb(data, 0x71);
There are also cmos_read() and cmos_write function at /coreboot/src/include/pc80/mc146818rtc.h
Wednesday, October 20, 2010
compile coreboot and flash BIOS
I successfully compiled coreboot on centos 5.5.
Below are the details.
First of all, you need to install subversion, make, gcc, g++.
If you cannot find package by using: yum install, you can do: yum search
Below are the problems I had:
1. need ncurses-dev for make menuconfig
The error messasge is: curses.h no such file
solutions is: $ yum install ncurses-devel ncurses
2. need to update ld in binutils
The error message is: /usr/bin/ld: unrecgonized option '--build-id=none'
It is because the version of binutils is not the lastest version. ld cannot recgonize "build-id" option. Even if you tried:
yum update binutils
It is still the old version on centos. I think it is because the repository of centos 5.5 haven't update the binutils.
You can find the latest version of binutils from:
http://ftp.gnu.org/gnu/binutils/
I just downloaded the last version is:
3. you also need to install following package from coreboot howto website
you could install them by using:
yum install
but package iasl you cannot find it.
you need to download it from
http://www.acpica.org/downloads/
you need to download first file, untar it, and build the iasl in compile folder.
From the Readme file, we know the makfile doesn't have "make install" function. So we need to copy the binary file iasl manually to /usr/bin directory.
Now, I think you have successful build coreboot.
In addition, for the make meneconfig, there are something you need to know:
you need to specify the motherboard factory, motherboard model, and the size of BIOS(some of them is 512kb, some of them are 1024kb).
you also need to specify the payload, the payload I am using the seabios. You could compile your own seabios, or you could download binary seabios from coreboot website.
I also have another post about linking the vagbios.bin in the configuration file.
For FlashBIOS, you need to download flashrom tool from coreboot.org
and run:
$ flashrom -w coreboot.rom // write coreboot.rom file to BIOS
Below are the details.
First of all, you need to install subversion, make, gcc, g++.
If you cannot find package by using: yum install, you can do: yum search
Below are the problems I had:
1. need ncurses-dev for make menuconfig
The error messasge is: curses.h no such file
solutions is: $ yum install ncurses-devel ncurses
2. need to update ld in binutils
The error message is: /usr/bin/ld: unrecgonized option '--build-id=none'
It is because the version of binutils is not the lastest version. ld cannot recgonize "build-id" option. Even if you tried:
yum update binutils
It is still the old version on centos. I think it is because the repository of centos 5.5 haven't update the binutils.
You can find the latest version of binutils from:
http://ftp.gnu.org/gnu/binutils/
I just downloaded the last version is:
binutils-2.20.1.tar.gz 03-Mar-2010 10:21 22M
After download the binutils, you need to build it. Read the README file. and install it.
3. you also need to install following package from coreboot howto website
- doxygen (for generating/viewing documentation)
- iasl (for targets with ACPI support)
- gdb (for better debugging facilities on some targets)
- flex and bison (for regenerating parsers)
you could install them by using:
yum install
but package iasl you cannot find it.
you need to download it from
http://www.acpica.org/downloads/
you need to download first file, untar it, and build the iasl in compile folder.
From the Readme file, we know the makfile doesn't have "make install" function. So we need to copy the binary file iasl manually to /usr/bin directory.
Now, I think you have successful build coreboot.
In addition, for the make meneconfig, there are something you need to know:
you need to specify the motherboard factory, motherboard model, and the size of BIOS(some of them is 512kb, some of them are 1024kb).
you also need to specify the payload, the payload I am using the seabios. You could compile your own seabios, or you could download binary seabios from coreboot website.
I also have another post about linking the vagbios.bin in the configuration file.
For FlashBIOS, you need to download flashrom tool from coreboot.org
and run:
$ flashrom -w coreboot.rom // write coreboot.rom file to BIOS
Friday, October 15, 2010
Read printk() statement from coreboot source code
the printk() statement in coreboot writes its content to first serial port on the board.
We could use a serial-to-USB cable connect your target machine to your laptop. By using mincom (a tool for setting up reading serial port data), we could read the data from hyperterminal (mincom) from the laptop.
We could use a serial-to-USB cable connect your target machine to your laptop. By using mincom (a tool for setting up reading serial port data), we could read the data from hyperterminal (mincom) from the laptop.
VGA BIOS
by using command:
lspci -vn (-n is for PCI vendor and device ID)
we could find the VGA device vedor IDs.
For ASUS MZV-MX mainboard is: 1106-3230
After we get this, we could find the VGA module on regular BIOS.
We use BISO modification tool, mmtool, to extract VGA module from BIOS.
Then include this vgabios.bin file in the coreboot configuration file.
After we compile and build our BIOS using coreboot, we have a BIOS enable VGA
lspci -vn (-n is for PCI vendor and device ID)
we could find the VGA device vedor IDs.
For ASUS MZV-MX mainboard is: 1106-3230
After we get this, we could find the VGA module on regular BIOS.
We use BISO modification tool, mmtool, to extract VGA module from BIOS.
Then include this vgabios.bin file in the coreboot configuration file.
After we compile and build our BIOS using coreboot, we have a BIOS enable VGA
Subscribe to:
Posts (Atom)