https://www.coreboot.org/api.php?action=feedcontributions&user=KevinOConnor&feedformat=atomcoreboot - User contributions [en]2024-03-28T19:35:42ZUser contributionsMediaWiki 1.40.0https://www.coreboot.org/index.php?title=SeaBIOS&diff=20774SeaBIOS2016-09-05T15:41:28Z<p>KevinOConnor: /* Adding a VGA option ROM */ Place cbfs instructions for cbvga inline with the cbvga section</p>
<hr />
<div>[http://seabios.org '''SeaBIOS'''] is an open-source legacy BIOS implementation which can be used as a coreboot [[Payloads|payload]]. It implements the standard [https://secure.wikimedia.org/wikipedia/en/wiki/BIOS BIOS] calling interfaces that a typical x86 proprietary BIOS implements.<br />
<br />
This page describes using SeaBIOS with coreboot. SeaBIOS can also run natively in [[QEMU]] and [http://bochs.sourceforge.net/ bochs] &mdash; see the [http://seabios.org SeaBIOS website] for information on non-coreboot uses.<br />
<br />
= Use cases =<br />
<br />
Any software requiring 16-bit BIOS services benefits from SeaBIOS (eg, Windows and DOS). SeaBIOS also enables booting Linux out of the box (using standard boot-loaders like GRUB and Syslinux).<br />
<br />
SeaBIOS supports booting from ATA hard drives, ATAPI CDROMs, USB hard drives, USB CDROMs, payloads in flash, and from [http://en.wikipedia.org/wiki/Option_ROM Option ROMs] (eg, SCSI or network cards). SeaBIOS can initialize and use a PS/2 keyboard or USB keyboard.<br />
<br />
== Windows ==<br />
<br />
SeaBIOS has been tested with Windows XP, Windows 2008, Windows Vista (64/32 bit), Windows 7 (32 bit and 64 bit).<br />
<br />
However, Windows has a very strict ACPI interpreter, and some coreboot boards do not have a complete [[ACPI|ACPI definition]]. As a result, some coreboot boards may fail during Windows boot (eg, it may fail with a '''STOP 0xA5''' code).<br />
<br />
Many boards do have working ACPI and are able to boot XP/Vista/Windows 7. Please check the board documentation or ask on the [[Mailinglist|mailing list]] if unsure of the status.<br />
<br />
== Linux ==<br />
<br />
SeaBIOS has been tested with GRUB, LILO, and Syslinux. Linux booting works well.<br />
<br />
== Other ==<br />
<br />
SeaBIOS has also been tested with FreeDOS, NetBSD, and OpenBSD.<br />
<br />
Because SeaBIOS implements the standard x86 BIOS interfaces, it is expected many other operating systems and boot-loaders will work.<br />
<br />
= Building =<br />
<br />
== Building via coreboot's menuconfig ==<br />
<br />
Probably the easiest way to use SeaBIOS as coreboot payload is to simply use the coreboot build process, which downloads and builds SeaBIOS as payload by default nowadays. You just have to run the following in your coreboot checkout:<br />
<br />
<source lang="bash"><br />
$ make menuconfig<br />
$ make<br />
</source><br />
<br />
Both SeaBIOS and coreboot will be built, and SeaBIOS will be added as payload to the '''coreboot.rom''' image that is being built.<br />
<br />
== Manual build ==<br />
<br />
One can download the latest version of SeaBIOS through a git repository:<br />
<br />
<source lang="bash"><br />
$ git clone git://git.seabios.org/seabios.git seabios<br />
$ cd seabios<br />
</source><br />
<br />
There's also a [https://review.coreboot.org/gitweb/cgit/seabios.git/ cgit] facility to browse the latest source code online.<br />
<br />
Run '''make menuconfig''' and set the following variables:<br />
<br />
* CONFIG_COREBOOT 1<br />
* CONFIG_DEBUG_SERIAL 1<br />
<br />
Then:<br />
<br />
<source lang="bash"><br />
$ make<br />
</source><br />
<br />
The final SeaBIOS payload file is '''out/bios.bin.elf'''.<br />
<br />
== coreboot ==<br />
<br />
Configure coreboot with the following all disabled: '''CONFIG_VGA_ROM_RUN''', '''CONFIG_PCI_ROM_RUN''', '''CONFIG_ON_DEVICE_ROM_RUN'''<br />
<br />
Then configure the SeaBIOS '''out/bios.bin.elf''' file as the coreboot payload and build coreboot. The resulting '''coreboot.rom''' file will contain both SeaBIOS and coreboot, and it can be flashed to a ROM chip.<br />
<br />
= SeaBIOS and CBFS =<br />
<br />
SeaBIOS can read the coreboot flash filesystem and extract files. Details on the CBFS files that SeaBIOS supports are on the [http://seabios.org/Runtime_config SeaBIOS wiki].<br />
<br />
The following examples show some commonly used features.<br />
<br />
== Adding a VGA option ROM ==<br />
<br />
It is frequently necessary to add a VGA option ROM to CBFS in order to use a VGA adapter that is built-in to a motherboard. Note, VGA adapters on external cards (PCI, AGP, PCIe) do not require this step as SeaBIOS will automatically extract the VGA BIOS directly from the card. For machines without a VGA adapter, please follow the [[#Adding sgabios support|sgabios instructions]] below.<br />
<br />
=== Using your BIOS's VGA option rom ===<br />
The first step is to find the vendor and device ID of the built-in VGA adapter. This information can be found from '''lspci''':<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
01:00.0 VGA compatible controller [0300]: VIA Technologies, Inc. UniChrome Pro IGP ['''1106:3344'''] (rev 01) (prog-if 00 [VGA controller])<br />
</source><br />
<br />
In the above example, the VGA vendor/device ID is '''1106:3344'''. [[VGA support#How_to_retrieve_a_good_video_bios|Obtain the VGA ROM]] (eg, '''vgabios.bin''') and add it to the ROM with:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/vgabios.bin -n pci1106,3344.rom -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
Alternatively, SeaBIOS supports LZMA compressed option ROMs. Use the following to add a compressed option ROM instead:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/vgabios.bin -c lzma -n pci1106,3344.rom.lzma -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
After the above is done, one can write the '''coreboot.rom''' file to flash. SeaBIOS will extract the VGA ROM and run it during boot.<br />
<br />
=== Adding sgabios support ===<br />
<br />
An [http://code.google.com/p/sgabios/ sgabios] option ROM can forward many VGA BIOS requests and keyboard events over a serial port. One can deploy it in addition to the primary VGA BIOS or by itself.<br />
<br />
If the target machine does not have a VGA adapter, then one should install sgabios. Most bootloaders (eg, GRUB) require a VGA BIOS in order to function properly &mdash; the sgabios ROM can fill this requirement.<br />
<br />
Place the sgabios ROM file in the '''vgaroms/''' directory of CBFS. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/sgabios.bin -n vgaroms/sgabios.bin -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
When using sgabios, all the characters that SeaBIOS writes to the screen will be seen twice &mdash; once from SeaBIOS sending the character to the serial port and once from sgabios forwarding the character. To prevent the duplicates set the [[#Other Configuration items|config file]] '''etc/screen-and-debug''' to zero.<br />
<br />
=== Using coreboot VGA support ===<br />
Coreboot can initialize the GPU of some mainboards. After initializing the GPU, the information about it is passed to the payload.<br />
<br />
SeaBIOS can provide an option rom that implements legacy VGA BIOS compatibility for coreboot initialized GPUs. To use this feature select '''CONFIG_VGA_COREBOOT''' (in "make menuconfig" under "VGA ROM ---> VGA Hardware Type" select "coreboot linear framebuffer").<br />
<br />
The resulting option rom '''out/vgabios.rom''' should be added to the '''vgaroms/''' directory of CBFS. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/seabios/out/vgabios.bin -n vgaroms/seavgabios.bin -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
=== Geode option roms ===<br />
There are two VGA option roms for geode in SeaBIOS, they can be found in "VGA ROM --->" in "make menuconfig":<br />
<br />
* The first one is for the Geode LX, its named "GeodeLX" in "make menuconfig"<br />
* The second one if for the Geode GX2, its named "Geode GX2" in "make menuconfig"<br />
<br />
== Adding a graphical "bootsplash" image ==<br />
<br />
SeaBIOS can show a custom [http://en.wikipedia.org/wiki/JPEG JPEG] image or [http://en.wikipedia.org/wiki/BMP_file_format BMP] image during bootup. To enable this, add the JPEG file to flash with the name '''bootsplash.jpg''' or BMP file as '''bootsplash.bmp'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/image.jpg -n bootsplash.jpg -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
The size of the image determines the video mode to use for showing the image. Make sure the dimensions of the image exactly correspond to an available video mode (eg, 640x480, or 1024x768), otherwise it will not be displayed.<br />
<br />
SeaBIOS will show the image during the wait for the boot menu (if the boot menu has been disabled, users will not see the image). The image should probably have "Press F12 for boot menu" embedded in it so users know they can enter the normal SeaBIOS boot menu. By default, the boot menu prompt (and thus graphical image) is shown for 2.5 seconds. This can be customized via a [[#Other Configuration items|configuration parameter]].<br />
<br />
The JPEG viewer in SeaBIOS uses a simplified decoding algorithm. It supports most common JPEGs, but does not support all possible formats. Please see the [[#Trouble reporting|Trouble reporting]] section if a valid image isn't displayed properly.<br />
<br />
== Adding gpxe support ==<br />
<br />
A [[GPXE|gpxe]] option ROM can nicely complement SeaBIOS and coreboot by adding network boot support. Adding gpxe is similar to [[#Adding a VGA option ROM]]. The first step is to find the Ethernet vendor/device ID. For example:<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
00:09.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet ['''10ec:8167'''] (rev 10)<br />
</source><br />
<br />
Then one can build a gpxe option ROM. For example:<br />
<br />
<source lang="bash"><br />
$ cd /path/to/gpxe/src/<br />
$ make bin/10ec8167.rom<br />
</source><br />
<br />
And add it to the coreboot image. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/gpxe/src/bin/10ec8167.rom -n pci10ec,8167.rom -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
As with VGA option ROMs, the gpxe option ROM may be compressed with LZMA. However, compression won't significantly reduce gpxe's size as it implements its own compression.<br />
<br />
In addition to gpxe, other option ROMs can be added in the same manner.<br />
<br />
== Adding payloads ==<br />
<br />
Most [[Payloads|payloads]] can also be launched from SeaBIOS. To add a payload, build the corresponding .elf file and then add it to the '''coreboot.rom''' file in the '''img/''' directory. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add-payload /path/to/payload.elf img/MyPayload l<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
During boot, one can press the '''ESC''' key to get a boot menu. SeaBIOS will show all files in the '''img/''' directory, and one can instruct SeaBIOS to run them.<br />
<br />
SeaBIOS supports both uncompressed and LZMA compressed payloads.<br />
<br />
== Adding a floppy image ==<br />
<br />
It is possible to embed an image of a floppy in flash. SeaBIOS can then boot from and redirect floppy BIOS calls to the flash image. This is mainly useful for legacy software (such as DOS utilities). To use this feature, place a floppy image into the CBFS directory '''floppyimg/'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/myfloppy.img -c lzma -n floppyimg/MyFloppy.lzma -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
Both uncompressed and LZMA compressed images are supported. Several floppy formats are available: 360K, 1.2MB, 720K, 1.44MB, 2.88MB, 160K, 180K, 320K.<br />
<br />
The floppy image will appear as writable to the system, however all writes are discarded on reboot.<br />
<br />
When using this system, SeaBIOS reserves high-memory to store the floppy. The reserved memory is then no longer available for OS use, so this feature should only be used when needed.<br />
<br />
== Configuring boot order ==<br />
<br />
Place a file in CBFS with the name '''bootorder''' to configure the boot up order. The file should be ASCII text and contain one line per boot method. The description of each boot method follows an [https://secure.wikimedia.org/wikipedia/en/wiki/Open_firmware Open Firmware] device path format. SeaBIOS will attempt to boot from each item in the file &mdash; first line of the file first.<br />
<br />
The easiest way to find the available boot methods is to look for "Searching bootorder for" in the SeaBIOS serial output. For example, one may see lines similar to:<br />
<br />
Searching bootorder for: /pci@i0cf8/*@f/drive@1/disk@0<br />
Searching bootorder for: /pci@i0cf8/*@f,1/drive@2/disk@1<br />
Searching bootorder for: /pci@i0cf8/usb@10,4/*@2<br />
<br />
The above represents the patterns SeaBIOS will search for in the bootorder file. However, it's safe to just copy and paste the pattern into bootorder. For example, the file:<br />
<br />
/pci@i0cf8/usb@10,4/*@2<br />
/pci@i0cf8/*@f/drive@1/disk@0<br />
<br />
will instruct SeaBIOS to attempt to boot from the given USB drive first and then attempt the given ATA harddrive second.<br />
<br />
Once a file has been created, add it to CBFS with the name '''bootorder'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f mybootlist.txt -n bootorder -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
== Other Configuration items ==<br />
<br />
Additional configuration options are available in the CBFS '''etc/''' directory. For example, to set the duration of the boot menu to five and a half seconds, one would do the following:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add-int -i 5500 -n etc/boot-menu-wait<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
The cbfstool "add-int" command will create a litte-endian encoded binary integer and place it into the specified CBFS file.<br />
<br />
See the [http://seabios.org/Runtime_config SeaBIOS wiki] for details on available options.<br />
<br />
== File aliases ==<br />
<br />
It is possible to create the equivalent of "symbolic links" in CBFS so that one file's content appears under another name. To do this, create a links file with one line per link and each line having the format of "linkname" and "destname" separated by a space character. For example, the "links" file may look like:<br />
<br />
pci1234,1000.rom somerom.rom<br />
pci1234,1001.rom somerom.rom<br />
pci1234,1002.rom somerom.rom<br />
<br />
Then add the "links" file to CBFS:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f links -n links -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
The above example would cause SeaBIOS to treat "pci1234,1000.rom" or "pci1234,1001.rom" as files with the same content as the file "somerom.rom".<br />
<br />
= Trouble reporting =<br />
<br />
If you are experiencing problems with SeaBIOS, please follow the directions on the [http://seabios.org/Debugging SeaBIOS wiki] to report the issue.</div>KevinOConnorhttps://www.coreboot.org/index.php?title=SeaBIOS&diff=17370SeaBIOS2015-11-17T20:10:11Z<p>KevinOConnor: Update examples to use cbfstool's lzma compression feature</p>
<hr />
<div>[http://seabios.org '''SeaBIOS'''] is an open-source legacy BIOS implementation which can be used as a coreboot [[Payloads|payload]]. It implements the standard [https://secure.wikimedia.org/wikipedia/en/wiki/BIOS BIOS] calling interfaces that a typical x86 proprietary BIOS implements.<br />
<br />
This page describes using SeaBIOS with coreboot. SeaBIOS can also run natively in [[QEMU]] and [http://bochs.sourceforge.net/ bochs] &mdash; see the [http://seabios.org SeaBIOS website] for information on non-coreboot uses.<br />
<br />
= Use cases =<br />
<br />
Any software requiring 16-bit BIOS services benefits from SeaBIOS (eg, Windows and DOS). SeaBIOS also enables booting Linux out of the box (using standard boot-loaders like GRUB and Syslinux).<br />
<br />
SeaBIOS supports booting from ATA hard drives, ATAPI CDROMs, USB hard drives, USB CDROMs, payloads in flash, and from [http://en.wikipedia.org/wiki/Option_ROM Option ROMs] (eg, SCSI or network cards). SeaBIOS can initialize and use a PS/2 keyboard or USB keyboard.<br />
<br />
== Windows ==<br />
<br />
SeaBIOS has been tested with Windows XP, Windows 2008, Windows Vista (64/32 bit), Windows 7 (32 bit and 64 bit).<br />
<br />
However, Windows has a very strict ACPI interpreter, and some coreboot boards do not have a complete [[ACPI|ACPI definition]]. As a result, some coreboot boards may fail during Windows boot (eg, it may fail with a '''STOP 0xA5''' code).<br />
<br />
Many boards do have working ACPI and are able to boot XP/Vista/Windows 7. Please check the board documentation or ask on the [[Mailinglist|mailing list]] if unsure of the status.<br />
<br />
== Linux ==<br />
<br />
SeaBIOS has been tested with GRUB, LILO, and Syslinux. Linux booting works well.<br />
<br />
== Other ==<br />
<br />
SeaBIOS has also been tested with FreeDOS, NetBSD, and OpenBSD.<br />
<br />
Because SeaBIOS implements the standard x86 BIOS interfaces, it is expected many other operating systems and boot-loaders will work.<br />
<br />
= Building =<br />
<br />
== Building via coreboot's menuconfig ==<br />
<br />
Probably the easiest way to use SeaBIOS as coreboot payload is to simply use the coreboot build process, which downloads and builds SeaBIOS as payload by default nowadays. You just have to run the following in your coreboot checkout:<br />
<br />
<source lang="bash"><br />
$ make menuconfig<br />
$ make<br />
</source><br />
<br />
Both SeaBIOS and coreboot will be built, and SeaBIOS will be added as payload to the '''coreboot.rom''' image that is being built.<br />
<br />
== Manual build ==<br />
<br />
One can download the latest version of SeaBIOS through a git repository:<br />
<br />
<source lang="bash"><br />
$ git clone git://git.seabios.org/seabios.git seabios<br />
$ cd seabios<br />
</source><br />
<br />
There's also a [http://code.coreboot.org/p/seabios/source/changes/master/ gitweb] facility to browse the latest source code online.<br />
<br />
Run '''make menuconfig''' and set the following variables:<br />
<br />
* CONFIG_COREBOOT 1<br />
* CONFIG_DEBUG_SERIAL 1<br />
<br />
Then:<br />
<br />
<source lang="bash"><br />
$ make<br />
</source><br />
<br />
The final SeaBIOS payload file is '''out/bios.bin.elf'''.<br />
<br />
== coreboot ==<br />
<br />
Configure coreboot with the following all disabled: '''CONFIG_VGA_ROM_RUN''', '''CONFIG_PCI_ROM_RUN''', '''CONFIG_ON_DEVICE_ROM_RUN'''<br />
<br />
Then configure the SeaBIOS '''out/bios.bin.elf''' file as the coreboot payload and build coreboot. The resulting '''coreboot.rom''' file will contain both SeaBIOS and coreboot, and it can be flashed to a ROM chip.<br />
<br />
= SeaBIOS and CBFS =<br />
<br />
SeaBIOS can read the coreboot flash filesystem and extract files. Details on the CBFS files that SeaBIOS supports are on the [http://seabios.org/Runtime_config SeaBIOS wiki].<br />
<br />
The following examples show some commonly used features.<br />
<br />
== Adding a VGA option ROM ==<br />
<br />
It is frequently necessary to add a VGA option ROM to CBFS in order to use a VGA adapter that is built-in to a motherboard. Note, VGA adapters on external cards (PCI, AGP, PCIe) do not require this step as SeaBIOS will automatically extract the VGA BIOS directly from the card. For machines without a VGA adapter, please follow the [[#Adding sgabios support|sgabios instructions]] below.<br />
<br />
=== Using your BIOS's VGA option rom ===<br />
The first step is to find the vendor and device ID of the built-in VGA adapter. This information can be found from '''lspci''':<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
01:00.0 VGA compatible controller [0300]: VIA Technologies, Inc. UniChrome Pro IGP ['''1106:3344'''] (rev 01) (prog-if 00 [VGA controller])<br />
</source><br />
<br />
In the above example, the VGA vendor/device ID is '''1106:3344'''. [[VGA support#How_to_retrieve_a_good_video_bios|Obtain the VGA ROM]] (eg, '''vgabios.bin''') and add it to the ROM with:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/vgabios.bin -n pci1106,3344.rom -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
Alternatively, SeaBIOS supports LZMA compressed option ROMs. Use the following to add a compressed option ROM instead:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/vgabios.bin -c lzma -n pci1106,3344.rom.lzma -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
After the above is done, one can write the '''coreboot.rom''' file to flash. SeaBIOS will extract the VGA ROM and run it during boot.<br />
<br />
=== Adding sgabios support ===<br />
<br />
An [http://code.google.com/p/sgabios/ sgabios] option ROM can forward many VGA BIOS requests and keyboard events over a serial port. One can deploy it in addition to the primary VGA BIOS or by itself.<br />
<br />
If the target machine does not have a VGA adapter, then one should install sgabios. Most bootloaders (eg, GRUB) require a VGA BIOS in order to function properly &mdash; the sgabios ROM can fill this requirement.<br />
<br />
Place the sgabios ROM file in the '''vgaroms/''' directory of CBFS. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/sgabios.bin -n vgaroms/sgabios.bin -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
When using sgabios, all the characters that SeaBIOS writes to the screen will be seen twice &mdash; once from SeaBIOS sending the character to the serial port and once from sgabios forwarding the character. To prevent the duplicates set the [[#Other Configuration items|config file]] '''etc/screen-and-debug''' to zero.<br />
<br />
=== Using coreboot VGA support ===<br />
Coreboot can initialize the GPU of some mainboards. After initializing the GPU, the information about it is passed to the payload.<br />
<br />
SeaBIOS can provide an option rom that implements legacy VGA BIOS compatibility for coreboot initialized GPUs. To use this feature select '''CONFIG_VGA_COREBOOT''' (in "make menuconfig" under "VGA ROM ---> VGA Hardware Type" select "coreboot linear framebuffer").<br />
<br />
The resulting option rom is in '''out/vgabios.rom'''. It can be added to '''coreboot.rom''' the same way one would add [[SeaBIOS#Adding_sgabios_support|sgabios]].<br />
<br />
=== Geode option roms ===<br />
There are two VGA option roms for geode in SeaBIOS, they can be found in "VGA ROM --->" in "make menuconfig":<br />
<br />
* The first one is for the Geode LX, its named "GeodeLX" in "make menuconfig"<br />
* The second one if for the Geode GX2, its named "Geode GX2" in "make menuconfig"<br />
<br />
== Adding a graphical "bootsplash" image ==<br />
<br />
SeaBIOS can show a custom [http://en.wikipedia.org/wiki/JPEG JPEG] image or [http://en.wikipedia.org/wiki/BMP_file_format BMP] image during bootup. To enable this, add the JPEG file to flash with the name '''bootsplash.jpg''' or BMP file as '''bootsplash.bmp'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/image.jpg -n bootsplash.jpg -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
The size of the image determines the video mode to use for showing the image. Make sure the dimensions of the image exactly correspond to an available video mode (eg, 640x480, or 1024x768), otherwise it will not be displayed.<br />
<br />
SeaBIOS will show the image during the wait for the boot menu (if the boot menu has been disabled, users will not see the image). The image should probably have "Press F12 for boot menu" embedded in it so users know they can enter the normal SeaBIOS boot menu. By default, the boot menu prompt (and thus graphical image) is shown for 2.5 seconds. This can be customized via a [[#Other Configuration items|configuration parameter]].<br />
<br />
The JPEG viewer in SeaBIOS uses a simplified decoding algorithm. It supports most common JPEGs, but does not support all possible formats. Please see the [[#Trouble reporting|Trouble reporting]] section if a valid image isn't displayed properly.<br />
<br />
== Adding gpxe support ==<br />
<br />
A [[GPXE|gpxe]] option ROM can nicely complement SeaBIOS and coreboot by adding network boot support. Adding gpxe is similar to [[#Adding a VGA option ROM]]. The first step is to find the Ethernet vendor/device ID. For example:<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
00:09.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet ['''10ec:8167'''] (rev 10)<br />
</source><br />
<br />
Then one can build a gpxe option ROM. For example:<br />
<br />
<source lang="bash"><br />
$ cd /path/to/gpxe/src/<br />
$ make bin/10ec8167.rom<br />
</source><br />
<br />
And add it to the coreboot image. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/gpxe/src/bin/10ec8167.rom -n pci10ec,8167.rom -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
As with VGA option ROMs, the gpxe option ROM may be compressed with LZMA. However, compression won't significantly reduce gpxe's size as it implements its own compression.<br />
<br />
In addition to gpxe, other option ROMs can be added in the same manner.<br />
<br />
== Adding payloads ==<br />
<br />
Most [[Payloads|payloads]] can also be launched from SeaBIOS. To add a payload, build the corresponding .elf file and then add it to the '''coreboot.rom''' file in the '''img/''' directory. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add-payload /path/to/payload.elf img/MyPayload l<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
During boot, one can press the '''ESC''' key to get a boot menu. SeaBIOS will show all files in the '''img/''' directory, and one can instruct SeaBIOS to run them.<br />
<br />
SeaBIOS supports both uncompressed and LZMA compressed payloads.<br />
<br />
== Adding a floppy image ==<br />
<br />
It is possible to embed an image of a floppy in flash. SeaBIOS can then boot from and redirect floppy BIOS calls to the flash image. This is mainly useful for legacy software (such as DOS utilities). To use this feature, place a floppy image into the CBFS directory '''floppyimg/'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/myfloppy.img -c lzma -n floppyimg/MyFloppy.lzma -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
Both uncompressed and LZMA compressed images are supported. Several floppy formats are available: 360K, 1.2MB, 720K, 1.44MB, 2.88MB, 160K, 180K, 320K.<br />
<br />
The floppy image will appear as writable to the system, however all writes are discarded on reboot.<br />
<br />
When using this system, SeaBIOS reserves high-memory to store the floppy. The reserved memory is then no longer available for OS use, so this feature should only be used when needed.<br />
<br />
== Configuring boot order ==<br />
<br />
Place a file in CBFS with the name '''bootorder''' to configure the boot up order. The file should be ASCII text and contain one line per boot method. The description of each boot method follows an [https://secure.wikimedia.org/wikipedia/en/wiki/Open_firmware Open Firmware] device path format. SeaBIOS will attempt to boot from each item in the file &mdash; first line of the file first.<br />
<br />
The easiest way to find the available boot methods is to look for "Searching bootorder for" in the SeaBIOS serial output. For example, one may see lines similar to:<br />
<br />
Searching bootorder for: /pci@i0cf8/*@f/drive@1/disk@0<br />
Searching bootorder for: /pci@i0cf8/*@f,1/drive@2/disk@1<br />
Searching bootorder for: /pci@i0cf8/usb@10,4/*@2<br />
<br />
The above represents the patterns SeaBIOS will search for in the bootorder file. However, it's safe to just copy and paste the pattern into bootorder. For example, the file:<br />
<br />
/pci@i0cf8/usb@10,4/*@2<br />
/pci@i0cf8/*@f/drive@1/disk@0<br />
<br />
will instruct SeaBIOS to attempt to boot from the given USB drive first and then attempt the given ATA harddrive second.<br />
<br />
Once a file has been created, add it to CBFS with the name '''bootorder'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f mybootlist.txt -n bootorder -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
== Other Configuration items ==<br />
<br />
Additional configuration options are available in the CBFS '''etc/''' directory. For example, to set the duration of the boot menu to five and a half seconds, one would do the following:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add-int -i 5500 -n etc/boot-menu-wait<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
The cbfstool "add-int" command will create a litte-endian encoded binary integer and place it into the specified CBFS file.<br />
<br />
See the [http://seabios.org/Runtime_config SeaBIOS wiki] for details on available options.<br />
<br />
== File aliases ==<br />
<br />
It is possible to create the equivalent of "symbolic links" in CBFS so that one file's content appears under another name. To do this, create a links file with one line per link and each line having the format of "linkname" and "destname" separated by a space character. For example, the "links" file may look like:<br />
<br />
pci1234,1000.rom somerom.rom<br />
pci1234,1001.rom somerom.rom<br />
pci1234,1002.rom somerom.rom<br />
<br />
Then add the "links" file to CBFS:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f links -n links -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
The above example would cause SeaBIOS to treat "pci1234,1000.rom" or "pci1234,1001.rom" as files with the same content as the file "somerom.rom".<br />
<br />
= Trouble reporting =<br />
<br />
If you are experiencing problems with SeaBIOS, please follow the directions on the [http://seabios.org/Debugging SeaBIOS wiki] to report the issue.</div>KevinOConnorhttps://www.coreboot.org/index.php?title=SeaBIOS&diff=15817SeaBIOS2015-03-18T16:37:56Z<p>KevinOConnor: Point to SeaBIOS wiki for areas that are "reference material" - this way they stay up to date</p>
<hr />
<div>[http://seabios.org '''SeaBIOS'''] is an open-source legacy BIOS implementation which can be used as a coreboot [[Payloads|payload]]. It implements the standard [https://secure.wikimedia.org/wikipedia/en/wiki/BIOS BIOS] calling interfaces that a typical x86 proprietary BIOS implements.<br />
<br />
This page describes using SeaBIOS with coreboot. SeaBIOS can also run natively in [[QEMU]] and [http://bochs.sourceforge.net/ bochs] &mdash; see the [http://seabios.org SeaBIOS website] for information on non-coreboot uses.<br />
<br />
= Use cases =<br />
<br />
Any software requiring 16-bit BIOS services benefits from SeaBIOS (eg, Windows and DOS). SeaBIOS also enables booting Linux out of the box (using standard boot-loaders like GRUB and Syslinux).<br />
<br />
SeaBIOS supports booting from ATA hard drives, ATAPI CDROMs, USB hard drives, USB CDROMs, payloads in flash, and from [http://en.wikipedia.org/wiki/Option_ROM Option ROMs] (eg, SCSI or network cards). SeaBIOS can initialize and use a PS/2 keyboard or USB keyboard.<br />
<br />
== Windows ==<br />
<br />
SeaBIOS has been tested with Windows XP, Windows 2008, Windows Vista (64/32 bit), Windows 7 (32 bit and 64 bit).<br />
<br />
However, Windows has a very strict ACPI interpreter, and some coreboot boards do not have a complete [[ACPI|ACPI definition]]. As a result, some coreboot boards may fail during Windows boot (eg, it may fail with a '''STOP 0xA5''' code).<br />
<br />
Many boards do have working ACPI and are able to boot XP/Vista/Windows 7. Please check the board documentation or ask on the [[Mailinglist|mailing list]] if unsure of the status.<br />
<br />
== Linux ==<br />
<br />
SeaBIOS has been tested with GRUB, LILO, and Syslinux. Linux booting works well.<br />
<br />
== Other ==<br />
<br />
SeaBIOS has also been tested with FreeDOS, NetBSD, and OpenBSD.<br />
<br />
Because SeaBIOS implements the standard x86 BIOS interfaces, it is expected many other operating systems and boot-loaders will work.<br />
<br />
= Building =<br />
<br />
== Building via coreboot's menuconfig ==<br />
<br />
Probably the easiest way to use SeaBIOS as coreboot payload is to simply use the coreboot build process, which downloads and builds SeaBIOS as payload by default nowadays. You just have to run the following in your coreboot checkout:<br />
<br />
<source lang="bash"><br />
$ make menuconfig<br />
$ make<br />
</source><br />
<br />
Both SeaBIOS and coreboot will be built, and SeaBIOS will be added as payload to the '''coreboot.rom''' image that is being built.<br />
<br />
== Manual build ==<br />
<br />
One can download the latest version of SeaBIOS through a git repository:<br />
<br />
<source lang="bash"><br />
$ git clone git://git.seabios.org/seabios.git seabios<br />
$ cd seabios<br />
</source><br />
<br />
There's also a [http://code.coreboot.org/p/seabios/source/changes/master/ gitweb] facility to browse the latest source code online.<br />
<br />
Run '''make menuconfig''' and set the following variables:<br />
<br />
* CONFIG_COREBOOT 1<br />
* CONFIG_DEBUG_SERIAL 1<br />
<br />
Then:<br />
<br />
<source lang="bash"><br />
$ make<br />
</source><br />
<br />
The final SeaBIOS payload file is '''out/bios.bin.elf'''.<br />
<br />
== coreboot ==<br />
<br />
Configure coreboot with the following all disabled: '''CONFIG_VGA_ROM_RUN''', '''CONFIG_PCI_ROM_RUN''', '''CONFIG_ON_DEVICE_ROM_RUN'''<br />
<br />
Then configure the SeaBIOS '''out/bios.bin.elf''' file as the coreboot payload and build coreboot. The resulting '''coreboot.rom''' file will contain both SeaBIOS and coreboot, and it can be flashed to a ROM chip.<br />
<br />
= SeaBIOS and CBFS =<br />
<br />
SeaBIOS can read the coreboot flash filesystem and extract files. Details on the CBFS files that SeaBIOS supports are on the [http://seabios.org/Runtime_config SeaBIOS wiki].<br />
<br />
The following examples show some commonly used features.<br />
<br />
== Adding a VGA option ROM ==<br />
<br />
It is frequently necessary to add a VGA option ROM to CBFS in order to use a VGA adapter that is built-in to a motherboard. Note, VGA adapters on external cards (PCI, AGP, PCIe) do not require this step as SeaBIOS will automatically extract the VGA BIOS directly from the card. For machines without a VGA adapter, please follow the [[#Adding sgabios support|sgabios instructions]] below.<br />
<br />
=== Using your BIOS's VGA option rom ===<br />
The first step is to find the vendor and device ID of the built-in VGA adapter. This information can be found from '''lspci''':<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
01:00.0 VGA compatible controller [0300]: VIA Technologies, Inc. UniChrome Pro IGP ['''1106:3344'''] (rev 01) (prog-if 00 [VGA controller])<br />
</source><br />
<br />
In the above example, the VGA vendor/device ID is '''1106:3344'''. [[VGA support#How_to_retrieve_a_good_video_bios|Obtain the VGA ROM]] (eg, '''vgabios.bin''') and add it to the ROM with:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/vgabios.bin -n pci1106,3344.rom -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
Alternatively, SeaBIOS supports LZMA compressed option ROMs. Use the following to add a compressed option ROM instead:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/vgabios.bin > vgabios.bin.lzma<br />
$ ./build/cbfstool build/coreboot.rom add -f vgabios.bin.lzma -n pci1106,3344.rom.lzma -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
After the above is done, one can write the '''coreboot.rom''' file to flash. SeaBIOS will extract the VGA ROM and run it during boot.<br />
<br />
=== Adding sgabios support ===<br />
<br />
An [http://code.google.com/p/sgabios/ sgabios] option ROM can forward many VGA BIOS requests and keyboard events over a serial port. One can deploy it in addition to the primary VGA BIOS or by itself.<br />
<br />
If the target machine does not have a VGA adapter, then one should install sgabios. Most bootloaders (eg, GRUB) require a VGA BIOS in order to function properly &mdash; the sgabios ROM can fill this requirement.<br />
<br />
Place the sgabios ROM file in the '''vgaroms/''' directory of CBFS. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/sgabios.bin -n vgaroms/sgabios.bin -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
When using sgabios, all the characters that SeaBIOS writes to the screen will be seen twice &mdash; once from SeaBIOS sending the character to the serial port and once from sgabios forwarding the character. To prevent the duplicates set the [[#Other Configuration items|config file]] '''etc/screen-and-debug''' to zero.<br />
<br />
=== Using coreboot VGA support ===<br />
Coreboot can initialize the GPU of some mainboards. After initializing the GPU, the information about it is passed to the payload.<br />
<br />
SeaBIOS can provide an option rom that implements legacy VGA BIOS compatibility for coreboot initialized GPUs. To use this feature select '''CONFIG_VGA_COREBOOT''' (in "make menuconfig" under "VGA ROM ---> VGA Hardware Type" select "coreboot linear framebuffer").<br />
<br />
The resulting option rom is in '''out/vgabios.rom'''. It can be added to '''coreboot.rom''' the same way one would add [[SeaBIOS#Adding_sgabios_support|sgabios]].<br />
<br />
=== Geode option roms ===<br />
There are two VGA option roms for geode in SeaBIOS, they can be found in "VGA ROM --->" in "make menuconfig":<br />
<br />
* The first one is for the Geode LX, its named "GeodeLX" in "make menuconfig"<br />
* The second one if for the Geode GX2, its named "Geode GX2" in "make menuconfig"<br />
<br />
== Adding a graphical "bootsplash" image ==<br />
<br />
SeaBIOS can show a custom [http://en.wikipedia.org/wiki/JPEG JPEG] image or [http://en.wikipedia.org/wiki/BMP_file_format BMP] image during bootup. To enable this, add the JPEG file to flash with the name '''bootsplash.jpg''' or BMP file as '''bootsplash.bmp'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/image.jpg -n bootsplash.jpg -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
The size of the image determines the video mode to use for showing the image. Make sure the dimensions of the image exactly correspond to an available video mode (eg, 640x480, or 1024x768), otherwise it will not be displayed.<br />
<br />
SeaBIOS will show the image during the wait for the boot menu (if the boot menu has been disabled, users will not see the image). The image should probably have "Press F12 for boot menu" embedded in it so users know they can enter the normal SeaBIOS boot menu. By default, the boot menu prompt (and thus graphical image) is shown for 2.5 seconds. This can be customized via a [[#Other Configuration items|configuration parameter]].<br />
<br />
The JPEG viewer in SeaBIOS uses a simplified decoding algorithm. It supports most common JPEGs, but does not support all possible formats. Please see the [[#Trouble reporting|Trouble reporting]] section if a valid image isn't displayed properly.<br />
<br />
== Adding gpxe support ==<br />
<br />
A [[GPXE|gpxe]] option ROM can nicely complement SeaBIOS and coreboot by adding network boot support. Adding gpxe is similar to [[#Adding a VGA option ROM]]. The first step is to find the Ethernet vendor/device ID. For example:<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
00:09.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet ['''10ec:8167'''] (rev 10)<br />
</source><br />
<br />
Then one can build a gpxe option ROM. For example:<br />
<br />
<source lang="bash"><br />
$ cd /path/to/gpxe/src/<br />
$ make bin/10ec8167.rom<br />
</source><br />
<br />
And add it to the coreboot image. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/gpxe/src/bin/10ec8167.rom -n pci10ec,8167.rom -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
As with VGA option ROMs, the gpxe option ROM may be compressed with LZMA. However, compression won't significantly reduce gpxe's size as it implements its own compression.<br />
<br />
In addition to gpxe, other option ROMs can be added in the same manner.<br />
<br />
== Adding payloads ==<br />
<br />
Most [[Payloads|payloads]] can also be launched from SeaBIOS. To add a payload, build the corresponding .elf file and then add it to the '''coreboot.rom''' file in the '''img/''' directory. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add-payload /path/to/payload.elf img/MyPayload l<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
During boot, one can press the '''ESC''' key to get a boot menu. SeaBIOS will show all files in the '''img/''' directory, and one can instruct SeaBIOS to run them.<br />
<br />
SeaBIOS supports both uncompressed and LZMA compressed payloads.<br />
<br />
== Adding a floppy image ==<br />
<br />
It is possible to embed an image of a floppy in flash. SeaBIOS can then boot from and redirect floppy BIOS calls to the flash image. This is mainly useful for legacy software (such as DOS utilities). To use this feature, place a floppy image into the CBFS directory '''floppyimg/'''. For example:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/myfloppy.img > myfloppy.img.lzma<br />
$ ./build/cbfstool build/coreboot.rom add -f myfloppy.img.lzma -n floppyimg/MyFloppy.lzma -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
Both uncompressed and LZMA compressed images are supported. Several floppy formats are available: 360K, 1.2MB, 720K, 1.44MB, 2.88MB, 160K, 180K, 320K.<br />
<br />
The floppy image will appear as writable to the system, however all writes are discarded on reboot.<br />
<br />
When using this system, SeaBIOS reserves high-memory to store the floppy. The reserved memory is then no longer available for OS use, so this feature should only be used when needed.<br />
<br />
== Configuring boot order ==<br />
<br />
Place a file in CBFS with the name '''bootorder''' to configure the boot up order. The file should be ASCII text and contain one line per boot method. The description of each boot method follows an [https://secure.wikimedia.org/wikipedia/en/wiki/Open_firmware Open Firmware] device path format. SeaBIOS will attempt to boot from each item in the file &mdash; first line of the file first.<br />
<br />
The easiest way to find the available boot methods is to look for "Searching bootorder for" in the SeaBIOS serial output. For example, one may see lines similar to:<br />
<br />
Searching bootorder for: /pci@i0cf8/*@f/drive@1/disk@0<br />
Searching bootorder for: /pci@i0cf8/*@f,1/drive@2/disk@1<br />
Searching bootorder for: /pci@i0cf8/usb@10,4/*@2<br />
<br />
The above represents the patterns SeaBIOS will search for in the bootorder file. However, it's safe to just copy and paste the pattern into bootorder. For example, the file:<br />
<br />
/pci@i0cf8/usb@10,4/*@2<br />
/pci@i0cf8/*@f/drive@1/disk@0<br />
<br />
will instruct SeaBIOS to attempt to boot from the given USB drive first and then attempt the given ATA harddrive second.<br />
<br />
Once a file has been created, add it to CBFS with the name '''bootorder'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f mybootlist.txt -n bootorder -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
== Other Configuration items ==<br />
<br />
Additional configuration options are available in the CBFS '''etc/''' directory. For example, to set the duration of the boot menu to five and a half seconds, one would do the following:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add-int -i 5500 -n etc/boot-menu-wait<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
The cbfstool "add-int" command will create a litte-endian encoded binary integer and place it into the specified CBFS file.<br />
<br />
See the [http://seabios.org/Runtime_config SeaBIOS wiki] for details on available options.<br />
<br />
== File aliases ==<br />
<br />
It is possible to create the equivalent of "symbolic links" in CBFS so that one file's content appears under another name. To do this, create a links file with one line per link and each line having the format of "linkname" and "destname" separated by a space character. For example, the "links" file may look like:<br />
<br />
pci1234,1000.rom somerom.rom<br />
pci1234,1001.rom somerom.rom<br />
pci1234,1002.rom somerom.rom<br />
<br />
Then add the "links" file to CBFS:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f links -n links -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
The above example would cause SeaBIOS to treat "pci1234,1000.rom" or "pci1234,1001.rom" as files with the same content as the file "somerom.rom".<br />
<br />
= Trouble reporting =<br />
<br />
If you are experiencing problems with SeaBIOS, please follow the directions on the [http://seabios.org/Debugging SeaBIOS wiki] to report the issue.</div>KevinOConnorhttps://www.coreboot.org/index.php?title=SeaBIOS&diff=15516SeaBIOS2015-01-26T20:26:15Z<p>KevinOConnor: Remove ancient SeaBIOS README link</p>
<hr />
<div>[http://www.seabios.org '''SeaBIOS'''] is an open-source legacy BIOS implementation which can be used as a coreboot [[Payloads|payload]]. It implements the standard [https://secure.wikimedia.org/wikipedia/en/wiki/BIOS BIOS] calling interfaces that a typical x86 proprietary BIOS implements.<br />
<br />
This page describes using SeaBIOS with coreboot. SeaBIOS can also run natively in [[QEMU]] and [http://bochs.sourceforge.net/ bochs] &mdash; see the [http://www.seabios.org SeaBIOS website] for information on non-coreboot uses.<br />
<br />
= Use cases =<br />
<br />
Any software requiring 16-bit BIOS services benefits from SeaBIOS (eg, Windows and DOS). SeaBIOS also enables booting Linux out of the box (using standard boot-loaders like GRUB and Syslinux).<br />
<br />
SeaBIOS supports booting from ATA hard drives, ATAPI CDROMs, USB hard drives, USB CDROMs, payloads in flash, and from [http://en.wikipedia.org/wiki/Option_ROM Option ROMs] (eg, SCSI or network cards). SeaBIOS can initialize and use a PS/2 keyboard or USB keyboard.<br />
<br />
== Windows ==<br />
<br />
SeaBIOS has been tested with Windows XP, Windows 2008, Windows Vista (64/32 bit), Windows 7 (32 bit and 64 bit).<br />
<br />
However, Windows has a very strict ACPI interpreter, and some coreboot boards do not have a complete [[ACPI|ACPI definition]]. As a result, some coreboot boards may fail during Windows boot (eg, it may fail with a '''STOP 0xA5''' code).<br />
<br />
Many boards do have working ACPI and are able to boot XP/Vista/Windows 7. Please check the board documentation or ask on the [[Mailinglist|mailing list]] if unsure of the status.<br />
<br />
== Linux ==<br />
<br />
SeaBIOS has been tested with GRUB, LILO, and Syslinux. Linux booting works well.<br />
<br />
== Other ==<br />
<br />
SeaBIOS has also been tested with FreeDOS, NetBSD, and OpenBSD.<br />
<br />
Because SeaBIOS implements the standard x86 BIOS interfaces, it is expected many other operating systems and boot-loaders will work.<br />
<br />
= Building =<br />
<br />
== Building via coreboot's menuconfig ==<br />
<br />
Probably the easiest way to use SeaBIOS as coreboot payload is to simply use the coreboot build process, which downloads and builds SeaBIOS as payload by default nowadays. You just have to run the following in your coreboot checkout:<br />
<br />
<source lang="bash"><br />
$ make menuconfig<br />
$ make<br />
</source><br />
<br />
Both SeaBIOS and coreboot will be built, and SeaBIOS will be added as payload to the '''coreboot.rom''' image that is being built.<br />
<br />
== Manual build ==<br />
<br />
One can download the latest version of SeaBIOS through a git repository:<br />
<br />
<source lang="bash"><br />
$ git clone git://git.seabios.org/seabios.git seabios<br />
$ cd seabios<br />
</source><br />
<br />
There's also a [http://code.coreboot.org/p/seabios/source/changes/master/ gitweb] facility to browse the latest source code online.<br />
<br />
Run '''make menuconfig''' and set the following variables:<br />
<br />
* CONFIG_COREBOOT 1<br />
* CONFIG_DEBUG_SERIAL 1<br />
<br />
Then:<br />
<br />
<source lang="bash"><br />
$ make<br />
</source><br />
<br />
The final SeaBIOS payload file is '''out/bios.bin.elf'''.<br />
<br />
== coreboot ==<br />
<br />
Configure coreboot with the following all disabled: '''CONFIG_VGA_ROM_RUN''', '''CONFIG_PCI_ROM_RUN''', '''CONFIG_ON_DEVICE_ROM_RUN'''<br />
<br />
Then configure the SeaBIOS '''out/bios.bin.elf''' file as the coreboot payload and build coreboot. The resulting '''coreboot.rom''' file will contain both SeaBIOS and coreboot, and it can be flashed to a ROM chip.<br />
<br />
= SeaBIOS and CBFS =<br />
<br />
SeaBIOS can read the coreboot flash filesystem and extract files.<br />
<br />
When SeaBIOS scans the target machine's PCI devices, it will recognize option ROMs in CBFS that have the form '''pciVVVV,DDDD.rom'''. It will also run any file in the directory '''vgaroms/''' as a VGA option ROM not specific to a device and files in '''genroms/''' as a generic option ROM not specific to a device. In the above cases, SeaBIOS will recognize files with a '''.lzma''' suffix, and automatically decompress them (eg, '''pci1106,3344.rom.lzma''' and '''vgaroms/sgabios.bin.lzma''').<br />
<br />
SeaBIOS can also load a graphical bootsplash image from '''bootsplash.jpg''' or '''bootsplash.bmp''', payloads found in the CBFS directory '''img/''', and floppy images found in the '''floppyimg/''' directory.<br />
<br />
Further, SeaBIOS can obtain configuration information from CBFS. A file '''bootorder''' determines the order of devices and methods to attempt to boot the system from. Additional configuration items may be found in the CBFS '''etc/''' directory. It's also possible to create CBFS file aliases with the '''links''' file.<br />
<br />
The examples below show some common uses of these features.<br />
<br />
== Adding a VGA option ROM ==<br />
<br />
It is frequently necessary to add a VGA option ROM to CBFS in order to use a VGA adapter that is built-in to a motherboard. Note, VGA adapters on external cards (PCI, AGP, PCIe) do not require this step as SeaBIOS will automatically extract the VGA BIOS directly from the card. For machines without a VGA adapter, please follow the [[#Adding sgabios support|sgabios instructions]] below.<br />
<br />
=== Using your BIOS's VGA option rom ===<br />
The first step is to find the vendor and device ID of the built-in VGA adapter. This information can be found from '''lspci''':<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
01:00.0 VGA compatible controller [0300]: VIA Technologies, Inc. UniChrome Pro IGP ['''1106:3344'''] (rev 01) (prog-if 00 [VGA controller])<br />
</source><br />
<br />
In the above example, the VGA vendor/device ID is '''1106:3344'''. [[VGA support#How_to_retrieve_a_good_video_bios|Obtain the VGA ROM]] (eg, '''vgabios.bin''') and add it to the ROM with:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/vgabios.bin -n pci1106,3344.rom -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
Alternatively, SeaBIOS supports LZMA compressed option ROMs. Use the following to add a compressed option ROM instead:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/vgabios.bin > vgabios.bin.lzma<br />
$ ./build/cbfstool build/coreboot.rom add -f vgabios.bin.lzma -n pci1106,3344.rom.lzma -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
After the above is done, one can write the '''coreboot.rom''' file to flash. SeaBIOS will extract the VGA ROM and run it during boot.<br />
<br />
=== Adding sgabios support ===<br />
<br />
An [http://code.google.com/p/sgabios/ sgabios] option ROM can forward many VGA BIOS requests and keyboard events over a serial port. One can deploy it in addition to the primary VGA BIOS or by itself.<br />
<br />
If the target machine does not have a VGA adapter, then one should install sgabios. Most bootloaders (eg, GRUB) require a VGA BIOS in order to function properly &mdash; the sgabios ROM can fill this requirement.<br />
<br />
Place the sgabios ROM file in the '''vgaroms/''' directory of CBFS. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/sgabios.bin -n vgaroms/sgabios.bin -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
When using sgabios, all the characters that SeaBIOS writes to the screen will be seen twice &mdash; once from SeaBIOS sending the character to the serial port and once from sgabios forwarding the character. To prevent the duplicates set the [[#Other Configuration items|config file]] '''etc/screen-and-debug''' to zero.<br />
<br />
=== Using coreboot VGA support ===<br />
Coreboot can initialize the GPU of some mainboards. After initializing the GPU, the information about it is passed to the payload.<br />
<br />
SeaBIOS can provide an option rom that implements legacy VGA BIOS compatibility for coreboot initialized GPUs. To use this feature select '''CONFIG_VGA_COREBOOT''' (in "make menuconfig" under "VGA ROM ---> VGA Hardware Type" select "coreboot linear framebuffer").<br />
<br />
The resulting option rom is in '''out/vgabios.rom'''. It can be added to '''coreboot.rom''' the same way one would add [[SeaBIOS#Adding_sgabios_support|sgabios]].<br />
<br />
=== Geode option roms ===<br />
There are two VGA option roms for geode in SeaBIOS, they can be found in "VGA ROM --->" in "make menuconfig":<br />
<br />
* The first one is for the Geode LX, its named "GeodeLX" in "make menuconfig"<br />
* The second one if for the Geode GX2, its named "Geode GX2" in "make menuconfig"<br />
<br />
== Adding a graphical "bootsplash" image ==<br />
<br />
SeaBIOS can show a custom [http://en.wikipedia.org/wiki/JPEG JPEG] image or [http://en.wikipedia.org/wiki/BMP_file_format BMP] image during bootup. To enable this, add the JPEG file to flash with the name '''bootsplash.jpg''' or BMP file as '''bootsplash.bmp'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/image.jpg -n bootsplash.jpg -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
The size of the image determines the video mode to use for showing the image. Make sure the dimensions of the image exactly correspond to an available video mode (eg, 640x480, or 1024x768), otherwise it will not be displayed.<br />
<br />
SeaBIOS will show the image during the wait for the boot menu (if the boot menu has been disabled, users will not see the image). The image should probably have "Press F12 for boot menu" embedded in it so users know they can enter the normal SeaBIOS boot menu. By default, the boot menu prompt (and thus graphical image) is shown for 2.5 seconds. This can be customized via a [[#Other Configuration items|configuration parameter]].<br />
<br />
The JPEG viewer in SeaBIOS uses a simplified decoding algorithm. It supports most common JPEGs, but does not support all possible formats. Please see the [[#Trouble reporting|Trouble reporting]] section if a valid image isn't displayed properly.<br />
<br />
== Adding gpxe support ==<br />
<br />
A [[GPXE|gpxe]] option ROM can nicely complement SeaBIOS and coreboot by adding network boot support. Adding gpxe is similar to [[#Adding a VGA option ROM]]. The first step is to find the Ethernet vendor/device ID. For example:<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
00:09.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet ['''10ec:8167'''] (rev 10)<br />
</source><br />
<br />
Then one can build a gpxe option ROM. For example:<br />
<br />
<source lang="bash"><br />
$ cd /path/to/gpxe/src/<br />
$ make bin/10ec8167.rom<br />
</source><br />
<br />
And add it to the coreboot image. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/gpxe/src/bin/10ec8167.rom -n pci10ec,8167.rom -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
As with VGA option ROMs, the gpxe option ROM may be compressed with LZMA. However, compression won't significantly reduce gpxe's size as it implements its own compression.<br />
<br />
In addition to gpxe, other option ROMs can be added in the same manner.<br />
<br />
== Adding payloads ==<br />
<br />
Most [[Payloads|payloads]] can also be launched from SeaBIOS. To add a payload, build the corresponding .elf file and then add it to the '''coreboot.rom''' file in the '''img/''' directory. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add-payload /path/to/payload.elf img/MyPayload l<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
During boot, one can press the '''F12''' key to get a boot menu. SeaBIOS will show all files in the '''img/''' directory, and one can instruct SeaBIOS to run them.<br />
<br />
SeaBIOS supports both uncompressed and LZMA compressed payloads.<br />
<br />
== Adding a floppy image ==<br />
<br />
It is possible to embed an image of a floppy in flash. SeaBIOS can then boot from and redirect floppy BIOS calls to the flash image. This is mainly useful for legacy software (such as DOS utilities). To use this feature, place a floppy image into the CBFS directory '''floppyimg/'''. For example:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/myfloppy.img > myfloppy.img.lzma<br />
$ ./build/cbfstool build/coreboot.rom add -f myfloppy.img.lzma -n floppyimg/MyFloppy.lzma -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
Both uncompressed and LZMA compressed images are supported. Several floppy formats are available: 360K, 1.2MB, 720K, 1.44MB, 2.88MB, 160K, 180K, 320K.<br />
<br />
The floppy image will appear as writable to the system, however all writes are discarded on reboot.<br />
<br />
When using this system, SeaBIOS reserves high-memory to store the floppy. The reserved memory is then no longer available for OS use, so this feature should only be used when needed.<br />
<br />
== Configuring boot order ==<br />
<br />
Place a file in CBFS with the name '''bootorder''' to configure the boot up order. The file should be ASCII text and contain one line per boot method. The description of each boot method follows an [https://secure.wikimedia.org/wikipedia/en/wiki/Open_firmware Open Firmware] device path format. SeaBIOS will attempt to boot from each item in the file &mdash; first line of the file first.<br />
<br />
The easiest way to find the available boot methods is to look for "Searching bootorder for" in the SeaBIOS serial output. For example, one may see lines similar to:<br />
<br />
Searching bootorder for: /pci@i0cf8/*@f/drive@1/disk@0<br />
Searching bootorder for: /pci@i0cf8/*@f,1/drive@2/disk@1<br />
Searching bootorder for: /pci@i0cf8/usb@10,4/*@2<br />
<br />
The above represents the patterns SeaBIOS will search for in the bootorder file. However, it's safe to just copy and paste the pattern into bootorder. For example, the file:<br />
<br />
/pci@i0cf8/usb@10,4/*@2<br />
/pci@i0cf8/*@f/drive@1/disk@0<br />
<br />
will instruct SeaBIOS to attempt to boot from the given USB drive first and then attempt the given ATA harddrive second.<br />
<br />
Once a file has been created, add it to CBFS with the name '''bootorder'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f mybootlist.txt -n bootorder -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
== Other Configuration items ==<br />
<br />
Additional configuration options are available in the CBFS '''etc/''' directory. For example, to set the duration of the boot menu to five and a half seconds, one would do the following:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add-int -i 5500 -n etc/boot-menu-wait<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
The cbfstool "add-int" command will create a litte-endian encoded binary integer and place it into the specified CBFS file.<br />
<br />
{| border=1<br />
|+ Configuration variables<br />
|-<br />
! Filename !! Description<br />
|-<br />
| show-boot-menu || Controls the display of the boot menu. Set to 0 to disable the boot menu.<br />
|-<br />
| boot-menu-message || Customize the text boot menu message. Normally, when in text mode SeaBIOS will report the string "\nPress F12 for boot menu.\n\n". This field allows the string to be changed. (This is a string field, not an integer field, so place the string in a file and add with the regular cbfstool "add" command.)<br />
|-<br />
| boot-menu-key || Controls which key activates the boot menu. The value stored is the DOS scan code (eg, 0x86 for F12, 0x01 for Esc). If this field is set, be sure to also customize the '''boot-menu-message''' field above.<br />
|-<br />
| boot-menu-wait || Amount of time (in milliseconds) to wait at the boot menu prompt before selecting the default boot.<br />
|-<br />
| boot-fail-wait || If no boot devices are found SeaBIOS will reboot after 60 seconds. Set this to the amount of time (in milliseconds) to customize the reboot delay or set to -1 to disable rebooting when no boot devices are found<br />
|-<br />
| extra-pci-roots || If the target machine has multiple independent root buses set this to a positive value. The SeaBIOS PCI probe will then search for the given number of extra root buses.<br />
|-<br />
| ps2-keyboard-spinup || Some laptops that emulate PS2 keyboards don't respond to keyboard commands immediately after powering on. One may specify the amount of time (in milliseconds) here to allow as additional time for the keyboard to become responsive. When this field is set, SeaBIOS will repeatedly attempt to detect the keyboard until the keyboard is found or the specified timeout is reached.<br />
|-<br />
| optionroms-checksum || Option ROMs are required to have correct checksums. However, some option ROMs in the wild don't correctly follow the specifications and have bad checksums. Set this to a zero value to allow SeaBIOS to execute them anyways.<br />
|-<br />
| s3-resume-vga-init || Set this to a non-zero value to instruct SeaBIOS to run the vga rom on an S3 resume.<br />
|-<br />
| screen-and-debug || Set this to a zero value to instruct SeaBIOS to not write characters it sends to the screen to the debug ports. This can be useful when using [[#Adding sgabios support|sgabios]].<br />
|-<br />
| advertise-serial-debug-port || If using a serial debug port, one can set this file to a zero value to prevent SeaBIOS from listing that serial port as available for operating system use. This can be useful when running old DOS programs that are known to reset the baud rate of all advertised serial ports.<br />
|-<br />
| floppy0 || Set this to the type of the first floppy drive in the system (only type 4 for 3.5 inch drives is supported).<br />
|-<br />
| floppy1 || The type of the second floppy drive in the system. See the description of '''floppy0''' for more info.<br />
|-<br />
| threads || By default, SeaBIOS will parallelize hardware initialization during bootup to reduce boot time. Multiple hardware devices can be initialized in parallel between vga initialization and option rom initialization. One can set this file to a value of zero to force hardware initialization to run serially. Alternatively, one can set this file to 2 to enable early hardware initialization that runs in parallel with vga, option rom initialization, and the boot menu.<br />
|}<br />
<br />
== File aliases ==<br />
<br />
It is possible to create the equivalent of "symbolic links" in CBFS so that one file's content appears under another name. To do this, create a links file with one line per link and each line having the format of "linkname" and "destname" separated by a space character. For example, the "links" file may look like:<br />
<br />
pci1234,1000.rom somerom.rom<br />
pci1234,1001.rom somerom.rom<br />
pci1234,1002.rom somerom.rom<br />
<br />
Then add the "links" file to CBFS:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f links -n links -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
The above example would cause SeaBIOS to treat "pci1234,1000.rom" or "pci1234,1001.rom" as files with the same content as the file "somerom.rom".<br />
<br />
= Trouble reporting =<br />
<br />
If you are experiencing problems with SeaBIOS, it's useful to increase the debugging level. This is done by running '''make menuconfig''' and setting '''CONFIG_DEBUG_LEVEL''' to a higher value. A debug level of 8 will show a lot of diagnostic information without flooding the serial port (levels above 8 will frequently cause too much data).<br />
<br />
To report an issue, please collect the serial boot log with SeaBIOS set to a debug level of 8 and forward the full log along with a description of the problem to the coreboot [[Mailinglist|mailing list]].</div>KevinOConnorhttps://www.coreboot.org/index.php?title=SeaBIOS&diff=14124SeaBIOS2014-09-12T17:35:33Z<p>KevinOConnor: /* Other Configuration items */ cbfstool has an "add-int" command - use that in the examples</p>
<hr />
<div>[http://www.seabios.org '''SeaBIOS'''] is an open-source legacy BIOS implementation which can be used as a coreboot [[Payloads|payload]]. It implements the standard [https://secure.wikimedia.org/wikipedia/en/wiki/BIOS BIOS] calling interfaces that a typical x86 proprietary BIOS implements.<br />
<br />
This page describes using SeaBIOS with coreboot. SeaBIOS can also run natively in [[QEMU]] and [http://bochs.sourceforge.net/ bochs] &mdash; see the [http://git.linuxtogo.org/?p=kevin/seabios.git;a=blob;f=README;hb=HEAD SeaBIOS README] file for information on non-coreboot uses.<br />
<br />
= Use cases =<br />
<br />
Any software requiring 16-bit BIOS services benefits from SeaBIOS (eg, Windows and DOS). SeaBIOS also enables booting Linux out of the box (using standard boot-loaders like GRUB and Syslinux).<br />
<br />
SeaBIOS supports booting from ATA hard drives, ATAPI CDROMs, USB hard drives, USB CDROMs, payloads in flash, and from [http://en.wikipedia.org/wiki/Option_ROM Option ROMs] (eg, SCSI or network cards). SeaBIOS can initialize and use a PS/2 keyboard or USB keyboard.<br />
<br />
== Windows ==<br />
<br />
SeaBIOS has been tested with Windows XP, Windows 2008, Windows Vista (64/32 bit), Windows 7 (32 bit and 64 bit).<br />
<br />
However, Windows has a very strict ACPI interpreter, and some coreboot boards do not have a complete [[ACPI|ACPI definition]]. As a result, some coreboot boards may fail during Windows boot (eg, it may fail with a '''STOP 0xA5''' code).<br />
<br />
Many boards do have working ACPI and are able to boot XP/Vista/Windows 7. Please check the board documentation or ask on the [[Mailinglist|mailing list]] if unsure of the status.<br />
<br />
== Linux ==<br />
<br />
SeaBIOS has been tested with GRUB, LILO, and Syslinux. Linux booting works well.<br />
<br />
== Other ==<br />
<br />
SeaBIOS has also been tested with FreeDOS, NetBSD, and OpenBSD.<br />
<br />
Because SeaBIOS implements the standard x86 BIOS interfaces, it is expected many other operating systems and boot-loaders will work.<br />
<br />
= Building =<br />
<br />
== Building via coreboot's menuconfig ==<br />
<br />
Probably the easiest way to use SeaBIOS as coreboot payload is to simply use the coreboot build process, which downloads and builds SeaBIOS as payload by default nowadays. You just have to run the following in your coreboot checkout:<br />
<br />
<source lang="bash"><br />
$ make menuconfig<br />
$ make<br />
</source><br />
<br />
Both SeaBIOS and coreboot will be built, and SeaBIOS will be added as payload to the '''coreboot.rom''' image that is being built.<br />
<br />
== Manual build ==<br />
<br />
One can download the latest version of SeaBIOS through a git repository:<br />
<br />
<source lang="bash"><br />
$ git clone git://git.seabios.org/seabios.git seabios<br />
$ cd seabios<br />
</source><br />
<br />
There's also a [http://code.coreboot.org/p/seabios/source/changes/master/ gitweb] facility to browse the latest source code online.<br />
<br />
Run '''make menuconfig''' and set the following variables:<br />
<br />
* CONFIG_COREBOOT 1<br />
* CONFIG_DEBUG_SERIAL 1<br />
<br />
Then:<br />
<br />
<source lang="bash"><br />
$ make<br />
</source><br />
<br />
The final SeaBIOS payload file is '''out/bios.bin.elf'''.<br />
<br />
== coreboot ==<br />
<br />
Configure coreboot with the following all disabled: '''CONFIG_VGA_ROM_RUN''', '''CONFIG_PCI_ROM_RUN''', '''CONFIG_ON_DEVICE_ROM_RUN'''<br />
<br />
Then configure the SeaBIOS '''out/bios.bin.elf''' file as the coreboot payload and build coreboot. The resulting '''coreboot.rom''' file will contain both SeaBIOS and coreboot, and it can be flashed to a ROM chip.<br />
<br />
= SeaBIOS and CBFS =<br />
<br />
SeaBIOS can read the coreboot flash filesystem and extract files.<br />
<br />
When SeaBIOS scans the target machine's PCI devices, it will recognize option ROMs in CBFS that have the form '''pciVVVV,DDDD.rom'''. It will also run any file in the directory '''vgaroms/''' as a VGA option ROM not specific to a device and files in '''genroms/''' as a generic option ROM not specific to a device. In the above cases, SeaBIOS will recognize files with a '''.lzma''' suffix, and automatically decompress them (eg, '''pci1106,3344.rom.lzma''' and '''vgaroms/sgabios.bin.lzma''').<br />
<br />
SeaBIOS can also load a graphical bootsplash image from '''bootsplash.jpg''' or '''bootsplash.bmp''', payloads found in the CBFS directory '''img/''', and floppy images found in the '''floppyimg/''' directory.<br />
<br />
Further, SeaBIOS can obtain configuration information from CBFS. A file '''bootorder''' determines the order of devices and methods to attempt to boot the system from. Additional configuration items may be found in the CBFS '''etc/''' directory. It's also possible to create CBFS file aliases with the '''links''' file.<br />
<br />
The examples below show some common uses of these features.<br />
<br />
== Adding a VGA option ROM ==<br />
<br />
It is frequently necessary to add a VGA option ROM to CBFS in order to use a VGA adapter that is built-in to a motherboard. Note, VGA adapters on external cards (PCI, AGP, PCIe) do not require this step as SeaBIOS will automatically extract the VGA BIOS directly from the card. For machines without a VGA adapter, please follow the [[#Adding sgabios support|sgabios instructions]] below.<br />
<br />
=== Using your BIOS's VGA option rom ===<br />
The first step is to find the vendor and device ID of the built-in VGA adapter. This information can be found from '''lspci''':<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
01:00.0 VGA compatible controller [0300]: VIA Technologies, Inc. UniChrome Pro IGP ['''1106:3344'''] (rev 01) (prog-if 00 [VGA controller])<br />
</source><br />
<br />
In the above example, the VGA vendor/device ID is '''1106:3344'''. [[VGA support#How_to_retrieve_a_good_video_bios|Obtain the VGA ROM]] (eg, '''vgabios.bin''') and add it to the ROM with:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/vgabios.bin -n pci1106,3344.rom -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
Alternatively, SeaBIOS supports LZMA compressed option ROMs. Use the following to add a compressed option ROM instead:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/vgabios.bin > vgabios.bin.lzma<br />
$ ./build/cbfstool build/coreboot.rom add -f vgabios.bin.lzma -n pci1106,3344.rom.lzma -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
After the above is done, one can write the '''coreboot.rom''' file to flash. SeaBIOS will extract the VGA ROM and run it during boot.<br />
<br />
=== Adding sgabios support ===<br />
<br />
An [http://code.google.com/p/sgabios/ sgabios] option ROM can forward many VGA BIOS requests and keyboard events over a serial port. One can deploy it in addition to the primary VGA BIOS or by itself.<br />
<br />
If the target machine does not have a VGA adapter, then one should install sgabios. Most bootloaders (eg, GRUB) require a VGA BIOS in order to function properly &mdash; the sgabios ROM can fill this requirement.<br />
<br />
Place the sgabios ROM file in the '''vgaroms/''' directory of CBFS. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/sgabios.bin -n vgaroms/sgabios.bin -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
When using sgabios, all the characters that SeaBIOS writes to the screen will be seen twice &mdash; once from SeaBIOS sending the character to the serial port and once from sgabios forwarding the character. To prevent the duplicates set the [[#Other Configuration items|config file]] '''etc/screen-and-debug''' to zero.<br />
<br />
=== Using coreboot VGA support ===<br />
Coreboot can initialize the GPU of some mainboards. After initializing the GPU, the information about it is passed to the payload.<br />
<br />
SeaBIOS can provide an option rom that implements legacy VGA BIOS compatibility for coreboot initialized GPUs. To use this feature select '''CONFIG_VGA_COREBOOT''' (in "make menuconfig" under "VGA ROM ---> VGA Hardware Type" select "coreboot linear framebuffer").<br />
<br />
The resulting option rom is in '''out/vgabios.rom'''. It can be added to '''coreboot.rom''' the same way one would add [[SeaBIOS#Adding_sgabios_support|sgabios]].<br />
<br />
=== Geode option roms ===<br />
There are two VGA option roms for geode in SeaBIOS, they can be found in "VGA ROM --->" in "make menuconfig":<br />
<br />
* The first one is for the Geode LX, its named "GeodeLX" in "make menuconfig"<br />
* The second one if for the Geode GX2, its named "Geode GX2" in "make menuconfig"<br />
<br />
== Adding a graphical "bootsplash" image ==<br />
<br />
SeaBIOS can show a custom [http://en.wikipedia.org/wiki/JPEG JPEG] image or [http://en.wikipedia.org/wiki/BMP_file_format BMP] image during bootup. To enable this, add the JPEG file to flash with the name '''bootsplash.jpg''' or BMP file as '''bootsplash.bmp'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/image.jpg -n bootsplash.jpg -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
The size of the image determines the video mode to use for showing the image. Make sure the dimensions of the image exactly correspond to an available video mode (eg, 640x480, or 1024x768), otherwise it will not be displayed.<br />
<br />
SeaBIOS will show the image during the wait for the boot menu (if the boot menu has been disabled, users will not see the image). The image should probably have "Press F12 for boot menu" embedded in it so users know they can enter the normal SeaBIOS boot menu. By default, the boot menu prompt (and thus graphical image) is shown for 2.5 seconds. This can be customized via a [[#Other Configuration items|configuration parameter]].<br />
<br />
The JPEG viewer in SeaBIOS uses a simplified decoding algorithm. It supports most common JPEGs, but does not support all possible formats. Please see the [[#Trouble reporting|Trouble reporting]] section if a valid image isn't displayed properly.<br />
<br />
== Adding gpxe support ==<br />
<br />
A [[GPXE|gpxe]] option ROM can nicely complement SeaBIOS and coreboot by adding network boot support. Adding gpxe is similar to [[#Adding a VGA option ROM]]. The first step is to find the Ethernet vendor/device ID. For example:<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
00:09.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet ['''10ec:8167'''] (rev 10)<br />
</source><br />
<br />
Then one can build a gpxe option ROM. For example:<br />
<br />
<source lang="bash"><br />
$ cd /path/to/gpxe/src/<br />
$ make bin/10ec8167.rom<br />
</source><br />
<br />
And add it to the coreboot image. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/gpxe/src/bin/10ec8167.rom -n pci10ec,8167.rom -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
As with VGA option ROMs, the gpxe option ROM may be compressed with LZMA. However, compression won't significantly reduce gpxe's size as it implements its own compression.<br />
<br />
In addition to gpxe, other option ROMs can be added in the same manner.<br />
<br />
== Adding payloads ==<br />
<br />
Most [[Payloads|payloads]] can also be launched from SeaBIOS. To add a payload, build the corresponding .elf file and then add it to the '''coreboot.rom''' file in the '''img/''' directory. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add-payload /path/to/payload.elf img/MyPayload l<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
During boot, one can press the '''F12''' key to get a boot menu. SeaBIOS will show all files in the '''img/''' directory, and one can instruct SeaBIOS to run them.<br />
<br />
SeaBIOS supports both uncompressed and LZMA compressed payloads.<br />
<br />
== Adding a floppy image ==<br />
<br />
It is possible to embed an image of a floppy in flash. SeaBIOS can then boot from and redirect floppy BIOS calls to the flash image. This is mainly useful for legacy software (such as DOS utilities). To use this feature, place a floppy image into the CBFS directory '''floppyimg/'''. For example:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/myfloppy.img > myfloppy.img.lzma<br />
$ ./build/cbfstool build/coreboot.rom add -f myfloppy.img.lzma -n floppyimg/MyFloppy.lzma -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
Both uncompressed and LZMA compressed images are supported. Several floppy formats are available: 360K, 1.2MB, 720K, 1.44MB, 2.88MB, 160K, 180K, 320K.<br />
<br />
The floppy image will appear as writable to the system, however all writes are discarded on reboot.<br />
<br />
When using this system, SeaBIOS reserves high-memory to store the floppy. The reserved memory is then no longer available for OS use, so this feature should only be used when needed.<br />
<br />
== Configuring boot order ==<br />
<br />
Place a file in CBFS with the name '''bootorder''' to configure the boot up order. The file should be ASCII text and contain one line per boot method. The description of each boot method follows an [https://secure.wikimedia.org/wikipedia/en/wiki/Open_firmware Open Firmware] device path format. SeaBIOS will attempt to boot from each item in the file &mdash; first line of the file first.<br />
<br />
The easiest way to find the available boot methods is to look for "Searching bootorder for" in the SeaBIOS serial output. For example, one may see lines similar to:<br />
<br />
Searching bootorder for: /pci@i0cf8/*@f/drive@1/disk@0<br />
Searching bootorder for: /pci@i0cf8/*@f,1/drive@2/disk@1<br />
Searching bootorder for: /pci@i0cf8/usb@10,4/*@2<br />
<br />
The above represents the patterns SeaBIOS will search for in the bootorder file. However, it's safe to just copy and paste the pattern into bootorder. For example, the file:<br />
<br />
/pci@i0cf8/usb@10,4/*@2<br />
/pci@i0cf8/*@f/drive@1/disk@0<br />
<br />
will instruct SeaBIOS to attempt to boot from the given USB drive first and then attempt the given ATA harddrive second.<br />
<br />
Once a file has been created, add it to CBFS with the name '''bootorder'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f mybootlist.txt -n bootorder -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
== Other Configuration items ==<br />
<br />
Additional configuration options are available in the CBFS '''etc/''' directory. For example, to set the duration of the boot menu to five and a half seconds, one would do the following:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add-int -i 5500 -n etc/boot-menu-wait<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
The cbfstool "add-int" command will create a litte-endian encoded binary integer and place it into the specified CBFS file.<br />
<br />
{| border=1<br />
|+ Configuration variables<br />
|-<br />
! Filename !! Description<br />
|-<br />
| show-boot-menu || Controls the display of the boot menu. Set to 0 to disable the boot menu.<br />
|-<br />
| boot-menu-message || Customize the text boot menu message. Normally, when in text mode SeaBIOS will report the string "\nPress F12 for boot menu.\n\n". This field allows the string to be changed. (This is a string field, not an integer field, so place the string in a file and add with the regular cbfstool "add" command.)<br />
|-<br />
| boot-menu-key || Controls which key activates the boot menu. The value stored is the DOS scan code (eg, 0x86 for F12, 0x01 for Esc). If this field is set, be sure to also customize the '''boot-menu-message''' field above.<br />
|-<br />
| boot-menu-wait || Amount of time (in milliseconds) to wait at the boot menu prompt before selecting the default boot.<br />
|-<br />
| boot-fail-wait || If no boot devices are found SeaBIOS will reboot after 60 seconds. Set this to the amount of time (in milliseconds) to customize the reboot delay or set to -1 to disable rebooting when no boot devices are found<br />
|-<br />
| extra-pci-roots || If the target machine has multiple independent root buses set this to a positive value. The SeaBIOS PCI probe will then search for the given number of extra root buses.<br />
|-<br />
| ps2-keyboard-spinup || Some laptops that emulate PS2 keyboards don't respond to keyboard commands immediately after powering on. One may specify the amount of time (in milliseconds) here to allow as additional time for the keyboard to become responsive. When this field is set, SeaBIOS will repeatedly attempt to detect the keyboard until the keyboard is found or the specified timeout is reached.<br />
|-<br />
| optionroms-checksum || Option ROMs are required to have correct checksums. However, some option ROMs in the wild don't correctly follow the specifications and have bad checksums. Set this to a zero value to allow SeaBIOS to execute them anyways.<br />
|-<br />
| s3-resume-vga-init || Set this to a non-zero value to instruct SeaBIOS to run the vga rom on an S3 resume.<br />
|-<br />
| screen-and-debug || Set this to a zero value to instruct SeaBIOS to not write characters it sends to the screen to the debug ports. This can be useful when using [[#Adding sgabios support|sgabios]].<br />
|-<br />
| advertise-serial-debug-port || If using a serial debug port, one can set this file to a zero value to prevent SeaBIOS from listing that serial port as available for operating system use. This can be useful when running old DOS programs that are known to reset the baud rate of all advertised serial ports.<br />
|-<br />
| floppy0 || Set this to the type of the first floppy drive in the system (only type 4 for 3.5 inch drives is supported).<br />
|-<br />
| floppy1 || The type of the second floppy drive in the system. See the description of '''floppy0''' for more info.<br />
|-<br />
| threads || By default, SeaBIOS will parallelize hardware initialization during bootup to reduce boot time. Multiple hardware devices can be initialized in parallel between vga initialization and option rom initialization. One can set this file to a value of zero to force hardware initialization to run serially. Alternatively, one can set this file to 2 to enable early hardware initialization that runs in parallel with vga, option rom initialization, and the boot menu.<br />
|}<br />
<br />
== File aliases ==<br />
<br />
It is possible to create the equivalent of "symbolic links" in CBFS so that one file's content appears under another name. To do this, create a links file with one line per link and each line having the format of "linkname" and "destname" separated by a space character. For example, the "links" file may look like:<br />
<br />
pci1234,1000.rom somerom.rom<br />
pci1234,1001.rom somerom.rom<br />
pci1234,1002.rom somerom.rom<br />
<br />
Then add the "links" file to CBFS:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f links -n links -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
The above example would cause SeaBIOS to treat "pci1234,1000.rom" or "pci1234,1001.rom" as files with the same content as the file "somerom.rom".<br />
<br />
= Trouble reporting =<br />
<br />
If you are experiencing problems with SeaBIOS, it's useful to increase the debugging level. This is done by running '''make menuconfig''' and setting '''CONFIG_DEBUG_LEVEL''' to a higher value. A debug level of 8 will show a lot of diagnostic information without flooding the serial port (levels above 8 will frequently cause too much data).<br />
<br />
To report an issue, please collect the serial boot log with SeaBIOS set to a debug level of 8 and forward the full log along with a description of the problem to the coreboot [[Mailinglist|mailing list]].</div>KevinOConnorhttps://www.coreboot.org/index.php?title=SeaBIOS&diff=14073SeaBIOS2014-08-23T14:28:54Z<p>KevinOConnor: /* SeaBIOS and CBFS */ Move sgabios section under vga section.</p>
<hr />
<div>[http://www.seabios.org '''SeaBIOS'''] is an open-source legacy BIOS implementation which can be used as a coreboot [[Payloads|payload]]. It implements the standard [https://secure.wikimedia.org/wikipedia/en/wiki/BIOS BIOS] calling interfaces that a typical x86 proprietary BIOS implements.<br />
<br />
This page describes using SeaBIOS with coreboot. SeaBIOS can also run natively in [[QEMU]] and [http://bochs.sourceforge.net/ bochs] &mdash; see the [http://git.linuxtogo.org/?p=kevin/seabios.git;a=blob;f=README;hb=HEAD SeaBIOS README] file for information on non-coreboot uses.<br />
<br />
= Use cases =<br />
<br />
Any software requiring 16-bit BIOS services benefits from SeaBIOS (eg, Windows and DOS). SeaBIOS also enables booting Linux out of the box (using standard boot-loaders like GRUB and Syslinux).<br />
<br />
SeaBIOS supports booting from ATA hard drives, ATAPI CDROMs, USB hard drives, USB CDROMs, payloads in flash, and from [http://en.wikipedia.org/wiki/Option_ROM Option ROMs] (eg, SCSI or network cards). SeaBIOS can initialize and use a PS/2 keyboard or USB keyboard.<br />
<br />
== Windows ==<br />
<br />
SeaBIOS has been tested with Windows XP, Windows 2008, Windows Vista (64/32 bit), Windows 7 (32 bit and 64 bit).<br />
<br />
However, Windows has a very strict ACPI interpreter, and some coreboot boards do not have a complete [[ACPI|ACPI definition]]. As a result, some coreboot boards may fail during Windows boot (eg, it may fail with a '''STOP 0xA5''' code).<br />
<br />
Many boards do have working ACPI and are able to boot XP/Vista/Windows 7. Please check the board documentation or ask on the [[Mailinglist|mailing list]] if unsure of the status.<br />
<br />
== Linux ==<br />
<br />
SeaBIOS has been tested with GRUB, LILO, and Syslinux. Linux booting works well.<br />
<br />
== Other ==<br />
<br />
SeaBIOS has also been tested with FreeDOS, NetBSD, and OpenBSD.<br />
<br />
Because SeaBIOS implements the standard x86 BIOS interfaces, it is expected many other operating systems and boot-loaders will work.<br />
<br />
= Building =<br />
<br />
== Building via coreboot's menuconfig ==<br />
<br />
Probably the easiest way to use SeaBIOS as coreboot payload is to simply use the coreboot build process, which downloads and builds SeaBIOS as payload by default nowadays. You just have to run the following in your coreboot checkout:<br />
<br />
<source lang="bash"><br />
$ make menuconfig<br />
$ make<br />
</source><br />
<br />
Both SeaBIOS and coreboot will be built, and SeaBIOS will be added as payload to the '''coreboot.rom''' image that is being built.<br />
<br />
== Manual build ==<br />
<br />
One can download the latest version of SeaBIOS through a git repository:<br />
<br />
<source lang="bash"><br />
$ git clone git://git.seabios.org/seabios.git seabios<br />
$ cd seabios<br />
</source><br />
<br />
There's also a [http://code.coreboot.org/p/seabios/source/changes/master/ gitweb] facility to browse the latest source code online.<br />
<br />
Run '''make menuconfig''' and set the following variables:<br />
<br />
* CONFIG_COREBOOT 1<br />
* CONFIG_DEBUG_SERIAL 1<br />
<br />
Then:<br />
<br />
<source lang="bash"><br />
$ make<br />
</source><br />
<br />
The final SeaBIOS payload file is '''out/bios.bin.elf'''.<br />
<br />
== coreboot ==<br />
<br />
Configure coreboot with the following all disabled: '''CONFIG_VGA_ROM_RUN''', '''CONFIG_PCI_ROM_RUN''', '''CONFIG_ON_DEVICE_ROM_RUN'''<br />
<br />
Then configure the SeaBIOS '''out/bios.bin.elf''' file as the coreboot payload and build coreboot. The resulting '''coreboot.rom''' file will contain both SeaBIOS and coreboot, and it can be flashed to a ROM chip.<br />
<br />
= SeaBIOS and CBFS =<br />
<br />
SeaBIOS can read the coreboot flash filesystem and extract files.<br />
<br />
When SeaBIOS scans the target machine's PCI devices, it will recognize option ROMs in CBFS that have the form '''pciVVVV,DDDD.rom'''. It will also run any file in the directory '''vgaroms/''' as a VGA option ROM not specific to a device and files in '''genroms/''' as a generic option ROM not specific to a device. In the above cases, SeaBIOS will recognize files with a '''.lzma''' suffix, and automatically decompress them (eg, '''pci1106,3344.rom.lzma''' and '''vgaroms/sgabios.bin.lzma''').<br />
<br />
SeaBIOS can also load a graphical bootsplash image from '''bootsplash.jpg''' or '''bootsplash.bmp''', payloads found in the CBFS directory '''img/''', and floppy images found in the '''floppyimg/''' directory.<br />
<br />
Further, SeaBIOS can obtain configuration information from CBFS. A file '''bootorder''' determines the order of devices and methods to attempt to boot the system from. Additional configuration items may be found in the CBFS '''etc/''' directory. It's also possible to create CBFS file aliases with the '''links''' file.<br />
<br />
The examples below show some common uses of these features.<br />
<br />
== Adding a VGA option ROM ==<br />
<br />
It is frequently necessary to add a VGA option ROM to CBFS in order to use a VGA adapter that is built-in to a motherboard. Note, VGA adapters on external cards (PCI, AGP, PCIe) do not require this step as SeaBIOS will automatically extract the VGA BIOS directly from the card. For machines without a VGA adapter, please follow the [[#Adding sgabios support|sgabios instructions]] below.<br />
<br />
=== Using your BIOS's VGA option rom ===<br />
The first step is to find the vendor and device ID of the built-in VGA adapter. This information can be found from '''lspci''':<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
01:00.0 VGA compatible controller [0300]: VIA Technologies, Inc. UniChrome Pro IGP ['''1106:3344'''] (rev 01) (prog-if 00 [VGA controller])<br />
</source><br />
<br />
In the above example, the VGA vendor/device ID is '''1106:3344'''. [[VGA support#How_to_retrieve_a_good_video_bios|Obtain the VGA ROM]] (eg, '''vgabios.bin''') and add it to the ROM with:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/vgabios.bin -n pci1106,3344.rom -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
Alternatively, SeaBIOS supports LZMA compressed option ROMs. Use the following to add a compressed option ROM instead:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/vgabios.bin > vgabios.bin.lzma<br />
$ ./build/cbfstool build/coreboot.rom add -f vgabios.bin.lzma -n pci1106,3344.rom.lzma -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
After the above is done, one can write the '''coreboot.rom''' file to flash. SeaBIOS will extract the VGA ROM and run it during boot.<br />
<br />
=== Adding sgabios support ===<br />
<br />
An [http://code.google.com/p/sgabios/ sgabios] option ROM can forward many VGA BIOS requests and keyboard events over a serial port. One can deploy it in addition to the primary VGA BIOS or by itself.<br />
<br />
If the target machine does not have a VGA adapter, then one should install sgabios. Most bootloaders (eg, GRUB) require a VGA BIOS in order to function properly &mdash; the sgabios ROM can fill this requirement.<br />
<br />
Place the sgabios ROM file in the '''vgaroms/''' directory of CBFS. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/sgabios.bin -n vgaroms/sgabios.bin -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
When using sgabios, all the characters that SeaBIOS writes to the screen will be seen twice &mdash; once from SeaBIOS sending the character to the serial port and once from sgabios forwarding the character. To prevent the duplicates set the [[#Other Configuration items|config file]] '''etc/screen-and-debug''' to zero.<br />
<br />
=== Using coreboot VGA support ===<br />
Coreboot can initialize the GPU of some mainboards. After initializing the GPU, the information about it is passed to the payload.<br />
<br />
SeaBIOS can provide an option rom that implements legacy VGA BIOS compatibility for coreboot initialized GPUs. To use this feature select '''CONFIG_VGA_COREBOOT''' (in "make menuconfig" under "VGA ROM ---> VGA Hardware Type" select "coreboot linear framebuffer").<br />
<br />
The resulting option rom is in '''out/vgabios.rom'''. It can be added to '''coreboot.rom''' the same way one would add [[SeaBIOS#Adding_sgabios_support|sgabios]].<br />
<br />
=== Geode option roms ===<br />
There are two VGA option roms for geode in SeaBIOS, they can be found in "VGA ROM --->" in "make menuconfig":<br />
<br />
* The first one is for the Geode LX, its named "GeodeLX" in "make menuconfig"<br />
* The second one if for the Geode GX2, its named "Geode GX2" in "make menuconfig"<br />
<br />
== Adding a graphical "bootsplash" image ==<br />
<br />
SeaBIOS can show a custom [http://en.wikipedia.org/wiki/JPEG JPEG] image or [http://en.wikipedia.org/wiki/BMP_file_format BMP] image during bootup. To enable this, add the JPEG file to flash with the name '''bootsplash.jpg''' or BMP file as '''bootsplash.bmp'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/image.jpg -n bootsplash.jpg -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
The size of the image determines the video mode to use for showing the image. Make sure the dimensions of the image exactly correspond to an available video mode (eg, 640x480, or 1024x768), otherwise it will not be displayed.<br />
<br />
SeaBIOS will show the image during the wait for the boot menu (if the boot menu has been disabled, users will not see the image). The image should probably have "Press F12 for boot menu" embedded in it so users know they can enter the normal SeaBIOS boot menu. By default, the boot menu prompt (and thus graphical image) is shown for 2.5 seconds. This can be customized via a [[#Other Configuration items|configuration parameter]].<br />
<br />
The JPEG viewer in SeaBIOS uses a simplified decoding algorithm. It supports most common JPEGs, but does not support all possible formats. Please see the [[#Trouble reporting|Trouble reporting]] section if a valid image isn't displayed properly.<br />
<br />
== Adding gpxe support ==<br />
<br />
A [[GPXE|gpxe]] option ROM can nicely complement SeaBIOS and coreboot by adding network boot support. Adding gpxe is similar to [[#Adding a VGA option ROM]]. The first step is to find the Ethernet vendor/device ID. For example:<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
00:09.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet ['''10ec:8167'''] (rev 10)<br />
</source><br />
<br />
Then one can build a gpxe option ROM. For example:<br />
<br />
<source lang="bash"><br />
$ cd /path/to/gpxe/src/<br />
$ make bin/10ec8167.rom<br />
</source><br />
<br />
And add it to the coreboot image. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/gpxe/src/bin/10ec8167.rom -n pci10ec,8167.rom -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
As with VGA option ROMs, the gpxe option ROM may be compressed with LZMA. However, compression won't significantly reduce gpxe's size as it implements its own compression.<br />
<br />
In addition to gpxe, other option ROMs can be added in the same manner.<br />
<br />
== Adding payloads ==<br />
<br />
Most [[Payloads|payloads]] can also be launched from SeaBIOS. To add a payload, build the corresponding .elf file and then add it to the '''coreboot.rom''' file in the '''img/''' directory. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add-payload /path/to/payload.elf img/MyPayload l<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
During boot, one can press the '''F12''' key to get a boot menu. SeaBIOS will show all files in the '''img/''' directory, and one can instruct SeaBIOS to run them.<br />
<br />
SeaBIOS supports both uncompressed and LZMA compressed payloads.<br />
<br />
== Adding a floppy image ==<br />
<br />
It is possible to embed an image of a floppy in flash. SeaBIOS can then boot from and redirect floppy BIOS calls to the flash image. This is mainly useful for legacy software (such as DOS utilities). To use this feature, place a floppy image into the CBFS directory '''floppyimg/'''. For example:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/myfloppy.img > myfloppy.img.lzma<br />
$ ./build/cbfstool build/coreboot.rom add -f myfloppy.img.lzma -n floppyimg/MyFloppy.lzma -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
Both uncompressed and LZMA compressed images are supported. Several floppy formats are available: 360K, 1.2MB, 720K, 1.44MB, 2.88MB, 160K, 180K, 320K.<br />
<br />
The floppy image will appear as writable to the system, however all writes are discarded on reboot.<br />
<br />
When using this system, SeaBIOS reserves high-memory to store the floppy. The reserved memory is then no longer available for OS use, so this feature should only be used when needed.<br />
<br />
== Configuring boot order ==<br />
<br />
Place a file in CBFS with the name '''bootorder''' to configure the boot up order. The file should be ASCII text and contain one line per boot method. The description of each boot method follows an [https://secure.wikimedia.org/wikipedia/en/wiki/Open_firmware Open Firmware] device path format. SeaBIOS will attempt to boot from each item in the file &mdash; first line of the file first.<br />
<br />
The easiest way to find the available boot methods is to look for "Searching bootorder for" in the SeaBIOS serial output. For example, one may see lines similar to:<br />
<br />
Searching bootorder for: /pci@i0cf8/*@f/drive@1/disk@0<br />
Searching bootorder for: /pci@i0cf8/*@f,1/drive@2/disk@1<br />
Searching bootorder for: /pci@i0cf8/usb@10,4/*@2<br />
<br />
The above represents the patterns SeaBIOS will search for in the bootorder file. However, it's safe to just copy and paste the pattern into bootorder. For example, the file:<br />
<br />
/pci@i0cf8/usb@10,4/*@2<br />
/pci@i0cf8/*@f/drive@1/disk@0<br />
<br />
will instruct SeaBIOS to attempt to boot from the given USB drive first and then attempt the given ATA harddrive second.<br />
<br />
Once a file has been created, add it to CBFS with the name '''bootorder'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f mybootlist.txt -n bootorder -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
== Other Configuration items ==<br />
<br />
Additional configuration options are available in the CBFS '''etc/''' directory. For example, to set the duration of the boot menu to five and a half seconds, one would do the following:<br />
<br />
<source lang="bash"><br />
$ /path/to/seabios/scripts/encodeint.py boot-menu-wait 5500<br />
$ ./build/cbfstool build/coreboot.rom add -f boot-menu-wait -n etc/boot-menu-wait -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
The SeaBIOS tool '''scripts/encodeint.py''' will create a litte-endian encoded binary integer which can be placed into a CBFS file.<br />
<br />
{| border=1<br />
|+ Configuration variables<br />
|-<br />
! Filename !! Description<br />
|-<br />
| show-boot-menu || Controls the display of the boot menu. Set to 0 to disable the boot menu.<br />
|-<br />
| boot-menu-message || Customize the text boot menu message. Normally, when in text mode SeaBIOS will report the string "\nPress F12 for boot menu.\n\n". This field allows the string to be changed. (This is a string field, not an integer field; don't use encodeint.py, just place the desired string into a file and add as above.)<br />
|-<br />
| boot-menu-key || Controls which key activates the boot menu. The value stored is the DOS scan code (eg, 0x86 for F12, 0x01 for Esc). If this field is set, be sure to also customize the '''boot-menu-message''' field above.<br />
|-<br />
| boot-menu-wait || Amount of time (in milliseconds) to wait at the boot menu prompt before selecting the default boot.<br />
|-<br />
| boot-fail-wait || If no boot devices are found SeaBIOS will reboot after 60 seconds. Set this to the amount of time (in milliseconds) to customize the reboot delay or set to -1 to disable rebooting when no boot devices are found<br />
|-<br />
| extra-pci-roots || If the target machine has multiple independent root buses set this to a positive value. The SeaBIOS PCI probe will then search for the given number of extra root buses.<br />
|-<br />
| ps2-keyboard-spinup || Some laptops that emulate PS2 keyboards don't respond to keyboard commands immediately after powering on. One may specify the amount of time (in milliseconds) here to allow as additional time for the keyboard to become responsive. When this field is set, SeaBIOS will repeatedly attempt to detect the keyboard until the keyboard is found or the specified timeout is reached.<br />
|-<br />
| optionroms-checksum || Option ROMs are required to have correct checksums. However, some option ROMs in the wild don't correctly follow the specifications and have bad checksums. Set this to a zero value to allow SeaBIOS to execute them anyways.<br />
|-<br />
| s3-resume-vga-init || Set this to a non-zero value to instruct SeaBIOS to run the vga rom on an S3 resume.<br />
|-<br />
| screen-and-debug || Set this to a zero value to instruct SeaBIOS to not write characters it sends to the screen to the debug ports. This can be useful when using [[#Adding sgabios support|sgabios]].<br />
|-<br />
| advertise-serial-debug-port || If using a serial debug port, one can set this file to a zero value to prevent SeaBIOS from listing that serial port as available for operating system use. This can be useful when running old DOS programs that are known to reset the baud rate of all advertised serial ports.<br />
|-<br />
| floppy0 || Set this to the type of the first floppy drive in the system (only type 4 for 3.5 inch drives is supported).<br />
|-<br />
| floppy1 || The type of the second floppy drive in the system. See the description of '''floppy0''' for more info.<br />
|-<br />
| threads || By default, SeaBIOS will parallelize hardware initialization during bootup to reduce boot time. Multiple hardware devices can be initialized in parallel between vga initialization and option rom initialization. One can set this file to a value of zero to force hardware initialization to run serially. Alternatively, one can set this file to 2 to enable early hardware initialization that runs in parallel with vga, option rom initialization, and the boot menu.<br />
|}<br />
<br />
== File aliases ==<br />
<br />
It is possible to create the equivalent of "symbolic links" in CBFS so that one file's content appears under another name. To do this, create a links file with one line per link and each line having the format of "linkname" and "destname" separated by a space character. For example, the "links" file may look like:<br />
<br />
pci1234,1000.rom somerom.rom<br />
pci1234,1001.rom somerom.rom<br />
pci1234,1002.rom somerom.rom<br />
<br />
Then add the "links" file to CBFS:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f links -n links -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
The above example would cause SeaBIOS to treat "pci1234,1000.rom" or "pci1234,1001.rom" as files with the same content as the file "somerom.rom".<br />
<br />
= Trouble reporting =<br />
<br />
If you are experiencing problems with SeaBIOS, it's useful to increase the debugging level. This is done by running '''make menuconfig''' and setting '''CONFIG_DEBUG_LEVEL''' to a higher value. A debug level of 8 will show a lot of diagnostic information without flooding the serial port (levels above 8 will frequently cause too much data).<br />
<br />
To report an issue, please collect the serial boot log with SeaBIOS set to a debug level of 8 and forward the full log along with a description of the problem to the coreboot [[Mailinglist|mailing list]].</div>KevinOConnorhttps://www.coreboot.org/index.php?title=SeaBIOS&diff=14072SeaBIOS2014-08-23T14:23:13Z<p>KevinOConnor: /* Adding a VGA option ROM */ Reword slightly</p>
<hr />
<div>[http://www.seabios.org '''SeaBIOS'''] is an open-source legacy BIOS implementation which can be used as a coreboot [[Payloads|payload]]. It implements the standard [https://secure.wikimedia.org/wikipedia/en/wiki/BIOS BIOS] calling interfaces that a typical x86 proprietary BIOS implements.<br />
<br />
This page describes using SeaBIOS with coreboot. SeaBIOS can also run natively in [[QEMU]] and [http://bochs.sourceforge.net/ bochs] &mdash; see the [http://git.linuxtogo.org/?p=kevin/seabios.git;a=blob;f=README;hb=HEAD SeaBIOS README] file for information on non-coreboot uses.<br />
<br />
= Use cases =<br />
<br />
Any software requiring 16-bit BIOS services benefits from SeaBIOS (eg, Windows and DOS). SeaBIOS also enables booting Linux out of the box (using standard boot-loaders like GRUB and Syslinux).<br />
<br />
SeaBIOS supports booting from ATA hard drives, ATAPI CDROMs, USB hard drives, USB CDROMs, payloads in flash, and from [http://en.wikipedia.org/wiki/Option_ROM Option ROMs] (eg, SCSI or network cards). SeaBIOS can initialize and use a PS/2 keyboard or USB keyboard.<br />
<br />
== Windows ==<br />
<br />
SeaBIOS has been tested with Windows XP, Windows 2008, Windows Vista (64/32 bit), Windows 7 (32 bit and 64 bit).<br />
<br />
However, Windows has a very strict ACPI interpreter, and some coreboot boards do not have a complete [[ACPI|ACPI definition]]. As a result, some coreboot boards may fail during Windows boot (eg, it may fail with a '''STOP 0xA5''' code).<br />
<br />
Many boards do have working ACPI and are able to boot XP/Vista/Windows 7. Please check the board documentation or ask on the [[Mailinglist|mailing list]] if unsure of the status.<br />
<br />
== Linux ==<br />
<br />
SeaBIOS has been tested with GRUB, LILO, and Syslinux. Linux booting works well.<br />
<br />
== Other ==<br />
<br />
SeaBIOS has also been tested with FreeDOS, NetBSD, and OpenBSD.<br />
<br />
Because SeaBIOS implements the standard x86 BIOS interfaces, it is expected many other operating systems and boot-loaders will work.<br />
<br />
= Building =<br />
<br />
== Building via coreboot's menuconfig ==<br />
<br />
Probably the easiest way to use SeaBIOS as coreboot payload is to simply use the coreboot build process, which downloads and builds SeaBIOS as payload by default nowadays. You just have to run the following in your coreboot checkout:<br />
<br />
<source lang="bash"><br />
$ make menuconfig<br />
$ make<br />
</source><br />
<br />
Both SeaBIOS and coreboot will be built, and SeaBIOS will be added as payload to the '''coreboot.rom''' image that is being built.<br />
<br />
== Manual build ==<br />
<br />
One can download the latest version of SeaBIOS through a git repository:<br />
<br />
<source lang="bash"><br />
$ git clone git://git.seabios.org/seabios.git seabios<br />
$ cd seabios<br />
</source><br />
<br />
There's also a [http://code.coreboot.org/p/seabios/source/changes/master/ gitweb] facility to browse the latest source code online.<br />
<br />
Run '''make menuconfig''' and set the following variables:<br />
<br />
* CONFIG_COREBOOT 1<br />
* CONFIG_DEBUG_SERIAL 1<br />
<br />
Then:<br />
<br />
<source lang="bash"><br />
$ make<br />
</source><br />
<br />
The final SeaBIOS payload file is '''out/bios.bin.elf'''.<br />
<br />
== coreboot ==<br />
<br />
Configure coreboot with the following all disabled: '''CONFIG_VGA_ROM_RUN''', '''CONFIG_PCI_ROM_RUN''', '''CONFIG_ON_DEVICE_ROM_RUN'''<br />
<br />
Then configure the SeaBIOS '''out/bios.bin.elf''' file as the coreboot payload and build coreboot. The resulting '''coreboot.rom''' file will contain both SeaBIOS and coreboot, and it can be flashed to a ROM chip.<br />
<br />
= SeaBIOS and CBFS =<br />
<br />
SeaBIOS can read the coreboot flash filesystem and extract files.<br />
<br />
When SeaBIOS scans the target machine's PCI devices, it will recognize option ROMs in CBFS that have the form '''pciVVVV,DDDD.rom'''. It will also run any file in the directory '''vgaroms/''' as a VGA option ROM not specific to a device and files in '''genroms/''' as a generic option ROM not specific to a device. In the above cases, SeaBIOS will recognize files with a '''.lzma''' suffix, and automatically decompress them (eg, '''pci1106,3344.rom.lzma''' and '''vgaroms/sgabios.bin.lzma''').<br />
<br />
SeaBIOS can also load a graphical bootsplash image from '''bootsplash.jpg''' or '''bootsplash.bmp''', payloads found in the CBFS directory '''img/''', and floppy images found in the '''floppyimg/''' directory.<br />
<br />
Further, SeaBIOS can obtain configuration information from CBFS. A file '''bootorder''' determines the order of devices and methods to attempt to boot the system from. Additional configuration items may be found in the CBFS '''etc/''' directory. It's also possible to create CBFS file aliases with the '''links''' file.<br />
<br />
The examples below show some common uses of these features.<br />
<br />
== Adding a VGA option ROM ==<br />
<br />
It is frequently necessary to add a VGA option ROM to CBFS in order to use a VGA adapter that is built-in to a motherboard. Note, VGA adapters on external cards (PCI, AGP, PCIe) do not require this step as SeaBIOS will automatically extract the VGA BIOS directly from the card. For machines without a VGA adapter, please follow the [[#Adding sgabios support|sgabios instructions]] below.<br />
<br />
=== Using your BIOS's VGA option rom ===<br />
The first step is to find the vendor and device ID of the built-in VGA adapter. This information can be found from '''lspci''':<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
01:00.0 VGA compatible controller [0300]: VIA Technologies, Inc. UniChrome Pro IGP ['''1106:3344'''] (rev 01) (prog-if 00 [VGA controller])<br />
</source><br />
<br />
In the above example, the VGA vendor/device ID is '''1106:3344'''. [[VGA support#How_to_retrieve_a_good_video_bios|Obtain the VGA ROM]] (eg, '''vgabios.bin''') and add it to the ROM with:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/vgabios.bin -n pci1106,3344.rom -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
Alternatively, SeaBIOS supports LZMA compressed option ROMs. Use the following to add a compressed option ROM instead:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/vgabios.bin > vgabios.bin.lzma<br />
$ ./build/cbfstool build/coreboot.rom add -f vgabios.bin.lzma -n pci1106,3344.rom.lzma -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
After the above is done, one can write the '''coreboot.rom''' file to flash. SeaBIOS will extract the VGA ROM and run it during boot.<br />
<br />
=== Using coreboot VGA support ===<br />
Coreboot can initialize the GPU of some mainboards. After initializing the GPU, the information about it is passed to the payload.<br />
<br />
SeaBIOS can provide an option rom that implements legacy VGA BIOS compatibility for coreboot initialized GPUs. To use this feature select '''CONFIG_VGA_COREBOOT''' (in "make menuconfig" under "VGA ROM ---> VGA Hardware Type" select "coreboot linear framebuffer").<br />
<br />
The resulting option rom is in '''out/vgabios.rom'''. It can be added to '''coreboot.rom''' the same way one would add [[SeaBIOS#Adding_sgabios_support|sgabios]].<br />
<br />
=== Geode option roms ===<br />
There are two VGA option roms for geode in SeaBIOS, they can be found in "VGA ROM --->" in "make menuconfig":<br />
<br />
* The first one is for the Geode LX, its named "GeodeLX" in "make menuconfig"<br />
* The second one if for the Geode GX2, its named "Geode GX2" in "make menuconfig"<br />
<br />
== Adding sgabios support ==<br />
<br />
An [http://code.google.com/p/sgabios/ sgabios] option ROM can forward many VGA BIOS requests and keyboard events over a serial port. One can deploy it in addition to the primary VGA BIOS or by itself.<br />
<br />
If the target machine does not have a VGA adapter, then one should install sgabios. Most bootloaders (eg, GRUB) require a VGA BIOS in order to function properly &mdash; the sgabios ROM can fill this requirement.<br />
<br />
Place the sgabios ROM file in the '''vgaroms/''' directory of CBFS. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/sgabios.bin -n vgaroms/sgabios.bin -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
When using sgabios, all the characters that SeaBIOS writes to the screen will be seen twice &mdash; once from SeaBIOS sending the character to the serial port and once from sgabios forwarding the character. To prevent the duplicates set the [[#Other Configuration items|config file]] '''etc/screen-and-debug''' to zero.<br />
<br />
== Adding a graphical "bootsplash" image ==<br />
<br />
SeaBIOS can show a custom [http://en.wikipedia.org/wiki/JPEG JPEG] image or [http://en.wikipedia.org/wiki/BMP_file_format BMP] image during bootup. To enable this, add the JPEG file to flash with the name '''bootsplash.jpg''' or BMP file as '''bootsplash.bmp'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/image.jpg -n bootsplash.jpg -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
The size of the image determines the video mode to use for showing the image. Make sure the dimensions of the image exactly correspond to an available video mode (eg, 640x480, or 1024x768), otherwise it will not be displayed.<br />
<br />
SeaBIOS will show the image during the wait for the boot menu (if the boot menu has been disabled, users will not see the image). The image should probably have "Press F12 for boot menu" embedded in it so users know they can enter the normal SeaBIOS boot menu. By default, the boot menu prompt (and thus graphical image) is shown for 2.5 seconds. This can be customized via a [[#Other Configuration items|configuration parameter]].<br />
<br />
The JPEG viewer in SeaBIOS uses a simplified decoding algorithm. It supports most common JPEGs, but does not support all possible formats. Please see the [[#Trouble reporting|Trouble reporting]] section if a valid image isn't displayed properly.<br />
<br />
== Adding gpxe support ==<br />
<br />
A [[GPXE|gpxe]] option ROM can nicely complement SeaBIOS and coreboot by adding network boot support. Adding gpxe is similar to [[#Adding a VGA option ROM]]. The first step is to find the Ethernet vendor/device ID. For example:<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
00:09.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet ['''10ec:8167'''] (rev 10)<br />
</source><br />
<br />
Then one can build a gpxe option ROM. For example:<br />
<br />
<source lang="bash"><br />
$ cd /path/to/gpxe/src/<br />
$ make bin/10ec8167.rom<br />
</source><br />
<br />
And add it to the coreboot image. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/gpxe/src/bin/10ec8167.rom -n pci10ec,8167.rom -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
As with VGA option ROMs, the gpxe option ROM may be compressed with LZMA. However, compression won't significantly reduce gpxe's size as it implements its own compression.<br />
<br />
In addition to gpxe, other option ROMs can be added in the same manner.<br />
<br />
== Adding payloads ==<br />
<br />
Most [[Payloads|payloads]] can also be launched from SeaBIOS. To add a payload, build the corresponding .elf file and then add it to the '''coreboot.rom''' file in the '''img/''' directory. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add-payload /path/to/payload.elf img/MyPayload l<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
During boot, one can press the '''F12''' key to get a boot menu. SeaBIOS will show all files in the '''img/''' directory, and one can instruct SeaBIOS to run them.<br />
<br />
SeaBIOS supports both uncompressed and LZMA compressed payloads.<br />
<br />
== Adding a floppy image ==<br />
<br />
It is possible to embed an image of a floppy in flash. SeaBIOS can then boot from and redirect floppy BIOS calls to the flash image. This is mainly useful for legacy software (such as DOS utilities). To use this feature, place a floppy image into the CBFS directory '''floppyimg/'''. For example:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/myfloppy.img > myfloppy.img.lzma<br />
$ ./build/cbfstool build/coreboot.rom add -f myfloppy.img.lzma -n floppyimg/MyFloppy.lzma -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
Both uncompressed and LZMA compressed images are supported. Several floppy formats are available: 360K, 1.2MB, 720K, 1.44MB, 2.88MB, 160K, 180K, 320K.<br />
<br />
The floppy image will appear as writable to the system, however all writes are discarded on reboot.<br />
<br />
When using this system, SeaBIOS reserves high-memory to store the floppy. The reserved memory is then no longer available for OS use, so this feature should only be used when needed.<br />
<br />
== Configuring boot order ==<br />
<br />
Place a file in CBFS with the name '''bootorder''' to configure the boot up order. The file should be ASCII text and contain one line per boot method. The description of each boot method follows an [https://secure.wikimedia.org/wikipedia/en/wiki/Open_firmware Open Firmware] device path format. SeaBIOS will attempt to boot from each item in the file &mdash; first line of the file first.<br />
<br />
The easiest way to find the available boot methods is to look for "Searching bootorder for" in the SeaBIOS serial output. For example, one may see lines similar to:<br />
<br />
Searching bootorder for: /pci@i0cf8/*@f/drive@1/disk@0<br />
Searching bootorder for: /pci@i0cf8/*@f,1/drive@2/disk@1<br />
Searching bootorder for: /pci@i0cf8/usb@10,4/*@2<br />
<br />
The above represents the patterns SeaBIOS will search for in the bootorder file. However, it's safe to just copy and paste the pattern into bootorder. For example, the file:<br />
<br />
/pci@i0cf8/usb@10,4/*@2<br />
/pci@i0cf8/*@f/drive@1/disk@0<br />
<br />
will instruct SeaBIOS to attempt to boot from the given USB drive first and then attempt the given ATA harddrive second.<br />
<br />
Once a file has been created, add it to CBFS with the name '''bootorder'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f mybootlist.txt -n bootorder -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
== Other Configuration items ==<br />
<br />
Additional configuration options are available in the CBFS '''etc/''' directory. For example, to set the duration of the boot menu to five and a half seconds, one would do the following:<br />
<br />
<source lang="bash"><br />
$ /path/to/seabios/scripts/encodeint.py boot-menu-wait 5500<br />
$ ./build/cbfstool build/coreboot.rom add -f boot-menu-wait -n etc/boot-menu-wait -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
The SeaBIOS tool '''scripts/encodeint.py''' will create a litte-endian encoded binary integer which can be placed into a CBFS file.<br />
<br />
{| border=1<br />
|+ Configuration variables<br />
|-<br />
! Filename !! Description<br />
|-<br />
| show-boot-menu || Controls the display of the boot menu. Set to 0 to disable the boot menu.<br />
|-<br />
| boot-menu-message || Customize the text boot menu message. Normally, when in text mode SeaBIOS will report the string "\nPress F12 for boot menu.\n\n". This field allows the string to be changed. (This is a string field, not an integer field; don't use encodeint.py, just place the desired string into a file and add as above.)<br />
|-<br />
| boot-menu-key || Controls which key activates the boot menu. The value stored is the DOS scan code (eg, 0x86 for F12, 0x01 for Esc). If this field is set, be sure to also customize the '''boot-menu-message''' field above.<br />
|-<br />
| boot-menu-wait || Amount of time (in milliseconds) to wait at the boot menu prompt before selecting the default boot.<br />
|-<br />
| boot-fail-wait || If no boot devices are found SeaBIOS will reboot after 60 seconds. Set this to the amount of time (in milliseconds) to customize the reboot delay or set to -1 to disable rebooting when no boot devices are found<br />
|-<br />
| extra-pci-roots || If the target machine has multiple independent root buses set this to a positive value. The SeaBIOS PCI probe will then search for the given number of extra root buses.<br />
|-<br />
| ps2-keyboard-spinup || Some laptops that emulate PS2 keyboards don't respond to keyboard commands immediately after powering on. One may specify the amount of time (in milliseconds) here to allow as additional time for the keyboard to become responsive. When this field is set, SeaBIOS will repeatedly attempt to detect the keyboard until the keyboard is found or the specified timeout is reached.<br />
|-<br />
| optionroms-checksum || Option ROMs are required to have correct checksums. However, some option ROMs in the wild don't correctly follow the specifications and have bad checksums. Set this to a zero value to allow SeaBIOS to execute them anyways.<br />
|-<br />
| s3-resume-vga-init || Set this to a non-zero value to instruct SeaBIOS to run the vga rom on an S3 resume.<br />
|-<br />
| screen-and-debug || Set this to a zero value to instruct SeaBIOS to not write characters it sends to the screen to the debug ports. This can be useful when using [[#Adding sgabios support|sgabios]].<br />
|-<br />
| advertise-serial-debug-port || If using a serial debug port, one can set this file to a zero value to prevent SeaBIOS from listing that serial port as available for operating system use. This can be useful when running old DOS programs that are known to reset the baud rate of all advertised serial ports.<br />
|-<br />
| floppy0 || Set this to the type of the first floppy drive in the system (only type 4 for 3.5 inch drives is supported).<br />
|-<br />
| floppy1 || The type of the second floppy drive in the system. See the description of '''floppy0''' for more info.<br />
|-<br />
| threads || By default, SeaBIOS will parallelize hardware initialization during bootup to reduce boot time. Multiple hardware devices can be initialized in parallel between vga initialization and option rom initialization. One can set this file to a value of zero to force hardware initialization to run serially. Alternatively, one can set this file to 2 to enable early hardware initialization that runs in parallel with vga, option rom initialization, and the boot menu.<br />
|}<br />
<br />
== File aliases ==<br />
<br />
It is possible to create the equivalent of "symbolic links" in CBFS so that one file's content appears under another name. To do this, create a links file with one line per link and each line having the format of "linkname" and "destname" separated by a space character. For example, the "links" file may look like:<br />
<br />
pci1234,1000.rom somerom.rom<br />
pci1234,1001.rom somerom.rom<br />
pci1234,1002.rom somerom.rom<br />
<br />
Then add the "links" file to CBFS:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f links -n links -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
The above example would cause SeaBIOS to treat "pci1234,1000.rom" or "pci1234,1001.rom" as files with the same content as the file "somerom.rom".<br />
<br />
= Trouble reporting =<br />
<br />
If you are experiencing problems with SeaBIOS, it's useful to increase the debugging level. This is done by running '''make menuconfig''' and setting '''CONFIG_DEBUG_LEVEL''' to a higher value. A debug level of 8 will show a lot of diagnostic information without flooding the serial port (levels above 8 will frequently cause too much data).<br />
<br />
To report an issue, please collect the serial boot log with SeaBIOS set to a debug level of 8 and forward the full log along with a description of the problem to the coreboot [[Mailinglist|mailing list]].</div>KevinOConnorhttps://www.coreboot.org/index.php?title=SeaBIOS&diff=13754SeaBIOS2014-06-06T19:04:53Z<p>KevinOConnor: /* SeaBIOS and CBFS */ Document links file.</p>
<hr />
<div>[http://www.seabios.org '''SeaBIOS'''] is an open-source legacy BIOS implementation which can be used as a coreboot [[Payloads|payload]]. It implements the standard [https://secure.wikimedia.org/wikipedia/en/wiki/BIOS BIOS] calling interfaces that a typical x86 proprietary BIOS implements.<br />
<br />
This page describes using SeaBIOS with coreboot. SeaBIOS can also run natively in [[QEMU]] and [http://bochs.sourceforge.net/ bochs] &mdash; see the [http://git.linuxtogo.org/?p=kevin/seabios.git;a=blob;f=README;hb=HEAD SeaBIOS README] file for information on non-coreboot uses.<br />
<br />
= Use cases =<br />
<br />
Any software requiring 16-bit BIOS services benefits from SeaBIOS (eg, Windows and DOS). SeaBIOS also enables booting Linux out of the box (using standard boot-loaders like GRUB and Syslinux).<br />
<br />
SeaBIOS supports booting from ATA hard drives, ATAPI CDROMs, USB hard drives, USB CDROMs, payloads in flash, and from [http://en.wikipedia.org/wiki/Option_ROM Option ROMs] (eg, SCSI or network cards). SeaBIOS can initialize and use a PS/2 keyboard or USB keyboard.<br />
<br />
== Windows ==<br />
<br />
SeaBIOS has been tested with Windows XP, Windows 2008, Windows Vista (64/32 bit), Windows 7 (32 bit and 64 bit).<br />
<br />
However, Windows has a very strict ACPI interpreter, and some coreboot boards do not have a complete [[ACPI|ACPI definition]]. As a result, some coreboot boards may fail during Windows boot (eg, it may fail with a '''STOP 0xA5''' code).<br />
<br />
Many boards do have working ACPI and are able to boot XP/Vista/Windows 7. Please check the board documentation or ask on the [[Mailinglist|mailing list]] if unsure of the status.<br />
<br />
== Linux ==<br />
<br />
SeaBIOS has been tested with GRUB, LILO, and Syslinux. Linux booting works well.<br />
<br />
== Other ==<br />
<br />
SeaBIOS has also been tested with FreeDOS, NetBSD, and OpenBSD.<br />
<br />
Because SeaBIOS implements the standard x86 BIOS interfaces, it is expected many other operating systems and boot-loaders will work.<br />
<br />
= Building =<br />
<br />
== Building via coreboot's menuconfig ==<br />
<br />
Probably the easiest way to use SeaBIOS as coreboot payload is to simply use the coreboot build process, which downloads and builds SeaBIOS as payload by default nowadays. You just have to run the following in your coreboot checkout:<br />
<br />
<source lang="bash"><br />
$ make menuconfig<br />
$ make<br />
</source><br />
<br />
Both SeaBIOS and coreboot will be built, and SeaBIOS will be added as payload to the '''coreboot.rom''' image that is being built.<br />
<br />
== Manual build ==<br />
<br />
One can download the latest version of SeaBIOS through a git repository:<br />
<br />
<source lang="bash"><br />
$ git clone git://git.seabios.org/seabios.git seabios<br />
$ cd seabios<br />
</source><br />
<br />
There's also a [http://code.coreboot.org/p/seabios/source/changes/master/ gitweb] facility to browse the latest source code online.<br />
<br />
Run '''make menuconfig''' and set the following variables:<br />
<br />
* CONFIG_COREBOOT 1<br />
* CONFIG_DEBUG_SERIAL 1<br />
<br />
Then:<br />
<br />
<source lang="bash"><br />
$ make<br />
</source><br />
<br />
The final SeaBIOS payload file is '''out/bios.bin.elf'''.<br />
<br />
== coreboot ==<br />
<br />
Configure coreboot with the following all disabled: '''CONFIG_VGA_ROM_RUN''', '''CONFIG_PCI_ROM_RUN''', '''CONFIG_ON_DEVICE_ROM_RUN'''<br />
<br />
Then configure the SeaBIOS '''out/bios.bin.elf''' file as the coreboot payload and build coreboot. The resulting '''coreboot.rom''' file will contain both SeaBIOS and coreboot, and it can be flashed to a ROM chip.<br />
<br />
= SeaBIOS and CBFS =<br />
<br />
SeaBIOS can read the coreboot flash filesystem and extract files.<br />
<br />
When SeaBIOS scans the target machine's PCI devices, it will recognize option ROMs in CBFS that have the form '''pciVVVV,DDDD.rom'''. It will also run any file in the directory '''vgaroms/''' as a VGA option ROM not specific to a device and files in '''genroms/''' as a generic option ROM not specific to a device. In the above cases, SeaBIOS will recognize files with a '''.lzma''' suffix, and automatically decompress them (eg, '''pci1106,3344.rom.lzma''' and '''vgaroms/sgabios.bin.lzma''').<br />
<br />
SeaBIOS can also load a graphical bootsplash image from '''bootsplash.jpg''' or '''bootsplash.bmp''', payloads found in the CBFS directory '''img/''', and floppy images found in the '''floppyimg/''' directory.<br />
<br />
Further, SeaBIOS can obtain configuration information from CBFS. A file '''bootorder''' determines the order of devices and methods to attempt to boot the system from. Additional configuration items may be found in the CBFS '''etc/''' directory. It's also possible to create CBFS file aliases with the '''links''' file.<br />
<br />
The examples below show some common uses of these features.<br />
<br />
== Adding a VGA option ROM ==<br />
<br />
It is frequently necessary to add a VGA option ROM to CBFS in order to use a VGA adapter that is built-in to a motherboard. Note, VGA adapters on external cards (PCI, AGP, PCIe) do not require this step as SeaBIOS will automatically extract the VGA BIOS directly from the card. For machines without a VGA adapter, please follow the [[#Adding sgabios support|sgabios instructions]] below.<br />
<br />
The first step is to find the vendor and device ID of the built-in VGA adapter. This information can be found from '''lspci''':<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
01:00.0 VGA compatible controller [0300]: VIA Technologies, Inc. UniChrome Pro IGP ['''1106:3344'''] (rev 01) (prog-if 00 [VGA controller])<br />
</source><br />
<br />
In the above example, the VGA vendor/device ID is '''1106:3344'''. [[VGA support#How_to_retrieve_a_good_video_bios|Obtain the VGA ROM]] (eg, '''vgabios.bin''') and add it to the ROM with:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/vgabios.bin -n pci1106,3344.rom -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
Alternatively, SeaBIOS supports LZMA compressed option ROMs. Use the following to add a compressed option ROM instead:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/vgabios.bin > vgabios.bin.lzma<br />
$ ./build/cbfstool build/coreboot.rom add -f vgabios.bin.lzma -n pci1106,3344.rom.lzma -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
After the above is done, one can write the '''coreboot.rom''' file to flash. SeaBIOS will extract the VGA ROM and run it during boot.<br />
<br />
== Adding gpxe support ==<br />
<br />
A [[GPXE|gpxe]] option ROM can nicely complement SeaBIOS and coreboot by adding network boot support. Adding gpxe is similar to [[#Adding a VGA option ROM]]. The first step is to find the Ethernet vendor/device ID. For example:<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
00:09.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet ['''10ec:8167'''] (rev 10)<br />
</source><br />
<br />
Then one can build a gpxe option ROM. For example:<br />
<br />
<source lang="bash"><br />
$ cd /path/to/gpxe/src/<br />
$ make bin/10ec8167.rom<br />
</source><br />
<br />
And add it to the coreboot image. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/gpxe/src/bin/10ec8167.rom -n pci10ec,8167.rom -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
As with VGA option ROMs, the gpxe option ROM may be compressed with LZMA. However, compression won't significantly reduce gpxe's size as it implements its own compression.<br />
<br />
In addition to gpxe, other option ROMs can be added in the same manner.<br />
<br />
== Adding sgabios support ==<br />
<br />
An [http://code.google.com/p/sgabios/ sgabios] option ROM can forward many VGA BIOS requests and keyboard events over a serial port. One can deploy it in addition to the primary VGA BIOS or by itself.<br />
<br />
If the target machine does not have a VGA adapter, then one should install sgabios. Most bootloaders (eg, GRUB) require a VGA BIOS in order to function properly &mdash; the sgabios ROM can fill this requirement.<br />
<br />
Place the sgabios ROM file in the '''vgaroms/''' directory of CBFS. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/sgabios.bin -n vgaroms/sgabios.bin -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
When using sgabios, all the characters that SeaBIOS writes to the screen will be seen twice &mdash; once from SeaBIOS sending the character to the serial port and once from sgabios forwarding the character. To prevent the duplicates set the [[#Other Configuration items|config file]] '''etc/screen-and-debug''' to zero.<br />
<br />
== Adding a graphical "bootsplash" image ==<br />
<br />
SeaBIOS can show a custom [http://en.wikipedia.org/wiki/JPEG JPEG] image or [http://en.wikipedia.org/wiki/BMP_file_format BMP] image during bootup. To enable this, add the JPEG file to flash with the name '''bootsplash.jpg''' or BMP file as '''bootsplash.bmp'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/image.jpg -n bootsplash.jpg -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
The size of the image determines the video mode to use for showing the image. Make sure the dimensions of the image exactly correspond to an available video mode (eg, 640x480, or 1024x768), otherwise it will not be displayed.<br />
<br />
SeaBIOS will show the image during the wait for the boot menu (if the boot menu has been disabled, users will not see the image). The image should probably have "Press F12 for boot menu" embedded in it so users know they can enter the normal SeaBIOS boot menu. By default, the boot menu prompt (and thus graphical image) is shown for 2.5 seconds. This can be customized via a [[#Other Configuration items|configuration parameter]].<br />
<br />
The JPEG viewer in SeaBIOS uses a simplified decoding algorithm. It supports most common JPEGs, but does not support all possible formats. Please see the [[#Trouble reporting|Trouble reporting]] section if a valid image isn't displayed properly.<br />
<br />
== Adding payloads ==<br />
<br />
Most [[Payloads|payloads]] can also be launched from SeaBIOS. To add a payload, build the corresponding .elf file and then add it to the '''coreboot.rom''' file in the '''img/''' directory. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add-payload /path/to/payload.elf img/MyPayload l<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
During boot, one can press the '''F12''' key to get a boot menu. SeaBIOS will show all files in the '''img/''' directory, and one can instruct SeaBIOS to run them.<br />
<br />
SeaBIOS supports both uncompressed and LZMA compressed payloads.<br />
<br />
== Adding a floppy image ==<br />
<br />
It is possible to embed an image of a floppy in flash. SeaBIOS can then boot from and redirect floppy BIOS calls to the flash image. This is mainly useful for legacy software (such as DOS utilities). To use this feature, place a floppy image into the CBFS directory '''floppyimg/'''. For example:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/myfloppy.img > myfloppy.img.lzma<br />
$ ./build/cbfstool build/coreboot.rom add -f myfloppy.img.lzma -n floppyimg/MyFloppy.lzma -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
Both uncompressed and LZMA compressed images are supported. Several floppy formats are available: 360K, 1.2MB, 720K, 1.44MB, 2.88MB, 160K, 180K, 320K.<br />
<br />
The floppy image will appear as writable to the system, however all writes are discarded on reboot.<br />
<br />
When using this system, SeaBIOS reserves high-memory to store the floppy. The reserved memory is then no longer available for OS use, so this feature should only be used when needed.<br />
<br />
== Configuring boot order ==<br />
<br />
Place a file in CBFS with the name '''bootorder''' to configure the boot up order. The file should be ASCII text and contain one line per boot method. The description of each boot method follows an [https://secure.wikimedia.org/wikipedia/en/wiki/Open_firmware Open Firmware] device path format. SeaBIOS will attempt to boot from each item in the file &mdash; first line of the file first.<br />
<br />
The easiest way to find the available boot methods is to look for "Searching bootorder for" in the SeaBIOS serial output. For example, one may see lines similar to:<br />
<br />
Searching bootorder for: /pci@i0cf8/*@f/drive@1/disk@0<br />
Searching bootorder for: /pci@i0cf8/*@f,1/drive@2/disk@1<br />
Searching bootorder for: /pci@i0cf8/usb@10,4/*@2<br />
<br />
The above represents the patterns SeaBIOS will search for in the bootorder file. However, it's safe to just copy and paste the pattern into bootorder. For example, the file:<br />
<br />
/pci@i0cf8/usb@10,4/*@2<br />
/pci@i0cf8/*@f/drive@1/disk@0<br />
<br />
will instruct SeaBIOS to attempt to boot from the given USB drive first and then attempt the given ATA harddrive second.<br />
<br />
Once a file has been created, add it to CBFS with the name '''bootorder'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f mybootlist.txt -n bootorder -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
== Other Configuration items ==<br />
<br />
Additional configuration options are available in the CBFS '''etc/''' directory. For example, to set the duration of the boot menu to five and a half seconds, one would do the following:<br />
<br />
<source lang="bash"><br />
$ /path/to/seabios/scripts/encodeint.py boot-menu-wait 5500<br />
$ ./build/cbfstool build/coreboot.rom add -f boot-menu-wait -n etc/boot-menu-wait -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
The SeaBIOS tool '''scripts/encodeint.py''' will create a litte-endian encoded binary integer which can be placed into a CBFS file.<br />
<br />
{| border=1<br />
|+ Configuration variables<br />
|-<br />
! Filename !! Description<br />
|-<br />
| show-boot-menu || Controls the display of the boot menu. Set to 0 to disable the boot menu.<br />
|-<br />
| boot-menu-message || Customize the text boot menu message. Normally, when in text mode SeaBIOS will report the string "\nPress F12 for boot menu.\n\n". This field allows the string to be changed. (This is a string field, not an integer field; don't use encodeint.py, just place the desired string into a file and add as above.)<br />
|-<br />
| boot-menu-key || Controls which key activates the boot menu. The value stored is the DOS scan code (eg, 0x86 for F12, 0x01 for Esc). If this field is set, be sure to also customize the '''boot-menu-message''' field above.<br />
|-<br />
| boot-menu-wait || Amount of time (in milliseconds) to wait at the boot menu prompt before selecting the default boot.<br />
|-<br />
| boot-fail-wait || If no boot devices are found SeaBIOS will reboot after 60 seconds. Set this to the amount of time (in milliseconds) to customize the reboot delay or set to -1 to disable rebooting when no boot devices are found<br />
|-<br />
| extra-pci-roots || If the target machine has multiple independent root buses set this to a positive value. The SeaBIOS PCI probe will then search for the given number of extra root buses.<br />
|-<br />
| ps2-keyboard-spinup || Some laptops that emulate PS2 keyboards don't respond to keyboard commands immediately after powering on. One may specify the amount of time (in milliseconds) here to allow as additional time for the keyboard to become responsive. When this field is set, SeaBIOS will repeatedly attempt to detect the keyboard until the keyboard is found or the specified timeout is reached.<br />
|-<br />
| optionroms-checksum || Option ROMs are required to have correct checksums. However, some option ROMs in the wild don't correctly follow the specifications and have bad checksums. Set this to a zero value to allow SeaBIOS to execute them anyways.<br />
|-<br />
| s3-resume-vga-init || Set this to a non-zero value to instruct SeaBIOS to run the vga rom on an S3 resume.<br />
|-<br />
| screen-and-debug || Set this to a zero value to instruct SeaBIOS to not write characters it sends to the screen to the debug ports. This can be useful when using [[#Adding sgabios support|sgabios]].<br />
|-<br />
| advertise-serial-debug-port || If using a serial debug port, one can set this file to a zero value to prevent SeaBIOS from listing that serial port as available for operating system use. This can be useful when running old DOS programs that are known to reset the baud rate of all advertised serial ports.<br />
|-<br />
| floppy0 || Set this to the type of the first floppy drive in the system (only type 4 for 3.5 inch drives is supported).<br />
|-<br />
| floppy1 || The type of the second floppy drive in the system. See the description of '''floppy0''' for more info.<br />
|-<br />
| threads || By default, SeaBIOS will parallelize hardware initialization during bootup to reduce boot time. Multiple hardware devices can be initialized in parallel between vga initialization and option rom initialization. One can set this file to a value of zero to force hardware initialization to run serially. Alternatively, one can set this file to 2 to enable early hardware initialization that runs in parallel with vga, option rom initialization, and the boot menu.<br />
|}<br />
<br />
== File aliases ==<br />
<br />
It is possible to create the equivalent of "symbolic links" in CBFS so that one file's content appears under another name. To do this, create a links file with one line per link and each line having the format of "linkname" and "destname" separated by a space character. For example, the "links" file may look like:<br />
<br />
pci1234,1000.rom somerom.rom<br />
pci1234,1001.rom somerom.rom<br />
pci1234,1002.rom somerom.rom<br />
<br />
Then add the "links" file to CBFS:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f links -n links -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
The above example would cause SeaBIOS to treat "pci1234,1000.rom" or "pci1234,1001.rom" as files with the same content as the file "somerom.rom".<br />
<br />
= Trouble reporting =<br />
<br />
If you are experiencing problems with SeaBIOS, it's useful to increase the debugging level. This is done by running '''make menuconfig''' and setting '''CONFIG_DEBUG_LEVEL''' to a higher value. A debug level of 8 will show a lot of diagnostic information without flooding the serial port (levels above 8 will frequently cause too much data).<br />
<br />
To report an issue, please collect the serial boot log with SeaBIOS set to a debug level of 8 and forward the full log along with a description of the problem to the coreboot [[Mailinglist|mailing list]].</div>KevinOConnorhttps://www.coreboot.org/index.php?title=SeaBIOS&diff=13732SeaBIOS2014-05-28T13:03:20Z<p>KevinOConnor: /* Other Configuration items */ Updates for v1.7.5 release</p>
<hr />
<div>[http://www.seabios.org '''SeaBIOS'''] is an open-source legacy BIOS implementation which can be used as a coreboot [[Payloads|payload]]. It implements the standard [https://secure.wikimedia.org/wikipedia/en/wiki/BIOS BIOS] calling interfaces that a typical x86 proprietary BIOS implements.<br />
<br />
This page describes using SeaBIOS with coreboot. SeaBIOS can also run natively in [[QEMU]] and [http://bochs.sourceforge.net/ bochs] &mdash; see the [http://git.linuxtogo.org/?p=kevin/seabios.git;a=blob;f=README;hb=HEAD SeaBIOS README] file for information on non-coreboot uses.<br />
<br />
= Use cases =<br />
<br />
Any software requiring 16-bit BIOS services benefits from SeaBIOS (eg, Windows and DOS). SeaBIOS also enables booting Linux out of the box (using standard boot-loaders like GRUB and Syslinux).<br />
<br />
SeaBIOS supports booting from ATA hard drives, ATAPI CDROMs, USB hard drives, USB CDROMs, payloads in flash, and from [http://en.wikipedia.org/wiki/Option_ROM Option ROMs] (eg, SCSI or network cards). SeaBIOS can initialize and use a PS/2 keyboard or USB keyboard.<br />
<br />
== Windows ==<br />
<br />
SeaBIOS has been tested with Windows XP, Windows 2008, Windows Vista (64/32 bit), Windows 7 (32 bit and 64 bit).<br />
<br />
However, Windows has a very strict ACPI interpreter, and some coreboot boards do not have a complete [[ACPI|ACPI definition]]. As a result, some coreboot boards may fail during Windows boot (eg, it may fail with a '''STOP 0xA5''' code).<br />
<br />
Many boards do have working ACPI and are able to boot XP/Vista/Windows 7. Please check the board documentation or ask on the [[Mailinglist|mailing list]] if unsure of the status.<br />
<br />
== Linux ==<br />
<br />
SeaBIOS has been tested with GRUB, LILO, and Syslinux. Linux booting works well.<br />
<br />
== Other ==<br />
<br />
SeaBIOS has also been tested with FreeDOS, NetBSD, and OpenBSD.<br />
<br />
Because SeaBIOS implements the standard x86 BIOS interfaces, it is expected many other operating systems and boot-loaders will work.<br />
<br />
= Building =<br />
<br />
== Building via coreboot's menuconfig ==<br />
<br />
Probably the easiest way to use SeaBIOS as coreboot payload is to simply use the coreboot build process, which downloads and builds SeaBIOS as payload by default nowadays. You just have to run the following in your coreboot checkout:<br />
<br />
<source lang="bash"><br />
$ make menuconfig<br />
$ make<br />
</source><br />
<br />
Both SeaBIOS and coreboot will be built, and SeaBIOS will be added as payload to the '''coreboot.rom''' image that is being built.<br />
<br />
== Manual build ==<br />
<br />
One can download the latest version of SeaBIOS through a git repository:<br />
<br />
<source lang="bash"><br />
$ git clone git://git.seabios.org/seabios.git seabios<br />
$ cd seabios<br />
</source><br />
<br />
There's also a [http://code.coreboot.org/p/seabios/source/changes/master/ gitweb] facility to browse the latest source code online.<br />
<br />
Run '''make menuconfig''' and set the following variables:<br />
<br />
* CONFIG_COREBOOT 1<br />
* CONFIG_DEBUG_SERIAL 1<br />
<br />
Then:<br />
<br />
<source lang="bash"><br />
$ make<br />
</source><br />
<br />
The final SeaBIOS payload file is '''out/bios.bin.elf'''.<br />
<br />
== coreboot ==<br />
<br />
Configure coreboot with the following all disabled: '''CONFIG_VGA_ROM_RUN''', '''CONFIG_PCI_ROM_RUN''', '''CONFIG_ON_DEVICE_ROM_RUN'''<br />
<br />
Then configure the SeaBIOS '''out/bios.bin.elf''' file as the coreboot payload and build coreboot. The resulting '''coreboot.rom''' file will contain both SeaBIOS and coreboot, and it can be flashed to a ROM chip.<br />
<br />
= SeaBIOS and CBFS =<br />
<br />
SeaBIOS can read the coreboot flash filesystem and extract files.<br />
<br />
When SeaBIOS scans the target machine's PCI devices, it will recognize option ROMs in CBFS that have the form '''pciVVVV,DDDD.rom'''. It will also run any file in the directory '''vgaroms/''' as a VGA option ROM not specific to a device and files in '''genroms/''' as a generic option ROM not specific to a device. In the above cases, SeaBIOS will recognize files with a '''.lzma''' suffix, and automatically decompress them (eg, '''pci1106,3344.rom.lzma''' and '''vgaroms/sgabios.bin.lzma''').<br />
<br />
SeaBIOS can also load a graphical bootsplash image from '''bootsplash.jpg''' or '''bootsplash.bmp''', payloads found in the CBFS directory '''img/''', and floppy images found in the '''floppyimg/''' directory.<br />
<br />
Further, SeaBIOS can obtain configuration information from CBFS. A file '''bootorder''' determines the order of devices and methods to attempt to boot the system from. Additional configuration items may be found in the CBFS '''etc/''' directory.<br />
<br />
The examples below show some common uses of these features.<br />
<br />
== Adding a VGA option ROM ==<br />
<br />
It is frequently necessary to add a VGA option ROM to CBFS in order to use a VGA adapter that is built-in to a motherboard. Note, VGA adapters on external cards (PCI, AGP, PCIe) do not require this step as SeaBIOS will automatically extract the VGA BIOS directly from the card. For machines without a VGA adapter, please follow the [[#Adding sgabios support|sgabios instructions]] below.<br />
<br />
The first step is to find the vendor and device ID of the built-in VGA adapter. This information can be found from '''lspci''':<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
01:00.0 VGA compatible controller [0300]: VIA Technologies, Inc. UniChrome Pro IGP ['''1106:3344'''] (rev 01) (prog-if 00 [VGA controller])<br />
</source><br />
<br />
In the above example, the VGA vendor/device ID is '''1106:3344'''. [[VGA support#How_to_retrieve_a_good_video_bios|Obtain the VGA ROM]] (eg, '''vgabios.bin''') and add it to the ROM with:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/vgabios.bin -n pci1106,3344.rom -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
Alternatively, SeaBIOS supports LZMA compressed option ROMs. Use the following to add a compressed option ROM instead:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/vgabios.bin > vgabios.bin.lzma<br />
$ ./build/cbfstool build/coreboot.rom add -f vgabios.bin.lzma -n pci1106,3344.rom.lzma -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
After the above is done, one can write the '''coreboot.rom''' file to flash. SeaBIOS will extract the VGA ROM and run it during boot.<br />
<br />
== Adding gpxe support ==<br />
<br />
A [[GPXE|gpxe]] option ROM can nicely complement SeaBIOS and coreboot by adding network boot support. Adding gpxe is similar to [[#Adding a VGA option ROM]]. The first step is to find the Ethernet vendor/device ID. For example:<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
00:09.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet ['''10ec:8167'''] (rev 10)<br />
</source><br />
<br />
Then one can build a gpxe option ROM. For example:<br />
<br />
<source lang="bash"><br />
$ cd /path/to/gpxe/src/<br />
$ make bin/10ec8167.rom<br />
</source><br />
<br />
And add it to the coreboot image. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/gpxe/src/bin/10ec8167.rom -n pci10ec,8167.rom -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
As with VGA option ROMs, the gpxe option ROM may be compressed with LZMA. However, compression won't significantly reduce gpxe's size as it implements its own compression.<br />
<br />
In addition to gpxe, other option ROMs can be added in the same manner.<br />
<br />
== Adding sgabios support ==<br />
<br />
An [http://code.google.com/p/sgabios/ sgabios] option ROM can forward many VGA BIOS requests and keyboard events over a serial port. One can deploy it in addition to the primary VGA BIOS or by itself.<br />
<br />
If the target machine does not have a VGA adapter, then one should install sgabios. Most bootloaders (eg, GRUB) require a VGA BIOS in order to function properly &mdash; the sgabios ROM can fill this requirement.<br />
<br />
Place the sgabios ROM file in the '''vgaroms/''' directory of CBFS. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/sgabios.bin -n vgaroms/sgabios.bin -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
When using sgabios, all the characters that SeaBIOS writes to the screen will be seen twice &mdash; once from SeaBIOS sending the character to the serial port and once from sgabios forwarding the character. To prevent the duplicates set the [[#Other Configuration items|config file]] '''etc/screen-and-debug''' to zero.<br />
<br />
== Adding a graphical "bootsplash" image ==<br />
<br />
SeaBIOS can show a custom [http://en.wikipedia.org/wiki/JPEG JPEG] image or [http://en.wikipedia.org/wiki/BMP_file_format BMP] image during bootup. To enable this, add the JPEG file to flash with the name '''bootsplash.jpg''' or BMP file as '''bootsplash.bmp'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/image.jpg -n bootsplash.jpg -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
The size of the image determines the video mode to use for showing the image. Make sure the dimensions of the image exactly correspond to an available video mode (eg, 640x480, or 1024x768), otherwise it will not be displayed.<br />
<br />
SeaBIOS will show the image during the wait for the boot menu (if the boot menu has been disabled, users will not see the image). The image should probably have "Press F12 for boot menu" embedded in it so users know they can enter the normal SeaBIOS boot menu. By default, the boot menu prompt (and thus graphical image) is shown for 2.5 seconds. This can be customized via a [[#Other Configuration items|configuration parameter]].<br />
<br />
The JPEG viewer in SeaBIOS uses a simplified decoding algorithm. It supports most common JPEGs, but does not support all possible formats. Please see the [[#Trouble reporting|Trouble reporting]] section if a valid image isn't displayed properly.<br />
<br />
== Adding payloads ==<br />
<br />
Most [[Payloads|payloads]] can also be launched from SeaBIOS. To add a payload, build the corresponding .elf file and then add it to the '''coreboot.rom''' file in the '''img/''' directory. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add-payload /path/to/payload.elf img/MyPayload l<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
During boot, one can press the '''F12''' key to get a boot menu. SeaBIOS will show all files in the '''img/''' directory, and one can instruct SeaBIOS to run them.<br />
<br />
SeaBIOS supports both uncompressed and LZMA compressed payloads.<br />
<br />
== Adding a floppy image ==<br />
<br />
It is possible to embed an image of a floppy in flash. SeaBIOS can then boot from and redirect floppy BIOS calls to the flash image. This is mainly useful for legacy software (such as DOS utilities). To use this feature, place a floppy image into the CBFS directory '''floppyimg/'''. For example:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/myfloppy.img > myfloppy.img.lzma<br />
$ ./build/cbfstool build/coreboot.rom add -f myfloppy.img.lzma -n floppyimg/MyFloppy.lzma -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
Both uncompressed and LZMA compressed images are supported. Several floppy formats are available: 360K, 1.2MB, 720K, 1.44MB, 2.88MB, 160K, 180K, 320K.<br />
<br />
The floppy image will appear as writable to the system, however all writes are discarded on reboot.<br />
<br />
When using this system, SeaBIOS reserves high-memory to store the floppy. The reserved memory is then no longer available for OS use, so this feature should only be used when needed.<br />
<br />
== Configuring boot order ==<br />
<br />
Place a file in CBFS with the name '''bootorder''' to configure the boot up order. The file should be ASCII text and contain one line per boot method. The description of each boot method follows an [https://secure.wikimedia.org/wikipedia/en/wiki/Open_firmware Open Firmware] device path format. SeaBIOS will attempt to boot from each item in the file &mdash; first line of the file first.<br />
<br />
The easiest way to find the available boot methods is to look for "Searching bootorder for" in the SeaBIOS serial output. For example, one may see lines similar to:<br />
<br />
Searching bootorder for: /pci@i0cf8/*@f/drive@1/disk@0<br />
Searching bootorder for: /pci@i0cf8/*@f,1/drive@2/disk@1<br />
Searching bootorder for: /pci@i0cf8/usb@10,4/*@2<br />
<br />
The above represents the patterns SeaBIOS will search for in the bootorder file. However, it's safe to just copy and paste the pattern into bootorder. For example, the file:<br />
<br />
/pci@i0cf8/usb@10,4/*@2<br />
/pci@i0cf8/*@f/drive@1/disk@0<br />
<br />
will instruct SeaBIOS to attempt to boot from the given USB drive first and then attempt the given ATA harddrive second.<br />
<br />
Once a file has been created, add it to CBFS with the name '''bootorder'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f mybootlist.txt -n bootorder -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
== Other Configuration items ==<br />
<br />
Additional configuration options are available in the CBFS '''etc/''' directory. For example, to set the duration of the boot menu to five and a half seconds, one would do the following:<br />
<br />
<source lang="bash"><br />
$ /path/to/seabios/scripts/encodeint.py boot-menu-wait 5500<br />
$ ./build/cbfstool build/coreboot.rom add -f boot-menu-wait -n etc/boot-menu-wait -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
The SeaBIOS tool '''scripts/encodeint.py''' will create a litte-endian encoded binary integer which can be placed into a CBFS file.<br />
<br />
{| border=1<br />
|+ Configuration variables<br />
|-<br />
! Filename !! Description<br />
|-<br />
| show-boot-menu || Controls the display of the boot menu. Set to 0 to disable the boot menu.<br />
|-<br />
| boot-menu-message || Customize the text boot menu message. Normally, when in text mode SeaBIOS will report the string "\nPress F12 for boot menu.\n\n". This field allows the string to be changed. (This is a string field, not an integer field; don't use encodeint.py, just place the desired string into a file and add as above.)<br />
|-<br />
| boot-menu-key || Controls which key activates the boot menu. The value stored is the DOS scan code (eg, 0x86 for F12, 0x01 for Esc). If this field is set, be sure to also customize the '''boot-menu-message''' field above.<br />
|-<br />
| boot-menu-wait || Amount of time (in milliseconds) to wait at the boot menu prompt before selecting the default boot.<br />
|-<br />
| boot-fail-wait || If no boot devices are found SeaBIOS will reboot after 60 seconds. Set this to the amount of time (in milliseconds) to customize the reboot delay or set to -1 to disable rebooting when no boot devices are found<br />
|-<br />
| extra-pci-roots || If the target machine has multiple independent root buses set this to a positive value. The SeaBIOS PCI probe will then search for the given number of extra root buses.<br />
|-<br />
| ps2-keyboard-spinup || Some laptops that emulate PS2 keyboards don't respond to keyboard commands immediately after powering on. One may specify the amount of time (in milliseconds) here to allow as additional time for the keyboard to become responsive. When this field is set, SeaBIOS will repeatedly attempt to detect the keyboard until the keyboard is found or the specified timeout is reached.<br />
|-<br />
| optionroms-checksum || Option ROMs are required to have correct checksums. However, some option ROMs in the wild don't correctly follow the specifications and have bad checksums. Set this to a zero value to allow SeaBIOS to execute them anyways.<br />
|-<br />
| s3-resume-vga-init || Set this to a non-zero value to instruct SeaBIOS to run the vga rom on an S3 resume.<br />
|-<br />
| screen-and-debug || Set this to a zero value to instruct SeaBIOS to not write characters it sends to the screen to the debug ports. This can be useful when using [[#Adding sgabios support|sgabios]].<br />
|-<br />
| advertise-serial-debug-port || If using a serial debug port, one can set this file to a zero value to prevent SeaBIOS from listing that serial port as available for operating system use. This can be useful when running old DOS programs that are known to reset the baud rate of all advertised serial ports.<br />
|-<br />
| floppy0 || Set this to the type of the first floppy drive in the system (only type 4 for 3.5 inch drives is supported).<br />
|-<br />
| floppy1 || The type of the second floppy drive in the system. See the description of '''floppy0''' for more info.<br />
|-<br />
| threads || By default, SeaBIOS will parallelize hardware initialization during bootup to reduce boot time. Multiple hardware devices can be initialized in parallel between vga initialization and option rom initialization. One can set this file to a value of zero to force hardware initialization to run serially. Alternatively, one can set this file to 2 to enable early hardware initialization that runs in parallel with vga, option rom initialization, and the boot menu.<br />
|}<br />
<br />
= Trouble reporting =<br />
<br />
If you are experiencing problems with SeaBIOS, it's useful to increase the debugging level. This is done by running '''make menuconfig''' and setting '''CONFIG_DEBUG_LEVEL''' to a higher value. A debug level of 8 will show a lot of diagnostic information without flooding the serial port (levels above 8 will frequently cause too much data).<br />
<br />
To report an issue, please collect the serial boot log with SeaBIOS set to a debug level of 8 and forward the full log along with a description of the problem to the coreboot [[Mailinglist|mailing list]].</div>KevinOConnorhttps://www.coreboot.org/index.php?title=SeaBIOS&diff=13641SeaBIOS2014-04-22T17:24:33Z<p>KevinOConnor: /* Other Configuration items */ Document /etc/threads</p>
<hr />
<div>[http://www.seabios.org '''SeaBIOS'''] is an open-source legacy BIOS implementation which can be used as a coreboot [[Payloads|payload]]. It implements the standard [https://secure.wikimedia.org/wikipedia/en/wiki/BIOS BIOS] calling interfaces that a typical x86 proprietary BIOS implements.<br />
<br />
This page describes using SeaBIOS with coreboot. SeaBIOS can also run natively in [[QEMU]] and [http://bochs.sourceforge.net/ bochs] &mdash; see the [http://git.linuxtogo.org/?p=kevin/seabios.git;a=blob;f=README;hb=HEAD SeaBIOS README] file for information on non-coreboot uses.<br />
<br />
= Use cases =<br />
<br />
Any software requiring 16-bit BIOS services benefits from SeaBIOS (eg, Windows and DOS). SeaBIOS also enables booting Linux out of the box (using standard boot-loaders like GRUB and Syslinux).<br />
<br />
SeaBIOS supports booting from ATA hard drives, ATAPI CDROMs, USB hard drives, USB CDROMs, payloads in flash, and from [http://en.wikipedia.org/wiki/Option_ROM Option ROMs] (eg, SCSI or network cards). SeaBIOS can initialize and use a PS/2 keyboard or USB keyboard.<br />
<br />
== Windows ==<br />
<br />
SeaBIOS has been tested with Windows XP, Windows 2008, Windows Vista (64/32 bit), Windows 7 (32 bit and 64 bit).<br />
<br />
However, Windows has a very strict ACPI interpreter, and some coreboot boards do not have a complete [[ACPI|ACPI definition]]. As a result, some coreboot boards may fail during Windows boot (eg, it may fail with a '''STOP 0xA5''' code).<br />
<br />
Many boards do have working ACPI and are able to boot XP/Vista/Windows 7. Please check the board documentation or ask on the [[Mailinglist|mailing list]] if unsure of the status.<br />
<br />
== Linux ==<br />
<br />
SeaBIOS has been tested with GRUB, LILO, and Syslinux. Linux booting works well.<br />
<br />
== Other ==<br />
<br />
SeaBIOS has also been tested with FreeDOS, NetBSD, and OpenBSD.<br />
<br />
Because SeaBIOS implements the standard x86 BIOS interfaces, it is expected many other operating systems and boot-loaders will work.<br />
<br />
= Building =<br />
<br />
== Building via coreboot's menuconfig ==<br />
<br />
Probably the easiest way to use SeaBIOS as coreboot payload is to simply use the coreboot build process, which downloads and builds SeaBIOS as payload by default nowadays. You just have to run the following in your coreboot checkout:<br />
<br />
<source lang="bash"><br />
$ make menuconfig<br />
$ make<br />
</source><br />
<br />
Both SeaBIOS and coreboot will be built, and SeaBIOS will be added as payload to the '''coreboot.rom''' image that is being built.<br />
<br />
== Manual build ==<br />
<br />
One can download the latest version of SeaBIOS through a git repository:<br />
<br />
<source lang="bash"><br />
$ git clone git://git.seabios.org/seabios.git seabios<br />
$ cd seabios<br />
</source><br />
<br />
There's also a [http://code.coreboot.org/p/seabios/source/changes/master/ gitweb] facility to browse the latest source code online.<br />
<br />
Run '''make menuconfig''' and set the following variables:<br />
<br />
* CONFIG_COREBOOT 1<br />
* CONFIG_DEBUG_SERIAL 1<br />
<br />
Then:<br />
<br />
<source lang="bash"><br />
$ make<br />
</source><br />
<br />
The final SeaBIOS payload file is '''out/bios.bin.elf'''.<br />
<br />
== coreboot ==<br />
<br />
Configure coreboot with the following all disabled: '''CONFIG_VGA_ROM_RUN''', '''CONFIG_PCI_ROM_RUN''', '''CONFIG_ON_DEVICE_ROM_RUN'''<br />
<br />
Then configure the SeaBIOS '''out/bios.bin.elf''' file as the coreboot payload and build coreboot. The resulting '''coreboot.rom''' file will contain both SeaBIOS and coreboot, and it can be flashed to a ROM chip.<br />
<br />
= SeaBIOS and CBFS =<br />
<br />
SeaBIOS can read the coreboot flash filesystem and extract files.<br />
<br />
When SeaBIOS scans the target machine's PCI devices, it will recognize option ROMs in CBFS that have the form '''pciVVVV,DDDD.rom'''. It will also run any file in the directory '''vgaroms/''' as a VGA option ROM not specific to a device and files in '''genroms/''' as a generic option ROM not specific to a device. In the above cases, SeaBIOS will recognize files with a '''.lzma''' suffix, and automatically decompress them (eg, '''pci1106,3344.rom.lzma''' and '''vgaroms/sgabios.bin.lzma''').<br />
<br />
SeaBIOS can also load a graphical bootsplash image from '''bootsplash.jpg''' or '''bootsplash.bmp''', payloads found in the CBFS directory '''img/''', and floppy images found in the '''floppyimg/''' directory.<br />
<br />
Further, SeaBIOS can obtain configuration information from CBFS. A file '''bootorder''' determines the order of devices and methods to attempt to boot the system from. Additional configuration items may be found in the CBFS '''etc/''' directory.<br />
<br />
The examples below show some common uses of these features.<br />
<br />
== Adding a VGA option ROM ==<br />
<br />
It is frequently necessary to add a VGA option ROM to CBFS in order to use a VGA adapter that is built-in to a motherboard. Note, VGA adapters on external cards (PCI, AGP, PCIe) do not require this step as SeaBIOS will automatically extract the VGA BIOS directly from the card. For machines without a VGA adapter, please follow the [[#Adding sgabios support|sgabios instructions]] below.<br />
<br />
The first step is to find the vendor and device ID of the built-in VGA adapter. This information can be found from '''lspci''':<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
01:00.0 VGA compatible controller [0300]: VIA Technologies, Inc. UniChrome Pro IGP ['''1106:3344'''] (rev 01) (prog-if 00 [VGA controller])<br />
</source><br />
<br />
In the above example, the VGA vendor/device ID is '''1106:3344'''. [[VGA support#How_to_retrieve_a_good_video_bios|Obtain the VGA ROM]] (eg, '''vgabios.bin''') and add it to the ROM with:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/vgabios.bin -n pci1106,3344.rom -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
Alternatively, SeaBIOS supports LZMA compressed option ROMs. Use the following to add a compressed option ROM instead:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/vgabios.bin > vgabios.bin.lzma<br />
$ ./build/cbfstool build/coreboot.rom add -f vgabios.bin.lzma -n pci1106,3344.rom.lzma -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
After the above is done, one can write the '''coreboot.rom''' file to flash. SeaBIOS will extract the VGA ROM and run it during boot.<br />
<br />
== Adding gpxe support ==<br />
<br />
A [[GPXE|gpxe]] option ROM can nicely complement SeaBIOS and coreboot by adding network boot support. Adding gpxe is similar to [[#Adding a VGA option ROM]]. The first step is to find the Ethernet vendor/device ID. For example:<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
00:09.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet ['''10ec:8167'''] (rev 10)<br />
</source><br />
<br />
Then one can build a gpxe option ROM. For example:<br />
<br />
<source lang="bash"><br />
$ cd /path/to/gpxe/src/<br />
$ make bin/10ec8167.rom<br />
</source><br />
<br />
And add it to the coreboot image. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/gpxe/src/bin/10ec8167.rom -n pci10ec,8167.rom -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
As with VGA option ROMs, the gpxe option ROM may be compressed with LZMA. However, compression won't significantly reduce gpxe's size as it implements its own compression.<br />
<br />
In addition to gpxe, other option ROMs can be added in the same manner.<br />
<br />
== Adding sgabios support ==<br />
<br />
An [http://code.google.com/p/sgabios/ sgabios] option ROM can forward many VGA BIOS requests and keyboard events over a serial port. One can deploy it in addition to the primary VGA BIOS or by itself.<br />
<br />
If the target machine does not have a VGA adapter, then one should install sgabios. Most bootloaders (eg, GRUB) require a VGA BIOS in order to function properly &mdash; the sgabios ROM can fill this requirement.<br />
<br />
Place the sgabios ROM file in the '''vgaroms/''' directory of CBFS. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/sgabios.bin -n vgaroms/sgabios.bin -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
When using sgabios, all the characters that SeaBIOS writes to the screen will be seen twice &mdash; once from SeaBIOS sending the character to the serial port and once from sgabios forwarding the character. To prevent the duplicates set the [[#Other Configuration items|config file]] '''etc/screen-and-debug''' to zero.<br />
<br />
== Adding a graphical "bootsplash" image ==<br />
<br />
SeaBIOS can show a custom [http://en.wikipedia.org/wiki/JPEG JPEG] image or [http://en.wikipedia.org/wiki/BMP_file_format BMP] image during bootup. To enable this, add the JPEG file to flash with the name '''bootsplash.jpg''' or BMP file as '''bootsplash.bmp'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/image.jpg -n bootsplash.jpg -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
The size of the image determines the video mode to use for showing the image. Make sure the dimensions of the image exactly correspond to an available video mode (eg, 640x480, or 1024x768), otherwise it will not be displayed.<br />
<br />
SeaBIOS will show the image during the wait for the boot menu (if the boot menu has been disabled, users will not see the image). The image should probably have "Press F12 for boot menu" embedded in it so users know they can enter the normal SeaBIOS boot menu. By default, the boot menu prompt (and thus graphical image) is shown for 2.5 seconds. This can be customized via a [[#Other Configuration items|configuration parameter]].<br />
<br />
The JPEG viewer in SeaBIOS uses a simplified decoding algorithm. It supports most common JPEGs, but does not support all possible formats. Please see the [[#Trouble reporting|Trouble reporting]] section if a valid image isn't displayed properly.<br />
<br />
== Adding payloads ==<br />
<br />
Most [[Payloads|payloads]] can also be launched from SeaBIOS. To add a payload, build the corresponding .elf file and then add it to the '''coreboot.rom''' file in the '''img/''' directory. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add-payload /path/to/payload.elf img/MyPayload l<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
During boot, one can press the '''F12''' key to get a boot menu. SeaBIOS will show all files in the '''img/''' directory, and one can instruct SeaBIOS to run them.<br />
<br />
SeaBIOS supports both uncompressed and LZMA compressed payloads.<br />
<br />
== Adding a floppy image ==<br />
<br />
It is possible to embed an image of a floppy in flash. SeaBIOS can then boot from and redirect floppy BIOS calls to the flash image. This is mainly useful for legacy software (such as DOS utilities). To use this feature, place a floppy image into the CBFS directory '''floppyimg/'''. For example:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/myfloppy.img > myfloppy.img.lzma<br />
$ ./build/cbfstool build/coreboot.rom add -f myfloppy.img.lzma -n floppyimg/MyFloppy.lzma -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
Both uncompressed and LZMA compressed images are supported. Several floppy formats are available: 360K, 1.2MB, 720K, 1.44MB, 2.88MB, 160K, 180K, 320K.<br />
<br />
The floppy image will appear as writable to the system, however all writes are discarded on reboot.<br />
<br />
When using this system, SeaBIOS reserves high-memory to store the floppy. The reserved memory is then no longer available for OS use, so this feature should only be used when needed.<br />
<br />
== Configuring boot order ==<br />
<br />
Place a file in CBFS with the name '''bootorder''' to configure the boot up order. The file should be ASCII text and contain one line per boot method. The description of each boot method follows an [https://secure.wikimedia.org/wikipedia/en/wiki/Open_firmware Open Firmware] device path format. SeaBIOS will attempt to boot from each item in the file &mdash; first line of the file first.<br />
<br />
The easiest way to find the available boot methods is to look for "Searching bootorder for" in the SeaBIOS serial output. For example, one may see lines similar to:<br />
<br />
Searching bootorder for: /pci@i0cf8/*@f/drive@1/disk@0<br />
Searching bootorder for: /pci@i0cf8/*@f,1/drive@2/disk@1<br />
Searching bootorder for: /pci@i0cf8/usb@10,4/*@2<br />
<br />
The above represents the patterns SeaBIOS will search for in the bootorder file. However, it's safe to just copy and paste the pattern into bootorder. For example, the file:<br />
<br />
/pci@i0cf8/usb@10,4/*@2<br />
/pci@i0cf8/*@f/drive@1/disk@0<br />
<br />
will instruct SeaBIOS to attempt to boot from the given USB drive first and then attempt the given ATA harddrive second.<br />
<br />
Once a file has been created, add it to CBFS with the name '''bootorder'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f mybootlist.txt -n bootorder -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
== Other Configuration items ==<br />
<br />
Additional configuration options are available in the CBFS '''etc/''' directory. For example, to set the duration of the boot menu to five and a half seconds, one would do the following:<br />
<br />
<source lang="bash"><br />
$ /path/to/seabios/scripts/encodeint.py boot-menu-wait 5500<br />
$ ./build/cbfstool build/coreboot.rom add -f boot-menu-wait -n etc/boot-menu-wait -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
The SeaBIOS tool '''scripts/encodeint.py''' will create a litte-endian encoded binary integer which can be placed into a CBFS file.<br />
<br />
{| border=1<br />
|+ Configuration variables<br />
|-<br />
! Filename !! Description<br />
|-<br />
| show-boot-menu || Controls the display of the boot menu. Set to 0 to disable the boot menu.<br />
|-<br />
| boot-menu-message || Customize the text boot menu message. Normally, when in text mode SeaBIOS will report the string "\nPress F12 for boot menu.\n\n". This field allows the string to be changed. (This is a string field, not an integer field; don't use encodeint.py, just place the desired string into a file and add as above.)<br />
|-<br />
| boot-menu-key || Controls which key activates the boot menu. The value stored is the DOS scan code (eg, 0x86 for F12, 0x01 for Esc). If this field is set, be sure to also customize the '''boot-menu-message''' field above.<br />
|-<br />
| boot-menu-wait || Amount of time (in milliseconds) to wait at the boot menu prompt before selecting the default boot.<br />
|-<br />
| boot-fail-wait || If no boot devices are found SeaBIOS will reboot after 60 seconds. Set this to the amount of time (in milliseconds) to customize the reboot delay or set to -1 to disable rebooting when no boot devices are found<br />
|-<br />
| extra-pci-roots || If the target machine has multiple independent root buses set this to a positive value. The SeaBIOS PCI probe will then search for the given number of extra root buses.<br />
|-<br />
| ps2-keyboard-spinup || Some laptops that emulate PS2 keyboards don't respond to keyboard commands immediately after powering on. One may specify the amount of time (in milliseconds) here to allow as additional time for the keyboard to become responsive. When this field is set, SeaBIOS will repeatedly attempt to detect the keyboard until the keyboard is found or the specified timeout is reached.<br />
|-<br />
| optionroms-checksum || Option ROMs are required to have correct checksums. However, some option ROMs in the wild don't correctly follow the specifications and have bad checksums. Set this to a zero value to allow SeaBIOS to execute them anyways.<br />
|-<br />
| s3-resume-vga-init || Set this to a non-zero value to instruct SeaBIOS to run the vga rom on an S3 resume.<br />
|-<br />
| screen-and-debug || Set this to a zero value to instruct SeaBIOS to not write characters it sends to the screen to the debug ports. This can be useful when using [[#Adding sgabios support|sgabios]].<br />
|-<br />
| advertise-serial-debug-port || If using a serial debug port, one can set this file to a zero value to prevent SeaBIOS from listing that serial port as available for operating system use. This can be useful when running old DOS programs that are known to reset the baud rate of all advertised serial ports. (This option is only available in SeaBIOS git revisions after 20140115.)<br />
|-<br />
| floppy0 || Set this to the type of the first floppy drive in the system (only type 4 for 3.5 inch drives is supported).<br />
|-<br />
| floppy1 || The type of the second floppy drive in the system. See the description of '''floppy0''' for more info.<br />
|-<br />
| threads || By default, SeaBIOS will parallelize hardware initialization during bootup to reduce boot time. Multiple hardware devices can be initialized in parallel between vga initialization and option rom initialization. One can set this file to a value of zero to force hardware initialization to run serially. Alternatively, one can set this file to 2 to enable early hardware initialization that runs in parallel with vga, option rom initialization, and the boot menu. (This option is only available in SeaBIOS git revisions after 20140407.)<br />
|}<br />
<br />
= Trouble reporting =<br />
<br />
If you are experiencing problems with SeaBIOS, it's useful to increase the debugging level. This is done by running '''make menuconfig''' and setting '''CONFIG_DEBUG_LEVEL''' to a higher value. A debug level of 8 will show a lot of diagnostic information without flooding the serial port (levels above 8 will frequently cause too much data).<br />
<br />
To report an issue, please collect the serial boot log with SeaBIOS set to a debug level of 8 and forward the full log along with a description of the problem to the coreboot [[Mailinglist|mailing list]].</div>KevinOConnorhttps://www.coreboot.org/index.php?title=SeaBIOS&diff=13530SeaBIOS2014-04-02T21:53:37Z<p>KevinOConnor: /* Other Configuration items */ Document advertise-serial-debug-port</p>
<hr />
<div>[http://www.seabios.org '''SeaBIOS'''] is an open-source legacy BIOS implementation which can be used as a coreboot [[Payloads|payload]]. It implements the standard [https://secure.wikimedia.org/wikipedia/en/wiki/BIOS BIOS] calling interfaces that a typical x86 proprietary BIOS implements.<br />
<br />
This page describes using SeaBIOS with coreboot. SeaBIOS can also run natively in [[QEMU]] and [http://bochs.sourceforge.net/ bochs] &mdash; see the [http://git.linuxtogo.org/?p=kevin/seabios.git;a=blob;f=README;hb=HEAD SeaBIOS README] file for information on non-coreboot uses.<br />
<br />
= Use cases =<br />
<br />
Any software requiring 16-bit BIOS services benefits from SeaBIOS (eg, Windows and DOS). SeaBIOS also enables booting Linux out of the box (using standard boot-loaders like GRUB and Syslinux).<br />
<br />
SeaBIOS supports booting from ATA hard drives, ATAPI CDROMs, USB hard drives, USB CDROMs, payloads in flash, and from [http://en.wikipedia.org/wiki/Option_ROM Option ROMs] (eg, SCSI or network cards). SeaBIOS can initialize and use a PS/2 keyboard or USB keyboard.<br />
<br />
== Windows ==<br />
<br />
SeaBIOS has been tested with Windows XP, Windows 2008, Windows Vista (64/32 bit), Windows 7 (32 bit and 64 bit).<br />
<br />
However, Windows has a very strict ACPI interpreter, and some coreboot boards do not have a complete [[ACPI|ACPI definition]]. As a result, some coreboot boards may fail during Windows boot (eg, it may fail with a '''STOP 0xA5''' code).<br />
<br />
Many boards do have working ACPI and are able to boot XP/Vista/Windows 7. Please check the board documentation or ask on the [[Mailinglist|mailing list]] if unsure of the status.<br />
<br />
== Linux ==<br />
<br />
SeaBIOS has been tested with GRUB, LILO, and Syslinux. Linux booting works well.<br />
<br />
== Other ==<br />
<br />
SeaBIOS has also been tested with FreeDOS, NetBSD, and OpenBSD.<br />
<br />
Because SeaBIOS implements the standard x86 BIOS interfaces, it is expected many other operating systems and boot-loaders will work.<br />
<br />
= Building =<br />
<br />
== Building via coreboot's menuconfig ==<br />
<br />
Probably the easiest way to use SeaBIOS as coreboot payload is to simply use the coreboot build process, which downloads and builds SeaBIOS as payload by default nowadays. You just have to run the following in your coreboot checkout:<br />
<br />
<source lang="bash"><br />
$ make menuconfig<br />
$ make<br />
</source><br />
<br />
Both SeaBIOS and coreboot will be built, and SeaBIOS will be added as payload to the '''coreboot.rom''' image that is being built.<br />
<br />
== Manual build ==<br />
<br />
One can download the latest version of SeaBIOS through a git repository:<br />
<br />
<source lang="bash"><br />
$ git clone git://git.seabios.org/seabios.git seabios<br />
$ cd seabios<br />
</source><br />
<br />
There's also a [http://code.coreboot.org/p/seabios/source/changes/master/ gitweb] facility to browse the latest source code online.<br />
<br />
Run '''make menuconfig''' and set the following variables:<br />
<br />
* CONFIG_COREBOOT 1<br />
* CONFIG_DEBUG_SERIAL 1<br />
<br />
Then:<br />
<br />
<source lang="bash"><br />
$ make<br />
</source><br />
<br />
The final SeaBIOS payload file is '''out/bios.bin.elf'''.<br />
<br />
== coreboot ==<br />
<br />
Configure coreboot with the following all disabled: '''CONFIG_VGA_ROM_RUN''', '''CONFIG_PCI_ROM_RUN''', '''CONFIG_ON_DEVICE_ROM_RUN'''<br />
<br />
Then configure the SeaBIOS '''out/bios.bin.elf''' file as the coreboot payload and build coreboot. The resulting '''coreboot.rom''' file will contain both SeaBIOS and coreboot, and it can be flashed to a ROM chip.<br />
<br />
= SeaBIOS and CBFS =<br />
<br />
SeaBIOS can read the coreboot flash filesystem and extract files.<br />
<br />
When SeaBIOS scans the target machine's PCI devices, it will recognize option ROMs in CBFS that have the form '''pciVVVV,DDDD.rom'''. It will also run any file in the directory '''vgaroms/''' as a VGA option ROM not specific to a device and files in '''genroms/''' as a generic option ROM not specific to a device. In the above cases, SeaBIOS will recognize files with a '''.lzma''' suffix, and automatically decompress them (eg, '''pci1106,3344.rom.lzma''' and '''vgaroms/sgabios.bin.lzma''').<br />
<br />
SeaBIOS can also load a graphical bootsplash image from '''bootsplash.jpg''' or '''bootsplash.bmp''', payloads found in the CBFS directory '''img/''', and floppy images found in the '''floppyimg/''' directory.<br />
<br />
Further, SeaBIOS can obtain configuration information from CBFS. A file '''bootorder''' determines the order of devices and methods to attempt to boot the system from. Additional configuration items may be found in the CBFS '''etc/''' directory.<br />
<br />
The examples below show some common uses of these features.<br />
<br />
== Adding a VGA option ROM ==<br />
<br />
It is frequently necessary to add a VGA option ROM to CBFS in order to use a VGA adapter that is built-in to a motherboard. Note, VGA adapters on external cards (PCI, AGP, PCIe) do not require this step as SeaBIOS will automatically extract the VGA BIOS directly from the card. For machines without a VGA adapter, please follow the [[#Adding sgabios support|sgabios instructions]] below.<br />
<br />
The first step is to find the vendor and device ID of the built-in VGA adapter. This information can be found from '''lspci''':<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
01:00.0 VGA compatible controller [0300]: VIA Technologies, Inc. UniChrome Pro IGP ['''1106:3344'''] (rev 01) (prog-if 00 [VGA controller])<br />
</source><br />
<br />
In the above example, the VGA vendor/device ID is '''1106:3344'''. [[VGA support#How_to_retrieve_a_good_video_bios|Obtain the VGA ROM]] (eg, '''vgabios.bin''') and add it to the ROM with:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/vgabios.bin -n pci1106,3344.rom -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
Alternatively, SeaBIOS supports LZMA compressed option ROMs. Use the following to add a compressed option ROM instead:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/vgabios.bin > vgabios.bin.lzma<br />
$ ./build/cbfstool build/coreboot.rom add -f vgabios.bin.lzma -n pci1106,3344.rom.lzma -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
After the above is done, one can write the '''coreboot.rom''' file to flash. SeaBIOS will extract the VGA ROM and run it during boot.<br />
<br />
== Adding gpxe support ==<br />
<br />
A [[GPXE|gpxe]] option ROM can nicely complement SeaBIOS and coreboot by adding network boot support. Adding gpxe is similar to [[#Adding a VGA option ROM]]. The first step is to find the Ethernet vendor/device ID. For example:<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
00:09.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet ['''10ec:8167'''] (rev 10)<br />
</source><br />
<br />
Then one can build a gpxe option ROM. For example:<br />
<br />
<source lang="bash"><br />
$ cd /path/to/gpxe/src/<br />
$ make bin/10ec8167.rom<br />
</source><br />
<br />
And add it to the coreboot image. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/gpxe/src/bin/10ec8167.rom -n pci10ec,8167.rom -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
As with VGA option ROMs, the gpxe option ROM may be compressed with LZMA. However, compression won't significantly reduce gpxe's size as it implements its own compression.<br />
<br />
In addition to gpxe, other option ROMs can be added in the same manner.<br />
<br />
== Adding sgabios support ==<br />
<br />
An [http://code.google.com/p/sgabios/ sgabios] option ROM can forward many VGA BIOS requests and keyboard events over a serial port. One can deploy it in addition to the primary VGA BIOS or by itself.<br />
<br />
If the target machine does not have a VGA adapter, then one should install sgabios. Most bootloaders (eg, GRUB) require a VGA BIOS in order to function properly &mdash; the sgabios ROM can fill this requirement.<br />
<br />
Place the sgabios ROM file in the '''vgaroms/''' directory of CBFS. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/sgabios.bin -n vgaroms/sgabios.bin -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
When using sgabios, all the characters that SeaBIOS writes to the screen will be seen twice &mdash; once from SeaBIOS sending the character to the serial port and once from sgabios forwarding the character. To prevent the duplicates set the [[#Other Configuration items|config file]] '''etc/screen-and-debug''' to zero.<br />
<br />
== Adding a graphical "bootsplash" image ==<br />
<br />
SeaBIOS can show a custom [http://en.wikipedia.org/wiki/JPEG JPEG] image or [http://en.wikipedia.org/wiki/BMP_file_format BMP] image during bootup. To enable this, add the JPEG file to flash with the name '''bootsplash.jpg''' or BMP file as '''bootsplash.bmp'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/image.jpg -n bootsplash.jpg -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
The size of the image determines the video mode to use for showing the image. Make sure the dimensions of the image exactly correspond to an available video mode (eg, 640x480, or 1024x768), otherwise it will not be displayed.<br />
<br />
SeaBIOS will show the image during the wait for the boot menu (if the boot menu has been disabled, users will not see the image). The image should probably have "Press F12 for boot menu" embedded in it so users know they can enter the normal SeaBIOS boot menu. By default, the boot menu prompt (and thus graphical image) is shown for 2.5 seconds. This can be customized via a [[#Other Configuration items|configuration parameter]].<br />
<br />
The JPEG viewer in SeaBIOS uses a simplified decoding algorithm. It supports most common JPEGs, but does not support all possible formats. Please see the [[#Trouble reporting|Trouble reporting]] section if a valid image isn't displayed properly.<br />
<br />
== Adding payloads ==<br />
<br />
Most [[Payloads|payloads]] can also be launched from SeaBIOS. To add a payload, build the corresponding .elf file and then add it to the '''coreboot.rom''' file in the '''img/''' directory. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add-payload /path/to/payload.elf img/MyPayload l<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
During boot, one can press the '''F12''' key to get a boot menu. SeaBIOS will show all files in the '''img/''' directory, and one can instruct SeaBIOS to run them.<br />
<br />
SeaBIOS supports both uncompressed and LZMA compressed payloads.<br />
<br />
== Adding a floppy image ==<br />
<br />
It is possible to embed an image of a floppy in flash. SeaBIOS can then boot from and redirect floppy BIOS calls to the flash image. This is mainly useful for legacy software (such as DOS utilities). To use this feature, place a floppy image into the CBFS directory '''floppyimg/'''. For example:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/myfloppy.img > myfloppy.img.lzma<br />
$ ./build/cbfstool build/coreboot.rom add -f myfloppy.img.lzma -n floppyimg/MyFloppy.lzma -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
Both uncompressed and LZMA compressed images are supported. Several floppy formats are available: 360K, 1.2MB, 720K, 1.44MB, 2.88MB, 160K, 180K, 320K.<br />
<br />
The floppy image will appear as writable to the system, however all writes are discarded on reboot.<br />
<br />
When using this system, SeaBIOS reserves high-memory to store the floppy. The reserved memory is then no longer available for OS use, so this feature should only be used when needed.<br />
<br />
== Configuring boot order ==<br />
<br />
Place a file in CBFS with the name '''bootorder''' to configure the boot up order. The file should be ASCII text and contain one line per boot method. The description of each boot method follows an [https://secure.wikimedia.org/wikipedia/en/wiki/Open_firmware Open Firmware] device path format. SeaBIOS will attempt to boot from each item in the file &mdash; first line of the file first.<br />
<br />
The easiest way to find the available boot methods is to look for "Searching bootorder for" in the SeaBIOS serial output. For example, one may see lines similar to:<br />
<br />
Searching bootorder for: /pci@i0cf8/*@f/drive@1/disk@0<br />
Searching bootorder for: /pci@i0cf8/*@f,1/drive@2/disk@1<br />
Searching bootorder for: /pci@i0cf8/usb@10,4/*@2<br />
<br />
The above represents the patterns SeaBIOS will search for in the bootorder file. However, it's safe to just copy and paste the pattern into bootorder. For example, the file:<br />
<br />
/pci@i0cf8/usb@10,4/*@2<br />
/pci@i0cf8/*@f/drive@1/disk@0<br />
<br />
will instruct SeaBIOS to attempt to boot from the given USB drive first and then attempt the given ATA harddrive second.<br />
<br />
Once a file has been created, add it to CBFS with the name '''bootorder'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f mybootlist.txt -n bootorder -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
== Other Configuration items ==<br />
<br />
Additional configuration options are available in the CBFS '''etc/''' directory. For example, to set the duration of the boot menu to five and a half seconds, one would do the following:<br />
<br />
<source lang="bash"><br />
$ /path/to/seabios/scripts/encodeint.py boot-menu-wait 5500<br />
$ ./build/cbfstool build/coreboot.rom add -f boot-menu-wait -n etc/boot-menu-wait -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
The SeaBIOS tool '''scripts/encodeint.py''' will create a litte-endian encoded binary integer which can be placed into a CBFS file.<br />
<br />
{| border=1<br />
|+ Configuration variables<br />
|-<br />
! Filename !! Description<br />
|-<br />
| show-boot-menu || Controls the display of the boot menu. Set to 0 to disable the boot menu.<br />
|-<br />
| boot-menu-message || Customize the text boot menu message. Normally, when in text mode SeaBIOS will report the string "\nPress F12 for boot menu.\n\n". This field allows the string to be changed. (This is a string field, not an integer field; don't use encodeint.py, just place the desired string into a file and add as above.)<br />
|-<br />
| boot-menu-key || Controls which key activates the boot menu. The value stored is the DOS scan code (eg, 0x86 for F12, 0x01 for Esc). If this field is set, be sure to also customize the '''boot-menu-message''' field above.<br />
|-<br />
| boot-menu-wait || Amount of time (in milliseconds) to wait at the boot menu prompt before selecting the default boot.<br />
|-<br />
| boot-fail-wait || If no boot devices are found SeaBIOS will reboot after 60 seconds. Set this to the amount of time (in milliseconds) to customize the reboot delay or set to -1 to disable rebooting when no boot devices are found<br />
|-<br />
| extra-pci-roots || If the target machine has multiple independent root buses set this to a positive value. The SeaBIOS PCI probe will then search for the given number of extra root buses.<br />
|-<br />
| ps2-keyboard-spinup || Some laptops that emulate PS2 keyboards don't respond to keyboard commands immediately after powering on. One may specify the amount of time (in milliseconds) here to allow as additional time for the keyboard to become responsive. When this field is set, SeaBIOS will repeatedly attempt to detect the keyboard until the keyboard is found or the specified timeout is reached.<br />
|-<br />
| optionroms-checksum || Option ROMs are required to have correct checksums. However, some option ROMs in the wild don't correctly follow the specifications and have bad checksums. Set this to a zero value to allow SeaBIOS to execute them anyways.<br />
|-<br />
| s3-resume-vga-init || Set this to a non-zero value to instruct SeaBIOS to run the vga rom on an S3 resume.<br />
|-<br />
| screen-and-debug || Set this to a zero value to instruct SeaBIOS to not write characters it sends to the screen to the debug ports. This can be useful when using [[#Adding sgabios support|sgabios]].<br />
|-<br />
| advertise-serial-debug-port || If using a serial debug port, one can set this file to a zero value to prevent SeaBIOS from listing that serial port as available for operating system use. This can be useful when running old DOS programs that are known to reset the baud rate of all advertised serial ports. (This option is only available in SeaBIOS git revisions after 20140115.)<br />
|-<br />
| floppy0 || Set this to the type of the first floppy drive in the system (only type 4 for 3.5 inch drives is supported).<br />
|-<br />
| floppy1 || The type of the second floppy drive in the system. See the description of '''floppy0''' for more info.<br />
|}<br />
<br />
= Trouble reporting =<br />
<br />
If you are experiencing problems with SeaBIOS, it's useful to increase the debugging level. This is done by running '''make menuconfig''' and setting '''CONFIG_DEBUG_LEVEL''' to a higher value. A debug level of 8 will show a lot of diagnostic information without flooding the serial port (levels above 8 will frequently cause too much data).<br />
<br />
To report an issue, please collect the serial boot log with SeaBIOS set to a debug level of 8 and forward the full log along with a description of the problem to the coreboot [[Mailinglist|mailing list]].</div>KevinOConnorhttps://www.coreboot.org/index.php?title=SeaBIOS&diff=12721SeaBIOS2014-01-18T01:53:41Z<p>KevinOConnor: /* Other Configuration items */ Seabios renamed tools/ directory to scripts/</p>
<hr />
<div>[http://www.seabios.org '''SeaBIOS'''] is an open-source legacy BIOS implementation which can be used as a coreboot [[Payloads|payload]]. It implements the standard [https://secure.wikimedia.org/wikipedia/en/wiki/BIOS BIOS] calling interfaces that a typical x86 proprietary BIOS implements.<br />
<br />
This page describes using SeaBIOS with coreboot. SeaBIOS can also run natively in [[QEMU]] and [http://bochs.sourceforge.net/ bochs] &mdash; see the [http://git.linuxtogo.org/?p=kevin/seabios.git;a=blob;f=README;hb=HEAD SeaBIOS README] file for information on non-coreboot uses.<br />
<br />
= Use cases =<br />
<br />
Any software requiring 16-bit BIOS services benefits from SeaBIOS (eg, Windows and DOS). SeaBIOS also enables booting Linux out of the box (using standard boot-loaders like GRUB and Syslinux).<br />
<br />
SeaBIOS supports booting from ATA hard drives, ATAPI CDROMs, USB hard drives, USB CDROMs, payloads in flash, and from [http://en.wikipedia.org/wiki/Option_ROM Option ROMs] (eg, SCSI or network cards). SeaBIOS can initialize and use a PS/2 keyboard or USB keyboard.<br />
<br />
== Windows ==<br />
<br />
SeaBIOS has been tested with Windows XP, Windows 2008, Windows Vista (64/32 bit), Windows 7 (32 bit and 64 bit).<br />
<br />
However, Windows has a very strict ACPI interpreter, and some coreboot boards do not have a complete [[ACPI|ACPI definition]]. As a result, some coreboot boards may fail during Windows boot (eg, it may fail with a '''STOP 0xA5''' code).<br />
<br />
Many boards do have working ACPI and are able to boot XP/Vista/Windows 7. Please check the board documentation or ask on the [[Mailinglist|mailing list]] if unsure of the status.<br />
<br />
== Linux ==<br />
<br />
SeaBIOS has been tested with GRUB, LILO, and Syslinux. Linux booting works well.<br />
<br />
== Other ==<br />
<br />
SeaBIOS has also been tested with FreeDOS, NetBSD, and OpenBSD.<br />
<br />
Because SeaBIOS implements the standard x86 BIOS interfaces, it is expected many other operating systems and boot-loaders will work.<br />
<br />
= Building =<br />
<br />
== Building via coreboot's menuconfig ==<br />
<br />
Probably the easiest way to use SeaBIOS as coreboot payload is to simply use the coreboot build process, which downloads and builds SeaBIOS as payload by default nowadays. You just have to run the following in your coreboot checkout:<br />
<br />
<source lang="bash"><br />
$ make menuconfig<br />
$ make<br />
</source><br />
<br />
Both SeaBIOS and coreboot will be built, and SeaBIOS will be added as payload to the '''coreboot.rom''' image that is being built.<br />
<br />
== Manual build ==<br />
<br />
One can download the latest version of SeaBIOS through a git repository:<br />
<br />
<source lang="bash"><br />
$ git clone git://git.seabios.org/seabios.git seabios<br />
$ cd seabios<br />
</source><br />
<br />
There's also a [http://code.coreboot.org/p/seabios/source/changes/master/ gitweb] facility to browse the latest source code online.<br />
<br />
Run '''make menuconfig''' and set the following variables:<br />
<br />
* CONFIG_COREBOOT 1<br />
* CONFIG_DEBUG_SERIAL 1<br />
<br />
Then:<br />
<br />
<source lang="bash"><br />
$ make<br />
</source><br />
<br />
The final SeaBIOS payload file is '''out/bios.bin.elf'''.<br />
<br />
== coreboot ==<br />
<br />
Configure coreboot with the following all disabled: '''CONFIG_VGA_ROM_RUN''', '''CONFIG_PCI_ROM_RUN''', '''CONFIG_ON_DEVICE_ROM_RUN'''<br />
<br />
Then configure the SeaBIOS '''out/bios.bin.elf''' file as the coreboot payload and build coreboot. The resulting '''coreboot.rom''' file will contain both SeaBIOS and coreboot, and it can be flashed to a ROM chip.<br />
<br />
= SeaBIOS and CBFS =<br />
<br />
SeaBIOS can read the coreboot flash filesystem and extract files.<br />
<br />
When SeaBIOS scans the target machine's PCI devices, it will recognize option ROMs in CBFS that have the form '''pciVVVV,DDDD.rom'''. It will also run any file in the directory '''vgaroms/''' as a VGA option ROM not specific to a device and files in '''genroms/''' as a generic option ROM not specific to a device. In the above cases, SeaBIOS will recognize files with a '''.lzma''' suffix, and automatically decompress them (eg, '''pci1106,3344.rom.lzma''' and '''vgaroms/sgabios.bin.lzma''').<br />
<br />
SeaBIOS can also load a graphical bootsplash image from '''bootsplash.jpg''' or '''bootsplash.bmp''', payloads found in the CBFS directory '''img/''', and floppy images found in the '''floppyimg/''' directory.<br />
<br />
Further, SeaBIOS can obtain configuration information from CBFS. A file '''bootorder''' determines the order of devices and methods to attempt to boot the system from. Additional configuration items may be found in the CBFS '''etc/''' directory.<br />
<br />
The examples below show some common uses of these features.<br />
<br />
== Adding a VGA option ROM ==<br />
<br />
It is frequently necessary to add a VGA option ROM to CBFS in order to use a VGA adapter that is built-in to a motherboard. Note, VGA adapters on external cards (PCI, AGP, PCIe) do not require this step as SeaBIOS will automatically extract the VGA BIOS directly from the card. For machines without a VGA adapter, please follow the [[#Adding sgabios support|sgabios instructions]] below.<br />
<br />
The first step is to find the vendor and device ID of the built-in VGA adapter. This information can be found from '''lspci''':<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
01:00.0 VGA compatible controller [0300]: VIA Technologies, Inc. UniChrome Pro IGP ['''1106:3344'''] (rev 01) (prog-if 00 [VGA controller])<br />
</source><br />
<br />
In the above example, the VGA vendor/device ID is '''1106:3344'''. [[VGA support#How_to_retrieve_a_good_video_bios|Obtain the VGA ROM]] (eg, '''vgabios.bin''') and add it to the ROM with:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/vgabios.bin -n pci1106,3344.rom -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
Alternatively, SeaBIOS supports LZMA compressed option ROMs. Use the following to add a compressed option ROM instead:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/vgabios.bin > vgabios.bin.lzma<br />
$ ./build/cbfstool build/coreboot.rom add -f vgabios.bin.lzma -n pci1106,3344.rom.lzma -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
After the above is done, one can write the '''coreboot.rom''' file to flash. SeaBIOS will extract the VGA ROM and run it during boot.<br />
<br />
== Adding gpxe support ==<br />
<br />
A [[GPXE|gpxe]] option ROM can nicely complement SeaBIOS and coreboot by adding network boot support. Adding gpxe is similar to [[#Adding a VGA option ROM]]. The first step is to find the Ethernet vendor/device ID. For example:<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
00:09.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet ['''10ec:8167'''] (rev 10)<br />
</source><br />
<br />
Then one can build a gpxe option ROM. For example:<br />
<br />
<source lang="bash"><br />
$ cd /path/to/gpxe/src/<br />
$ make bin/10ec8167.rom<br />
</source><br />
<br />
And add it to the coreboot image. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/gpxe/src/bin/10ec8167.rom -n pci10ec,8167.rom -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
As with VGA option ROMs, the gpxe option ROM may be compressed with LZMA. However, compression won't significantly reduce gpxe's size as it implements its own compression.<br />
<br />
In addition to gpxe, other option ROMs can be added in the same manner.<br />
<br />
== Adding sgabios support ==<br />
<br />
An [http://code.google.com/p/sgabios/ sgabios] option ROM can forward many VGA BIOS requests and keyboard events over a serial port. One can deploy it in addition to the primary VGA BIOS or by itself.<br />
<br />
If the target machine does not have a VGA adapter, then one should install sgabios. Most bootloaders (eg, GRUB) require a VGA BIOS in order to function properly &mdash; the sgabios ROM can fill this requirement.<br />
<br />
Place the sgabios ROM file in the '''vgaroms/''' directory of CBFS. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/sgabios.bin -n vgaroms/sgabios.bin -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
When using sgabios, all the characters that SeaBIOS writes to the screen will be seen twice &mdash; once from SeaBIOS sending the character to the serial port and once from sgabios forwarding the character. To prevent the duplicates set the [[#Other Configuration items|config file]] '''etc/screen-and-debug''' to zero.<br />
<br />
== Adding a graphical "bootsplash" image ==<br />
<br />
SeaBIOS can show a custom [http://en.wikipedia.org/wiki/JPEG JPEG] image or [http://en.wikipedia.org/wiki/BMP_file_format BMP] image during bootup. To enable this, add the JPEG file to flash with the name '''bootsplash.jpg''' or BMP file as '''bootsplash.bmp'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/image.jpg -n bootsplash.jpg -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
The size of the image determines the video mode to use for showing the image. Make sure the dimensions of the image exactly correspond to an available video mode (eg, 640x480, or 1024x768), otherwise it will not be displayed.<br />
<br />
SeaBIOS will show the image during the wait for the boot menu (if the boot menu has been disabled, users will not see the image). The image should probably have "Press F12 for boot menu" embedded in it so users know they can enter the normal SeaBIOS boot menu. By default, the boot menu prompt (and thus graphical image) is shown for 2.5 seconds. This can be customized via a [[#Other Configuration items|configuration parameter]].<br />
<br />
The JPEG viewer in SeaBIOS uses a simplified decoding algorithm. It supports most common JPEGs, but does not support all possible formats. Please see the [[#Trouble reporting|Trouble reporting]] section if a valid image isn't displayed properly.<br />
<br />
== Adding payloads ==<br />
<br />
Most [[Payloads|payloads]] can also be launched from SeaBIOS. To add a payload, build the corresponding .elf file and then add it to the '''coreboot.rom''' file in the '''img/''' directory. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add-payload /path/to/payload.elf img/MyPayload l<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
During boot, one can press the '''F12''' key to get a boot menu. SeaBIOS will show all files in the '''img/''' directory, and one can instruct SeaBIOS to run them.<br />
<br />
SeaBIOS supports both uncompressed and LZMA compressed payloads.<br />
<br />
== Adding a floppy image ==<br />
<br />
It is possible to embed an image of a floppy in flash. SeaBIOS can then boot from and redirect floppy BIOS calls to the flash image. This is mainly useful for legacy software (such as DOS utilities). To use this feature, place a floppy image into the CBFS directory '''floppyimg/'''. For example:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/myfloppy.img > myfloppy.img.lzma<br />
$ ./build/cbfstool build/coreboot.rom add -f myfloppy.img.lzma -n floppyimg/MyFloppy.lzma -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
Both uncompressed and LZMA compressed images are supported. Several floppy formats are available: 360K, 1.2MB, 720K, 1.44MB, 2.88MB, 160K, 180K, 320K.<br />
<br />
The floppy image will appear as writable to the system, however all writes are discarded on reboot.<br />
<br />
When using this system, SeaBIOS reserves high-memory to store the floppy. The reserved memory is then no longer available for OS use, so this feature should only be used when needed.<br />
<br />
== Configuring boot order ==<br />
<br />
Place a file in CBFS with the name '''bootorder''' to configure the boot up order. The file should be ASCII text and contain one line per boot method. The description of each boot method follows an [https://secure.wikimedia.org/wikipedia/en/wiki/Open_firmware Open Firmware] device path format. SeaBIOS will attempt to boot from each item in the file &mdash; first line of the file first.<br />
<br />
The easiest way to find the available boot methods is to look for "Searching bootorder for" in the SeaBIOS serial output. For example, one may see lines similar to:<br />
<br />
Searching bootorder for: /pci@i0cf8/*@f/drive@1/disk@0<br />
Searching bootorder for: /pci@i0cf8/*@f,1/drive@2/disk@1<br />
Searching bootorder for: /pci@i0cf8/usb@10,4/*@2<br />
<br />
The above represents the patterns SeaBIOS will search for in the bootorder file. However, it's safe to just copy and paste the pattern into bootorder. For example, the file:<br />
<br />
/pci@i0cf8/usb@10,4/*@2<br />
/pci@i0cf8/*@f/drive@1/disk@0<br />
<br />
will instruct SeaBIOS to attempt to boot from the given USB drive first and then attempt the given ATA harddrive second.<br />
<br />
Once a file has been created, add it to CBFS with the name '''bootorder'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f mybootlist.txt -n bootorder -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
== Other Configuration items ==<br />
<br />
Additional configuration options are available in the CBFS '''etc/''' directory. For example, to set the duration of the boot menu to five and a half seconds, one would do the following:<br />
<br />
<source lang="bash"><br />
$ /path/to/seabios/scripts/encodeint.py boot-menu-wait 5500<br />
$ ./build/cbfstool build/coreboot.rom add -f boot-menu-wait -n etc/boot-menu-wait -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
The SeaBIOS tool '''scripts/encodeint.py''' will create a litte-endian encoded binary integer which can be placed into a CBFS file.<br />
<br />
{| border=1<br />
|+ Configuration variables<br />
|-<br />
! Filename !! Description<br />
|-<br />
| show-boot-menu || Controls the display of the boot menu. Set to 0 to disable the boot menu.<br />
|-<br />
| boot-menu-message || Customize the text boot menu message. Normally, when in text mode SeaBIOS will report the string "\nPress F12 for boot menu.\n\n". This field allows the string to be changed. (This is a string field, not an integer field; don't use encodeint.py, just place the desired string into a file and add as above.)<br />
|-<br />
| boot-menu-key || Controls which key activates the boot menu. The value stored is the DOS scan code (eg, 0x86 for F12, 0x01 for Esc). If this field is set, be sure to also customize the '''boot-menu-message''' field above.<br />
|-<br />
| boot-menu-wait || Amount of time (in milliseconds) to wait at the boot menu prompt before selecting the default boot.<br />
|-<br />
| boot-fail-wait || If no boot devices are found SeaBIOS will reboot after 60 seconds. Set this to the amount of time (in milliseconds) to customize the reboot delay or set to -1 to disable rebooting when no boot devices are found<br />
|-<br />
| extra-pci-roots || If the target machine has multiple independent root buses set this to a positive value. The SeaBIOS PCI probe will then search for the given number of extra root buses.<br />
|-<br />
| ps2-keyboard-spinup || Some laptops that emulate PS2 keyboards don't respond to keyboard commands immediately after powering on. One may specify the amount of time (in milliseconds) here to allow as additional time for the keyboard to become responsive. When this field is set, SeaBIOS will repeatedly attempt to detect the keyboard until the keyboard is found or the specified timeout is reached.<br />
|-<br />
| optionroms-checksum || Option ROMs are required to have correct checksums. However, some option ROMs in the wild don't correctly follow the specifications and have bad checksums. Set this to a zero value to allow SeaBIOS to execute them anyways.<br />
|-<br />
| s3-resume-vga-init || Set this to a non-zero value to instruct SeaBIOS to run the vga rom on an S3 resume.<br />
|-<br />
| screen-and-debug || Set this to a zero value to instruct SeaBIOS to not write characters it sends to the screen to the debug ports. This can be useful when using [[#Adding sgabios support|sgabios]].<br />
|-<br />
| floppy0 || Set this to the type of the first floppy drive in the system (only type 4 for 3.5 inch drives is supported).<br />
|-<br />
| floppy1 || The type of the second floppy drive in the system. See the description of '''floppy0''' for more info.<br />
|}<br />
<br />
= Trouble reporting =<br />
<br />
If you are experiencing problems with SeaBIOS, it's useful to increase the debugging level. This is done by running '''make menuconfig''' and setting '''CONFIG_DEBUG_LEVEL''' to a higher value. A debug level of 8 will show a lot of diagnostic information without flooding the serial port (levels above 8 will frequently cause too much data).<br />
<br />
To report an issue, please collect the serial boot log with SeaBIOS set to a debug level of 8 and forward the full log along with a description of the problem to the coreboot [[Mailinglist|mailing list]].</div>KevinOConnorhttps://www.coreboot.org/index.php?title=SeaBIOS&diff=12607SeaBIOS2013-12-23T17:47:22Z<p>KevinOConnor: /* Other Configuration items */ Updates for v1.7.4 release</p>
<hr />
<div>[http://www.seabios.org '''SeaBIOS'''] is an open-source legacy BIOS implementation which can be used as a coreboot [[Payloads|payload]]. It implements the standard [https://secure.wikimedia.org/wikipedia/en/wiki/BIOS BIOS] calling interfaces that a typical x86 proprietary BIOS implements.<br />
<br />
This page describes using SeaBIOS with coreboot. SeaBIOS can also run natively in [[QEMU]] and [http://bochs.sourceforge.net/ bochs] &mdash; see the [http://git.linuxtogo.org/?p=kevin/seabios.git;a=blob;f=README;hb=HEAD SeaBIOS README] file for information on non-coreboot uses.<br />
<br />
= Use cases =<br />
<br />
Any software requiring 16-bit BIOS services benefits from SeaBIOS (eg, Windows and DOS). SeaBIOS also enables booting Linux out of the box (using standard boot-loaders like GRUB and Syslinux).<br />
<br />
SeaBIOS supports booting from ATA hard drives, ATAPI CDROMs, USB hard drives, USB CDROMs, payloads in flash, and from [http://en.wikipedia.org/wiki/Option_ROM Option ROMs] (eg, SCSI or network cards). SeaBIOS can initialize and use a PS/2 keyboard or USB keyboard.<br />
<br />
== Windows ==<br />
<br />
SeaBIOS has been tested with Windows XP, Windows 2008, Windows Vista (64/32 bit), Windows 7 (32 bit and 64 bit).<br />
<br />
However, Windows has a very strict ACPI interpreter, and some coreboot boards do not have a complete [[ACPI|ACPI definition]]. As a result, some coreboot boards may fail during Windows boot (eg, it may fail with a '''STOP 0xA5''' code).<br />
<br />
Many boards do have working ACPI and are able to boot XP/Vista/Windows 7. Please check the board documentation or ask on the [[Mailinglist|mailing list]] if unsure of the status.<br />
<br />
== Linux ==<br />
<br />
SeaBIOS has been tested with GRUB, LILO, and Syslinux. Linux booting works well.<br />
<br />
== Other ==<br />
<br />
SeaBIOS has also been tested with FreeDOS, NetBSD, and OpenBSD.<br />
<br />
Because SeaBIOS implements the standard x86 BIOS interfaces, it is expected many other operating systems and boot-loaders will work.<br />
<br />
= Building =<br />
<br />
== Building via coreboot's menuconfig ==<br />
<br />
Probably the easiest way to use SeaBIOS as coreboot payload is to simply use the coreboot build process, which downloads and builds SeaBIOS as payload by default nowadays. You just have to run the following in your coreboot checkout:<br />
<br />
<source lang="bash"><br />
$ make menuconfig<br />
$ make<br />
</source><br />
<br />
Both SeaBIOS and coreboot will be built, and SeaBIOS will be added as payload to the '''coreboot.rom''' image that is being built.<br />
<br />
== Manual build ==<br />
<br />
One can download the latest version of SeaBIOS through a git repository:<br />
<br />
<source lang="bash"><br />
$ git clone git://git.seabios.org/seabios.git seabios<br />
$ cd seabios<br />
</source><br />
<br />
There's also a [http://code.coreboot.org/p/seabios/source/changes/master/ gitweb] facility to browse the latest source code online.<br />
<br />
Run '''make menuconfig''' and set the following variables:<br />
<br />
* CONFIG_COREBOOT 1<br />
* CONFIG_DEBUG_SERIAL 1<br />
<br />
Then:<br />
<br />
<source lang="bash"><br />
$ make<br />
</source><br />
<br />
The final SeaBIOS payload file is '''out/bios.bin.elf'''.<br />
<br />
== coreboot ==<br />
<br />
Configure coreboot with the following all disabled: '''CONFIG_VGA_ROM_RUN''', '''CONFIG_PCI_ROM_RUN''', '''CONFIG_ON_DEVICE_ROM_RUN'''<br />
<br />
Then configure the SeaBIOS '''out/bios.bin.elf''' file as the coreboot payload and build coreboot. The resulting '''coreboot.rom''' file will contain both SeaBIOS and coreboot, and it can be flashed to a ROM chip.<br />
<br />
= SeaBIOS and CBFS =<br />
<br />
SeaBIOS can read the coreboot flash filesystem and extract files.<br />
<br />
When SeaBIOS scans the target machine's PCI devices, it will recognize option ROMs in CBFS that have the form '''pciVVVV,DDDD.rom'''. It will also run any file in the directory '''vgaroms/''' as a VGA option ROM not specific to a device and files in '''genroms/''' as a generic option ROM not specific to a device. In the above cases, SeaBIOS will recognize files with a '''.lzma''' suffix, and automatically decompress them (eg, '''pci1106,3344.rom.lzma''' and '''vgaroms/sgabios.bin.lzma''').<br />
<br />
SeaBIOS can also load a graphical bootsplash image from '''bootsplash.jpg''' or '''bootsplash.bmp''', payloads found in the CBFS directory '''img/''', and floppy images found in the '''floppyimg/''' directory.<br />
<br />
Further, SeaBIOS can obtain configuration information from CBFS. A file '''bootorder''' determines the order of devices and methods to attempt to boot the system from. Additional configuration items may be found in the CBFS '''etc/''' directory.<br />
<br />
The examples below show some common uses of these features.<br />
<br />
== Adding a VGA option ROM ==<br />
<br />
It is frequently necessary to add a VGA option ROM to CBFS in order to use a VGA adapter that is built-in to a motherboard. Note, VGA adapters on external cards (PCI, AGP, PCIe) do not require this step as SeaBIOS will automatically extract the VGA BIOS directly from the card. For machines without a VGA adapter, please follow the [[#Adding sgabios support|sgabios instructions]] below.<br />
<br />
The first step is to find the vendor and device ID of the built-in VGA adapter. This information can be found from '''lspci''':<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
01:00.0 VGA compatible controller [0300]: VIA Technologies, Inc. UniChrome Pro IGP ['''1106:3344'''] (rev 01) (prog-if 00 [VGA controller])<br />
</source><br />
<br />
In the above example, the VGA vendor/device ID is '''1106:3344'''. [[VGA support#How_to_retrieve_a_good_video_bios|Obtain the VGA ROM]] (eg, '''vgabios.bin''') and add it to the ROM with:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/vgabios.bin -n pci1106,3344.rom -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
Alternatively, SeaBIOS supports LZMA compressed option ROMs. Use the following to add a compressed option ROM instead:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/vgabios.bin > vgabios.bin.lzma<br />
$ ./build/cbfstool build/coreboot.rom add -f vgabios.bin.lzma -n pci1106,3344.rom.lzma -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
After the above is done, one can write the '''coreboot.rom''' file to flash. SeaBIOS will extract the VGA ROM and run it during boot.<br />
<br />
== Adding gpxe support ==<br />
<br />
A [[GPXE|gpxe]] option ROM can nicely complement SeaBIOS and coreboot by adding network boot support. Adding gpxe is similar to [[#Adding a VGA option ROM]]. The first step is to find the Ethernet vendor/device ID. For example:<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
00:09.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet ['''10ec:8167'''] (rev 10)<br />
</source><br />
<br />
Then one can build a gpxe option ROM. For example:<br />
<br />
<source lang="bash"><br />
$ cd /path/to/gpxe/src/<br />
$ make bin/10ec8167.rom<br />
</source><br />
<br />
And add it to the coreboot image. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/gpxe/src/bin/10ec8167.rom -n pci10ec,8167.rom -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
As with VGA option ROMs, the gpxe option ROM may be compressed with LZMA. However, compression won't significantly reduce gpxe's size as it implements its own compression.<br />
<br />
In addition to gpxe, other option ROMs can be added in the same manner.<br />
<br />
== Adding sgabios support ==<br />
<br />
An [http://code.google.com/p/sgabios/ sgabios] option ROM can forward many VGA BIOS requests and keyboard events over a serial port. One can deploy it in addition to the primary VGA BIOS or by itself.<br />
<br />
If the target machine does not have a VGA adapter, then one should install sgabios. Most bootloaders (eg, GRUB) require a VGA BIOS in order to function properly &mdash; the sgabios ROM can fill this requirement.<br />
<br />
Place the sgabios ROM file in the '''vgaroms/''' directory of CBFS. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/sgabios.bin -n vgaroms/sgabios.bin -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
When using sgabios, all the characters that SeaBIOS writes to the screen will be seen twice &mdash; once from SeaBIOS sending the character to the serial port and once from sgabios forwarding the character. To prevent the duplicates set the [[#Other Configuration items|config file]] '''etc/screen-and-debug''' to zero.<br />
<br />
== Adding a graphical "bootsplash" image ==<br />
<br />
SeaBIOS can show a custom [http://en.wikipedia.org/wiki/JPEG JPEG] image or [http://en.wikipedia.org/wiki/BMP_file_format BMP] image during bootup. To enable this, add the JPEG file to flash with the name '''bootsplash.jpg''' or BMP file as '''bootsplash.bmp'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/image.jpg -n bootsplash.jpg -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
The size of the image determines the video mode to use for showing the image. Make sure the dimensions of the image exactly correspond to an available video mode (eg, 640x480, or 1024x768), otherwise it will not be displayed.<br />
<br />
SeaBIOS will show the image during the wait for the boot menu (if the boot menu has been disabled, users will not see the image). The image should probably have "Press F12 for boot menu" embedded in it so users know they can enter the normal SeaBIOS boot menu. By default, the boot menu prompt (and thus graphical image) is shown for 2.5 seconds. This can be customized via a [[#Other Configuration items|configuration parameter]].<br />
<br />
The JPEG viewer in SeaBIOS uses a simplified decoding algorithm. It supports most common JPEGs, but does not support all possible formats. Please see the [[#Trouble reporting|Trouble reporting]] section if a valid image isn't displayed properly.<br />
<br />
== Adding payloads ==<br />
<br />
Most [[Payloads|payloads]] can also be launched from SeaBIOS. To add a payload, build the corresponding .elf file and then add it to the '''coreboot.rom''' file in the '''img/''' directory. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add-payload /path/to/payload.elf img/MyPayload l<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
During boot, one can press the '''F12''' key to get a boot menu. SeaBIOS will show all files in the '''img/''' directory, and one can instruct SeaBIOS to run them.<br />
<br />
SeaBIOS supports both uncompressed and LZMA compressed payloads.<br />
<br />
== Adding a floppy image ==<br />
<br />
It is possible to embed an image of a floppy in flash. SeaBIOS can then boot from and redirect floppy BIOS calls to the flash image. This is mainly useful for legacy software (such as DOS utilities). To use this feature, place a floppy image into the CBFS directory '''floppyimg/'''. For example:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/myfloppy.img > myfloppy.img.lzma<br />
$ ./build/cbfstool build/coreboot.rom add -f myfloppy.img.lzma -n floppyimg/MyFloppy.lzma -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
Both uncompressed and LZMA compressed images are supported. Several floppy formats are available: 360K, 1.2MB, 720K, 1.44MB, 2.88MB, 160K, 180K, 320K.<br />
<br />
The floppy image will appear as writable to the system, however all writes are discarded on reboot.<br />
<br />
When using this system, SeaBIOS reserves high-memory to store the floppy. The reserved memory is then no longer available for OS use, so this feature should only be used when needed.<br />
<br />
== Configuring boot order ==<br />
<br />
Place a file in CBFS with the name '''bootorder''' to configure the boot up order. The file should be ASCII text and contain one line per boot method. The description of each boot method follows an [https://secure.wikimedia.org/wikipedia/en/wiki/Open_firmware Open Firmware] device path format. SeaBIOS will attempt to boot from each item in the file &mdash; first line of the file first.<br />
<br />
The easiest way to find the available boot methods is to look for "Searching bootorder for" in the SeaBIOS serial output. For example, one may see lines similar to:<br />
<br />
Searching bootorder for: /pci@i0cf8/*@f/drive@1/disk@0<br />
Searching bootorder for: /pci@i0cf8/*@f,1/drive@2/disk@1<br />
Searching bootorder for: /pci@i0cf8/usb@10,4/*@2<br />
<br />
The above represents the patterns SeaBIOS will search for in the bootorder file. However, it's safe to just copy and paste the pattern into bootorder. For example, the file:<br />
<br />
/pci@i0cf8/usb@10,4/*@2<br />
/pci@i0cf8/*@f/drive@1/disk@0<br />
<br />
will instruct SeaBIOS to attempt to boot from the given USB drive first and then attempt the given ATA harddrive second.<br />
<br />
Once a file has been created, add it to CBFS with the name '''bootorder'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f mybootlist.txt -n bootorder -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
== Other Configuration items ==<br />
<br />
Additional configuration options are available in the CBFS '''etc/''' directory. For example, to set the duration of the boot menu to five and a half seconds, one would do the following:<br />
<br />
<source lang="bash"><br />
$ /path/to/seabios/tools/encodeint.py boot-menu-wait 5500<br />
$ ./build/cbfstool build/coreboot.rom add -f boot-menu-wait -n etc/boot-menu-wait -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
The SeaBIOS tool '''tools/encodeint.py''' will create a litte-endian encoded binary integer which can be placed into a CBFS file.<br />
<br />
{| border=1<br />
|+ Configuration variables<br />
|-<br />
! Filename !! Description<br />
|-<br />
| show-boot-menu || Controls the display of the boot menu. Set to 0 to disable the boot menu.<br />
|-<br />
| boot-menu-message || Customize the text boot menu message. Normally, when in text mode SeaBIOS will report the string "\nPress F12 for boot menu.\n\n". This field allows the string to be changed. (This is a string field, not an integer field; don't use encodeint.py, just place the desired string into a file and add as above.)<br />
|-<br />
| boot-menu-key || Controls which key activates the boot menu. The value stored is the DOS scan code (eg, 0x86 for F12, 0x01 for Esc). If this field is set, be sure to also customize the '''boot-menu-message''' field above.<br />
|-<br />
| boot-menu-wait || Amount of time (in milliseconds) to wait at the boot menu prompt before selecting the default boot.<br />
|-<br />
| boot-fail-wait || If no boot devices are found SeaBIOS will reboot after 60 seconds. Set this to the amount of time (in milliseconds) to customize the reboot delay or set to -1 to disable rebooting when no boot devices are found<br />
|-<br />
| extra-pci-roots || If the target machine has multiple independent root buses set this to a positive value. The SeaBIOS PCI probe will then search for the given number of extra root buses.<br />
|-<br />
| ps2-keyboard-spinup || Some laptops that emulate PS2 keyboards don't respond to keyboard commands immediately after powering on. One may specify the amount of time (in milliseconds) here to allow as additional time for the keyboard to become responsive. When this field is set, SeaBIOS will repeatedly attempt to detect the keyboard until the keyboard is found or the specified timeout is reached.<br />
|-<br />
| optionroms-checksum || Option ROMs are required to have correct checksums. However, some option ROMs in the wild don't correctly follow the specifications and have bad checksums. Set this to a zero value to allow SeaBIOS to execute them anyways.<br />
|-<br />
| s3-resume-vga-init || Set this to a non-zero value to instruct SeaBIOS to run the vga rom on an S3 resume.<br />
|-<br />
| screen-and-debug || Set this to a zero value to instruct SeaBIOS to not write characters it sends to the screen to the debug ports. This can be useful when using [[#Adding sgabios support|sgabios]].<br />
|-<br />
| floppy0 || Set this to the type of the first floppy drive in the system (only type 4 for 3.5 inch drives is supported).<br />
|-<br />
| floppy1 || The type of the second floppy drive in the system. See the description of '''floppy0''' for more info.<br />
|}<br />
<br />
= Trouble reporting =<br />
<br />
If you are experiencing problems with SeaBIOS, it's useful to increase the debugging level. This is done by running '''make menuconfig''' and setting '''CONFIG_DEBUG_LEVEL''' to a higher value. A debug level of 8 will show a lot of diagnostic information without flooding the serial port (levels above 8 will frequently cause too much data).<br />
<br />
To report an issue, please collect the serial boot log with SeaBIOS set to a debug level of 8 and forward the full log along with a description of the problem to the coreboot [[Mailinglist|mailing list]].</div>KevinOConnorhttps://www.coreboot.org/index.php?title=SeaBIOS&diff=12471SeaBIOS2013-12-12T20:29:21Z<p>KevinOConnor: /* coreboot */ reword</p>
<hr />
<div>[http://www.seabios.org '''SeaBIOS'''] is an open-source legacy BIOS implementation which can be used as a coreboot [[Payloads|payload]]. It implements the standard [https://secure.wikimedia.org/wikipedia/en/wiki/BIOS BIOS] calling interfaces that a typical x86 proprietary BIOS implements.<br />
<br />
This page describes using SeaBIOS with coreboot. SeaBIOS can also run natively in [[QEMU]] and [http://bochs.sourceforge.net/ bochs] &mdash; see the [http://git.linuxtogo.org/?p=kevin/seabios.git;a=blob;f=README;hb=HEAD SeaBIOS README] file for information on non-coreboot uses.<br />
<br />
= Use cases =<br />
<br />
Any software requiring 16-bit BIOS services benefits from SeaBIOS (eg, Windows and DOS). SeaBIOS also enables booting Linux out of the box (using standard boot-loaders like GRUB and Syslinux).<br />
<br />
SeaBIOS supports booting from ATA hard drives, ATAPI CDROMs, USB hard drives, USB CDROMs, payloads in flash, and from [http://en.wikipedia.org/wiki/Option_ROM Option ROMs] (eg, SCSI or network cards). SeaBIOS can initialize and use a PS/2 keyboard or USB keyboard.<br />
<br />
== Windows ==<br />
<br />
SeaBIOS has been tested with Windows XP, Windows 2008, Windows Vista (64/32 bit), Windows 7 (32 bit and 64 bit).<br />
<br />
However, Windows has a very strict ACPI interpreter, and some coreboot boards do not have a complete [[ACPI in coreboot|ACPI definition]]. As a result, some coreboot boards may fail during Windows boot (eg, it may fail with a '''STOP 0xA5''' code).<br />
<br />
Many boards do have working ACPI and are able to boot XP/Vista/Windows 7. Please check the board documentation or ask on the [[Mailinglist|mailing list]] if unsure of the status.<br />
<br />
== Linux ==<br />
<br />
SeaBIOS has been tested with GRUB, LILO, and Syslinux. Linux booting works well.<br />
<br />
== Other ==<br />
<br />
SeaBIOS has also been tested with FreeDOS, NetBSD, and OpenBSD.<br />
<br />
Because SeaBIOS implements the standard x86 BIOS interfaces, it is expected many other operating systems and boot-loaders will work.<br />
<br />
= Building =<br />
<br />
== Building via coreboot's menuconfig ==<br />
<br />
Probably the easiest way to use SeaBIOS as coreboot payload is to simply use the coreboot build process, which downloads and builds SeaBIOS as payload by default nowadays. You just have to run the following in your coreboot checkout:<br />
<br />
<source lang="bash"><br />
$ make menuconfig<br />
$ make<br />
</source><br />
<br />
Both SeaBIOS and coreboot will be built, and SeaBIOS will be added as payload to the '''coreboot.rom''' image that is being built.<br />
<br />
== Manual build ==<br />
<br />
One can download the latest version of SeaBIOS through a git repository:<br />
<br />
<source lang="bash"><br />
$ git clone git://git.seabios.org/seabios.git seabios<br />
$ cd seabios<br />
</source><br />
<br />
There's also a [http://code.coreboot.org/p/seabios/source/changes/master/ gitweb] facility to browse the latest source code online.<br />
<br />
Run '''make menuconfig''' and set the following variables:<br />
<br />
* CONFIG_COREBOOT 1<br />
* CONFIG_DEBUG_SERIAL 1<br />
<br />
Then:<br />
<br />
<source lang="bash"><br />
$ make<br />
</source><br />
<br />
The final SeaBIOS payload file is '''out/bios.bin.elf'''.<br />
<br />
== coreboot ==<br />
<br />
Configure coreboot with the following all disabled: '''CONFIG_VGA_ROM_RUN''', '''CONFIG_PCI_ROM_RUN''', '''CONFIG_ON_DEVICE_ROM_RUN'''<br />
<br />
Then configure the SeaBIOS '''out/bios.bin.elf''' file as the coreboot payload and build coreboot. The resulting '''coreboot.rom''' file will contain both SeaBIOS and coreboot, and it can be flashed to a ROM chip.<br />
<br />
= SeaBIOS and CBFS =<br />
<br />
SeaBIOS can read the coreboot flash filesystem and extract files.<br />
<br />
When SeaBIOS scans the target machine's PCI devices, it will recognize option ROMs in CBFS that have the form '''pciVVVV,DDDD.rom'''. It will also run any file in the directory '''vgaroms/''' as a VGA option ROM not specific to a device and files in '''genroms/''' as a generic option ROM not specific to a device. In the above cases, SeaBIOS will recognize files with a '''.lzma''' suffix, and automatically decompress them (eg, '''pci1106,3344.rom.lzma''' and '''vgaroms/sgabios.bin.lzma''').<br />
<br />
SeaBIOS can also load a graphical bootsplash image from '''bootsplash.jpg''' or '''bootsplash.bmp''', payloads found in the CBFS directory '''img/''', and floppy images found in the '''floppyimg/''' directory.<br />
<br />
Further, SeaBIOS can obtain configuration information from CBFS. A file '''bootorder''' determines the order of devices and methods to attempt to boot the system from. Additional configuration items may be found in the CBFS '''etc/''' directory.<br />
<br />
The examples below show some common uses of these features.<br />
<br />
== Adding a VGA option ROM ==<br />
<br />
It is frequently necessary to add a VGA option ROM to CBFS in order to use a VGA adapter that is built-in to a motherboard. Note, VGA adapters on external cards (PCI, AGP, PCIe) do not require this step as SeaBIOS will automatically extract the VGA BIOS directly from the card. For machines without a VGA adapter, please follow the [[#Adding sgabios support|sgabios instructions]] below.<br />
<br />
The first step is to find the vendor and device ID of the built-in VGA adapter. This information can be found from '''lspci''':<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
01:00.0 VGA compatible controller [0300]: VIA Technologies, Inc. UniChrome Pro IGP ['''1106:3344'''] (rev 01) (prog-if 00 [VGA controller])<br />
</source><br />
<br />
In the above example, the VGA vendor/device ID is '''1106:3344'''. [[VGA support#How_to_retrieve_a_good_video_bios|Obtain the VGA ROM]] (eg, '''vgabios.bin''') and add it to the ROM with:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/vgabios.bin -n pci1106,3344.rom -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
Alternatively, SeaBIOS supports LZMA compressed option ROMs. Use the following to add a compressed option ROM instead:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/vgabios.bin > vgabios.bin.lzma<br />
$ ./build/cbfstool build/coreboot.rom add -f vgabios.bin.lzma -n pci1106,3344.rom.lzma -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
After the above is done, one can write the '''coreboot.rom''' file to flash. SeaBIOS will extract the VGA ROM and run it during boot.<br />
<br />
== Adding gpxe support ==<br />
<br />
A [[GPXE|gpxe]] option ROM can nicely complement SeaBIOS and coreboot by adding network boot support. Adding gpxe is similar to [[#Adding a VGA option ROM]]. The first step is to find the Ethernet vendor/device ID. For example:<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
00:09.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet ['''10ec:8167'''] (rev 10)<br />
</source><br />
<br />
Then one can build a gpxe option ROM. For example:<br />
<br />
<source lang="bash"><br />
$ cd /path/to/gpxe/src/<br />
$ make bin/10ec8167.rom<br />
</source><br />
<br />
And add it to the coreboot image. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/gpxe/src/bin/10ec8167.rom -n pci10ec,8167.rom -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
As with VGA option ROMs, the gpxe option ROM may be compressed with LZMA. However, compression won't significantly reduce gpxe's size as it implements its own compression.<br />
<br />
In addition to gpxe, other option ROMs can be added in the same manner.<br />
<br />
== Adding sgabios support ==<br />
<br />
An [http://code.google.com/p/sgabios/ sgabios] option ROM can forward many VGA BIOS requests and keyboard events over a serial port. One can deploy it in addition to the primary VGA BIOS or by itself.<br />
<br />
If the target machine does not have a VGA adapter, then one should install sgabios. Most bootloaders (eg, GRUB) require a VGA BIOS in order to function properly &mdash; the sgabios ROM can fill this requirement.<br />
<br />
Place the sgabios ROM file in the '''vgaroms/''' directory of CBFS. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/sgabios.bin -n vgaroms/sgabios.bin -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
When using sgabios, all the characters that SeaBIOS writes to the screen will be seen twice &mdash; once from SeaBIOS sending the character to the serial port and once from sgabios forwarding the character. To prevent the duplicates set the [[#Other Configuration items|config file]] '''etc/screen-and-debug''' to zero.<br />
<br />
== Adding a graphical "bootsplash" image ==<br />
<br />
SeaBIOS can show a custom [http://en.wikipedia.org/wiki/JPEG JPEG] image or [http://en.wikipedia.org/wiki/BMP_file_format BMP] image during bootup. To enable this, add the JPEG file to flash with the name '''bootsplash.jpg''' or BMP file as '''bootsplash.bmp'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/image.jpg -n bootsplash.jpg -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
The size of the image determines the video mode to use for showing the image. Make sure the dimensions of the image exactly correspond to an available video mode (eg, 640x480, or 1024x768), otherwise it will not be displayed.<br />
<br />
SeaBIOS will show the image during the wait for the boot menu (if the boot menu has been disabled, users will not see the image). The image should probably have "Press F12 for boot menu" embedded in it so users know they can enter the normal SeaBIOS boot menu. By default, the boot menu prompt (and thus graphical image) is shown for 2.5 seconds. This can be customized via a [[#Other Configuration items|configuration parameter]].<br />
<br />
The JPEG viewer in SeaBIOS uses a simplified decoding algorithm. It supports most common JPEGs, but does not support all possible formats. Please see the [[#Trouble reporting|Trouble reporting]] section if a valid image isn't displayed properly.<br />
<br />
== Adding payloads ==<br />
<br />
Most [[Payloads|payloads]] can also be launched from SeaBIOS. To add a payload, build the corresponding .elf file and then add it to the '''coreboot.rom''' file in the '''img/''' directory. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add-payload /path/to/payload.elf img/MyPayload l<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
During boot, one can press the '''F12''' key to get a boot menu. SeaBIOS will show all files in the '''img/''' directory, and one can instruct SeaBIOS to run them.<br />
<br />
SeaBIOS supports both uncompressed and LZMA compressed payloads.<br />
<br />
== Adding a floppy image ==<br />
<br />
It is possible to embed an image of a floppy in flash. SeaBIOS can then boot from and redirect floppy BIOS calls to the flash image. This is mainly useful for legacy software (such as DOS utilities). To use this feature, place a floppy image into the CBFS directory '''floppyimg/'''. For example:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/myfloppy.img > myfloppy.img.lzma<br />
$ ./build/cbfstool build/coreboot.rom add -f myfloppy.img.lzma -n floppyimg/MyFloppy.lzma -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
Both uncompressed and LZMA compressed images are supported. Several floppy formats are available: 360K, 1.2MB, 720K, 1.44MB, 2.88MB, 160K, 180K, 320K.<br />
<br />
The floppy image will appear as writable to the system, however all writes are discarded on reboot.<br />
<br />
When using this system, SeaBIOS reserves high-memory to store the floppy. The reserved memory is then no longer available for OS use, so this feature should only be used when needed.<br />
<br />
== Configuring boot order ==<br />
<br />
Place a file in CBFS with the name '''bootorder''' to configure the boot up order. The file should be ASCII text and contain one line per boot method. The description of each boot method follows an [https://secure.wikimedia.org/wikipedia/en/wiki/Open_firmware Open Firmware] device path format. SeaBIOS will attempt to boot from each item in the file &mdash; first line of the file first.<br />
<br />
The easiest way to find the available boot methods is to look for "Searching bootorder for" in the SeaBIOS serial output. For example, one may see lines similar to:<br />
<br />
Searching bootorder for: /pci@i0cf8/*@f/drive@1/disk@0<br />
Searching bootorder for: /pci@i0cf8/*@f,1/drive@2/disk@1<br />
Searching bootorder for: /pci@i0cf8/usb@10,4/*@2<br />
<br />
The above represents the patterns SeaBIOS will search for in the bootorder file. However, it's safe to just copy and paste the pattern into bootorder. For example, the file:<br />
<br />
/pci@i0cf8/usb@10,4/*@2<br />
/pci@i0cf8/*@f/drive@1/disk@0<br />
<br />
will instruct SeaBIOS to attempt to boot from the given USB drive first and then attempt the given ATA harddrive second.<br />
<br />
Once a file has been created, add it to CBFS with the name '''bootorder'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f mybootlist.txt -n bootorder -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
== Other Configuration items ==<br />
<br />
Additional configuration options are available in the CBFS '''etc/''' directory. For example, to set the duration of the boot menu to five and a half seconds, one would do the following:<br />
<br />
<source lang="bash"><br />
$ /path/to/seabios/tools/encodeint.py boot-menu-wait 5500<br />
$ ./build/cbfstool build/coreboot.rom add -f boot-menu-wait -n etc/boot-menu-wait -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
The SeaBIOS tool '''tools/encodeint.py''' will create a litte-endian encoded binary integer which can be placed into a CBFS file.<br />
<br />
{| border=1<br />
|+ Configuration variables<br />
|-<br />
! Filename !! Description<br />
|-<br />
| show-boot-menu || Controls the display of the boot menu. Set to 0 to disable the boot menu.<br />
|-<br />
| boot-menu-message || Customize the text boot menu message. Normally, when in text mode SeaBIOS will report the string "\nPress F12 for boot menu.\n\n". This field allows the string to be changed. (This is a string field, not an integer field; don't use encodeint.py, just place the desired string into a file and add as above.) This feature is only available in SeaBIOS git revisions after 20130901.<br />
|-<br />
| boot-menu-key || Controls which key activates the boot menu. The value stored is the DOS scan code (eg, 0x86 for F12, 0x01 for Esc). If this field is set, be sure to also customize the boot-menu-message field above. This feature is only available in SeaBIOS git revisions after 20130901.<br />
|-<br />
| boot-menu-wait || Amount of time (in milliseconds) to wait at the boot menu prompt before selecting the default boot.<br />
|-<br />
| boot-fail-wait || If no boot devices are found SeaBIOS will reboot after 60 seconds. Set this to the amount of time (in milliseconds) to customize the reboot delay or set to -1 to disable rebooting when no boot devices are found<br />
|-<br />
| extra-pci-roots || If the target machine has multiple independent root buses set this to a positive value. The SeaBIOS PCI probe will then search for the given number of extra root buses.<br />
|-<br />
| ps2-keyboard-spinup || Some laptops that emulate PS2 keyboards don't respond to keyboard commands immediately after powering on. One may specify the amount of time (in milliseconds) here to allow as additional time for the keyboard to become responsive. When this field is set, SeaBIOS will repeatedly attempt to detect the keyboard until the keyboard is found or the specified timeout is reached.<br />
|-<br />
| optionroms-checksum || Option ROMs are required to have correct checksums. However, some option ROMs in the wild don't correctly follow the specifications and have bad checksums. Set this to a zero value to allow SeaBIOS to execute them anyways.<br />
|-<br />
| s3-resume-vga-init || Set this to a non-zero value to instruct SeaBIOS to run the vga rom on an S3 resume.<br />
|-<br />
| screen-and-debug || Set this to a zero value to instruct SeaBIOS to not write characters it sends to the screen to the debug ports. This can be useful when using [[#Adding sgabios support|sgabios]].<br />
|-<br />
| floppy0 || Set this to the type of the first floppy drive in the system (only type 4 for 3.5 inch drives is supported). The floppy driver has not been tested on real-hardware; please report any success or failures to the seabios mailing list.<br />
|-<br />
| floppy1 || The type of the second floppy drive in the system. See the description of '''floppy0''' for more info.<br />
|}<br />
<br />
= Trouble reporting =<br />
<br />
If you are experiencing problems with SeaBIOS, it's useful to increase the debugging level. This is done by running '''make menuconfig''' and setting '''CONFIG_DEBUG_LEVEL''' to a higher value. A debug level of 8 will show a lot of diagnostic information without flooding the serial port (levels above 8 will frequently cause too much data).<br />
<br />
To report an issue, please collect the serial boot log with SeaBIOS set to a debug level of 8 and forward the full log along with a description of the problem to the coreboot [[Mailinglist|mailing list]].</div>KevinOConnorhttps://www.coreboot.org/index.php?title=SeaBIOS&diff=12470SeaBIOS2013-12-12T19:48:24Z<p>KevinOConnor: /* coreboot */ Update for recent coreboot config settings.</p>
<hr />
<div>[http://www.seabios.org '''SeaBIOS'''] is an open-source legacy BIOS implementation which can be used as a coreboot [[Payloads|payload]]. It implements the standard [https://secure.wikimedia.org/wikipedia/en/wiki/BIOS BIOS] calling interfaces that a typical x86 proprietary BIOS implements.<br />
<br />
This page describes using SeaBIOS with coreboot. SeaBIOS can also run natively in [[QEMU]] and [http://bochs.sourceforge.net/ bochs] &mdash; see the [http://git.linuxtogo.org/?p=kevin/seabios.git;a=blob;f=README;hb=HEAD SeaBIOS README] file for information on non-coreboot uses.<br />
<br />
= Use cases =<br />
<br />
Any software requiring 16-bit BIOS services benefits from SeaBIOS (eg, Windows and DOS). SeaBIOS also enables booting Linux out of the box (using standard boot-loaders like GRUB and Syslinux).<br />
<br />
SeaBIOS supports booting from ATA hard drives, ATAPI CDROMs, USB hard drives, USB CDROMs, payloads in flash, and from [http://en.wikipedia.org/wiki/Option_ROM Option ROMs] (eg, SCSI or network cards). SeaBIOS can initialize and use a PS/2 keyboard or USB keyboard.<br />
<br />
== Windows ==<br />
<br />
SeaBIOS has been tested with Windows XP, Windows 2008, Windows Vista (64/32 bit), Windows 7 (32 bit and 64 bit).<br />
<br />
However, Windows has a very strict ACPI interpreter, and some coreboot boards do not have a complete [[ACPI in coreboot|ACPI definition]]. As a result, some coreboot boards may fail during Windows boot (eg, it may fail with a '''STOP 0xA5''' code).<br />
<br />
Many boards do have working ACPI and are able to boot XP/Vista/Windows 7. Please check the board documentation or ask on the [[Mailinglist|mailing list]] if unsure of the status.<br />
<br />
== Linux ==<br />
<br />
SeaBIOS has been tested with GRUB, LILO, and Syslinux. Linux booting works well.<br />
<br />
== Other ==<br />
<br />
SeaBIOS has also been tested with FreeDOS, NetBSD, and OpenBSD.<br />
<br />
Because SeaBIOS implements the standard x86 BIOS interfaces, it is expected many other operating systems and boot-loaders will work.<br />
<br />
= Building =<br />
<br />
== Building via coreboot's menuconfig ==<br />
<br />
Probably the easiest way to use SeaBIOS as coreboot payload is to simply use the coreboot build process, which downloads and builds SeaBIOS as payload by default nowadays. You just have to run the following in your coreboot checkout:<br />
<br />
<source lang="bash"><br />
$ make menuconfig<br />
$ make<br />
</source><br />
<br />
Both SeaBIOS and coreboot will be built, and SeaBIOS will be added as payload to the '''coreboot.rom''' image that is being built.<br />
<br />
== Manual build ==<br />
<br />
One can download the latest version of SeaBIOS through a git repository:<br />
<br />
<source lang="bash"><br />
$ git clone git://git.seabios.org/seabios.git seabios<br />
$ cd seabios<br />
</source><br />
<br />
There's also a [http://code.coreboot.org/p/seabios/source/changes/master/ gitweb] facility to browse the latest source code online.<br />
<br />
Run '''make menuconfig''' and set the following variables:<br />
<br />
* CONFIG_COREBOOT 1<br />
* CONFIG_DEBUG_SERIAL 1<br />
<br />
Then:<br />
<br />
<source lang="bash"><br />
$ make<br />
</source><br />
<br />
The final SeaBIOS payload file is '''out/bios.bin.elf'''.<br />
<br />
== coreboot ==<br />
<br />
Configure coreboot with '''CONFIG_VGA_ROM_RUN''', '''CONFIG_PCI_ROM_RUN''', and '''CONFIG_ON_DEVICE_ROM_RUN''' all disabled.<br />
<br />
Finally, configure the SeaBIOS '''out/bios.bin.elf''' file as the coreboot payload and build coreboot. The resulting '''coreboot.rom''' file will contain both SeaBIOS and coreboot, and it can be flashed to a ROM chip.<br />
<br />
= SeaBIOS and CBFS =<br />
<br />
SeaBIOS can read the coreboot flash filesystem and extract files.<br />
<br />
When SeaBIOS scans the target machine's PCI devices, it will recognize option ROMs in CBFS that have the form '''pciVVVV,DDDD.rom'''. It will also run any file in the directory '''vgaroms/''' as a VGA option ROM not specific to a device and files in '''genroms/''' as a generic option ROM not specific to a device. In the above cases, SeaBIOS will recognize files with a '''.lzma''' suffix, and automatically decompress them (eg, '''pci1106,3344.rom.lzma''' and '''vgaroms/sgabios.bin.lzma''').<br />
<br />
SeaBIOS can also load a graphical bootsplash image from '''bootsplash.jpg''' or '''bootsplash.bmp''', payloads found in the CBFS directory '''img/''', and floppy images found in the '''floppyimg/''' directory.<br />
<br />
Further, SeaBIOS can obtain configuration information from CBFS. A file '''bootorder''' determines the order of devices and methods to attempt to boot the system from. Additional configuration items may be found in the CBFS '''etc/''' directory.<br />
<br />
The examples below show some common uses of these features.<br />
<br />
== Adding a VGA option ROM ==<br />
<br />
It is frequently necessary to add a VGA option ROM to CBFS in order to use a VGA adapter that is built-in to a motherboard. Note, VGA adapters on external cards (PCI, AGP, PCIe) do not require this step as SeaBIOS will automatically extract the VGA BIOS directly from the card. For machines without a VGA adapter, please follow the [[#Adding sgabios support|sgabios instructions]] below.<br />
<br />
The first step is to find the vendor and device ID of the built-in VGA adapter. This information can be found from '''lspci''':<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
01:00.0 VGA compatible controller [0300]: VIA Technologies, Inc. UniChrome Pro IGP ['''1106:3344'''] (rev 01) (prog-if 00 [VGA controller])<br />
</source><br />
<br />
In the above example, the VGA vendor/device ID is '''1106:3344'''. [[VGA support#How_to_retrieve_a_good_video_bios|Obtain the VGA ROM]] (eg, '''vgabios.bin''') and add it to the ROM with:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/vgabios.bin -n pci1106,3344.rom -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
Alternatively, SeaBIOS supports LZMA compressed option ROMs. Use the following to add a compressed option ROM instead:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/vgabios.bin > vgabios.bin.lzma<br />
$ ./build/cbfstool build/coreboot.rom add -f vgabios.bin.lzma -n pci1106,3344.rom.lzma -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
After the above is done, one can write the '''coreboot.rom''' file to flash. SeaBIOS will extract the VGA ROM and run it during boot.<br />
<br />
== Adding gpxe support ==<br />
<br />
A [[GPXE|gpxe]] option ROM can nicely complement SeaBIOS and coreboot by adding network boot support. Adding gpxe is similar to [[#Adding a VGA option ROM]]. The first step is to find the Ethernet vendor/device ID. For example:<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
00:09.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet ['''10ec:8167'''] (rev 10)<br />
</source><br />
<br />
Then one can build a gpxe option ROM. For example:<br />
<br />
<source lang="bash"><br />
$ cd /path/to/gpxe/src/<br />
$ make bin/10ec8167.rom<br />
</source><br />
<br />
And add it to the coreboot image. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/gpxe/src/bin/10ec8167.rom -n pci10ec,8167.rom -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
As with VGA option ROMs, the gpxe option ROM may be compressed with LZMA. However, compression won't significantly reduce gpxe's size as it implements its own compression.<br />
<br />
In addition to gpxe, other option ROMs can be added in the same manner.<br />
<br />
== Adding sgabios support ==<br />
<br />
An [http://code.google.com/p/sgabios/ sgabios] option ROM can forward many VGA BIOS requests and keyboard events over a serial port. One can deploy it in addition to the primary VGA BIOS or by itself.<br />
<br />
If the target machine does not have a VGA adapter, then one should install sgabios. Most bootloaders (eg, GRUB) require a VGA BIOS in order to function properly &mdash; the sgabios ROM can fill this requirement.<br />
<br />
Place the sgabios ROM file in the '''vgaroms/''' directory of CBFS. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/sgabios.bin -n vgaroms/sgabios.bin -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
When using sgabios, all the characters that SeaBIOS writes to the screen will be seen twice &mdash; once from SeaBIOS sending the character to the serial port and once from sgabios forwarding the character. To prevent the duplicates set the [[#Other Configuration items|config file]] '''etc/screen-and-debug''' to zero.<br />
<br />
== Adding a graphical "bootsplash" image ==<br />
<br />
SeaBIOS can show a custom [http://en.wikipedia.org/wiki/JPEG JPEG] image or [http://en.wikipedia.org/wiki/BMP_file_format BMP] image during bootup. To enable this, add the JPEG file to flash with the name '''bootsplash.jpg''' or BMP file as '''bootsplash.bmp'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/image.jpg -n bootsplash.jpg -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
The size of the image determines the video mode to use for showing the image. Make sure the dimensions of the image exactly correspond to an available video mode (eg, 640x480, or 1024x768), otherwise it will not be displayed.<br />
<br />
SeaBIOS will show the image during the wait for the boot menu (if the boot menu has been disabled, users will not see the image). The image should probably have "Press F12 for boot menu" embedded in it so users know they can enter the normal SeaBIOS boot menu. By default, the boot menu prompt (and thus graphical image) is shown for 2.5 seconds. This can be customized via a [[#Other Configuration items|configuration parameter]].<br />
<br />
The JPEG viewer in SeaBIOS uses a simplified decoding algorithm. It supports most common JPEGs, but does not support all possible formats. Please see the [[#Trouble reporting|Trouble reporting]] section if a valid image isn't displayed properly.<br />
<br />
== Adding payloads ==<br />
<br />
Most [[Payloads|payloads]] can also be launched from SeaBIOS. To add a payload, build the corresponding .elf file and then add it to the '''coreboot.rom''' file in the '''img/''' directory. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add-payload /path/to/payload.elf img/MyPayload l<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
During boot, one can press the '''F12''' key to get a boot menu. SeaBIOS will show all files in the '''img/''' directory, and one can instruct SeaBIOS to run them.<br />
<br />
SeaBIOS supports both uncompressed and LZMA compressed payloads.<br />
<br />
== Adding a floppy image ==<br />
<br />
It is possible to embed an image of a floppy in flash. SeaBIOS can then boot from and redirect floppy BIOS calls to the flash image. This is mainly useful for legacy software (such as DOS utilities). To use this feature, place a floppy image into the CBFS directory '''floppyimg/'''. For example:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/myfloppy.img > myfloppy.img.lzma<br />
$ ./build/cbfstool build/coreboot.rom add -f myfloppy.img.lzma -n floppyimg/MyFloppy.lzma -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
Both uncompressed and LZMA compressed images are supported. Several floppy formats are available: 360K, 1.2MB, 720K, 1.44MB, 2.88MB, 160K, 180K, 320K.<br />
<br />
The floppy image will appear as writable to the system, however all writes are discarded on reboot.<br />
<br />
When using this system, SeaBIOS reserves high-memory to store the floppy. The reserved memory is then no longer available for OS use, so this feature should only be used when needed.<br />
<br />
== Configuring boot order ==<br />
<br />
Place a file in CBFS with the name '''bootorder''' to configure the boot up order. The file should be ASCII text and contain one line per boot method. The description of each boot method follows an [https://secure.wikimedia.org/wikipedia/en/wiki/Open_firmware Open Firmware] device path format. SeaBIOS will attempt to boot from each item in the file &mdash; first line of the file first.<br />
<br />
The easiest way to find the available boot methods is to look for "Searching bootorder for" in the SeaBIOS serial output. For example, one may see lines similar to:<br />
<br />
Searching bootorder for: /pci@i0cf8/*@f/drive@1/disk@0<br />
Searching bootorder for: /pci@i0cf8/*@f,1/drive@2/disk@1<br />
Searching bootorder for: /pci@i0cf8/usb@10,4/*@2<br />
<br />
The above represents the patterns SeaBIOS will search for in the bootorder file. However, it's safe to just copy and paste the pattern into bootorder. For example, the file:<br />
<br />
/pci@i0cf8/usb@10,4/*@2<br />
/pci@i0cf8/*@f/drive@1/disk@0<br />
<br />
will instruct SeaBIOS to attempt to boot from the given USB drive first and then attempt the given ATA harddrive second.<br />
<br />
Once a file has been created, add it to CBFS with the name '''bootorder'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f mybootlist.txt -n bootorder -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
== Other Configuration items ==<br />
<br />
Additional configuration options are available in the CBFS '''etc/''' directory. For example, to set the duration of the boot menu to five and a half seconds, one would do the following:<br />
<br />
<source lang="bash"><br />
$ /path/to/seabios/tools/encodeint.py boot-menu-wait 5500<br />
$ ./build/cbfstool build/coreboot.rom add -f boot-menu-wait -n etc/boot-menu-wait -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
The SeaBIOS tool '''tools/encodeint.py''' will create a litte-endian encoded binary integer which can be placed into a CBFS file.<br />
<br />
{| border=1<br />
|+ Configuration variables<br />
|-<br />
! Filename !! Description<br />
|-<br />
| show-boot-menu || Controls the display of the boot menu. Set to 0 to disable the boot menu.<br />
|-<br />
| boot-menu-message || Customize the text boot menu message. Normally, when in text mode SeaBIOS will report the string "\nPress F12 for boot menu.\n\n". This field allows the string to be changed. (This is a string field, not an integer field; don't use encodeint.py, just place the desired string into a file and add as above.) This feature is only available in SeaBIOS git revisions after 20130901.<br />
|-<br />
| boot-menu-key || Controls which key activates the boot menu. The value stored is the DOS scan code (eg, 0x86 for F12, 0x01 for Esc). If this field is set, be sure to also customize the boot-menu-message field above. This feature is only available in SeaBIOS git revisions after 20130901.<br />
|-<br />
| boot-menu-wait || Amount of time (in milliseconds) to wait at the boot menu prompt before selecting the default boot.<br />
|-<br />
| boot-fail-wait || If no boot devices are found SeaBIOS will reboot after 60 seconds. Set this to the amount of time (in milliseconds) to customize the reboot delay or set to -1 to disable rebooting when no boot devices are found<br />
|-<br />
| extra-pci-roots || If the target machine has multiple independent root buses set this to a positive value. The SeaBIOS PCI probe will then search for the given number of extra root buses.<br />
|-<br />
| ps2-keyboard-spinup || Some laptops that emulate PS2 keyboards don't respond to keyboard commands immediately after powering on. One may specify the amount of time (in milliseconds) here to allow as additional time for the keyboard to become responsive. When this field is set, SeaBIOS will repeatedly attempt to detect the keyboard until the keyboard is found or the specified timeout is reached.<br />
|-<br />
| optionroms-checksum || Option ROMs are required to have correct checksums. However, some option ROMs in the wild don't correctly follow the specifications and have bad checksums. Set this to a zero value to allow SeaBIOS to execute them anyways.<br />
|-<br />
| s3-resume-vga-init || Set this to a non-zero value to instruct SeaBIOS to run the vga rom on an S3 resume.<br />
|-<br />
| screen-and-debug || Set this to a zero value to instruct SeaBIOS to not write characters it sends to the screen to the debug ports. This can be useful when using [[#Adding sgabios support|sgabios]].<br />
|-<br />
| floppy0 || Set this to the type of the first floppy drive in the system (only type 4 for 3.5 inch drives is supported). The floppy driver has not been tested on real-hardware; please report any success or failures to the seabios mailing list.<br />
|-<br />
| floppy1 || The type of the second floppy drive in the system. See the description of '''floppy0''' for more info.<br />
|}<br />
<br />
= Trouble reporting =<br />
<br />
If you are experiencing problems with SeaBIOS, it's useful to increase the debugging level. This is done by running '''make menuconfig''' and setting '''CONFIG_DEBUG_LEVEL''' to a higher value. A debug level of 8 will show a lot of diagnostic information without flooding the serial port (levels above 8 will frequently cause too much data).<br />
<br />
To report an issue, please collect the serial boot log with SeaBIOS set to a debug level of 8 and forward the full log along with a description of the problem to the coreboot [[Mailinglist|mailing list]].</div>KevinOConnorhttps://www.coreboot.org/index.php?title=SeaBIOS&diff=12293SeaBIOS2013-12-04T16:29:14Z<p>KevinOConnor: /* Other Configuration items */ Updates to possible config settings.</p>
<hr />
<div>[http://www.seabios.org '''SeaBIOS'''] is an open-source legacy BIOS implementation which can be used as a coreboot [[Payloads|payload]]. It implements the standard [https://secure.wikimedia.org/wikipedia/en/wiki/BIOS BIOS] calling interfaces that a typical x86 proprietary BIOS implements.<br />
<br />
This page describes using SeaBIOS with coreboot. SeaBIOS can also run natively in [[QEMU]] and [http://bochs.sourceforge.net/ bochs] &mdash; see the [http://git.linuxtogo.org/?p=kevin/seabios.git;a=blob;f=README;hb=HEAD SeaBIOS README] file for information on non-coreboot uses.<br />
<br />
= Use cases =<br />
<br />
Any software requiring 16-bit BIOS services benefits from SeaBIOS (eg, Windows and DOS). SeaBIOS also enables booting Linux out of the box (using standard boot-loaders like GRUB and Syslinux).<br />
<br />
SeaBIOS supports booting from ATA hard drives, ATAPI CDROMs, USB hard drives, USB CDROMs, payloads in flash, and from [http://en.wikipedia.org/wiki/Option_ROM Option ROMs] (eg, SCSI or network cards). SeaBIOS can initialize and use a PS/2 keyboard or USB keyboard.<br />
<br />
== Windows ==<br />
<br />
SeaBIOS has been tested with Windows XP, Windows 2008, Windows Vista (64/32 bit), Windows 7 (32 bit and 64 bit).<br />
<br />
However, Windows has a very strict ACPI interpreter, and some coreboot boards do not have a complete [[ACPI in coreboot|ACPI definition]]. As a result, some coreboot boards may fail during Windows boot (eg, it may fail with a '''STOP 0xA5''' code).<br />
<br />
Many boards do have working ACPI and are able to boot XP/Vista/Windows 7. Please check the board documentation or ask on the [[Mailinglist|mailing list]] if unsure of the status.<br />
<br />
== Linux ==<br />
<br />
SeaBIOS has been tested with GRUB, LILO, and Syslinux. Linux booting works well.<br />
<br />
== Other ==<br />
<br />
SeaBIOS has also been tested with FreeDOS, NetBSD, and OpenBSD.<br />
<br />
Because SeaBIOS implements the standard x86 BIOS interfaces, it is expected many other operating systems and boot-loaders will work.<br />
<br />
= Building =<br />
<br />
== Building via coreboot's menuconfig ==<br />
<br />
Probably the easiest way to use SeaBIOS as coreboot payload is to simply use the coreboot build process, which downloads and builds SeaBIOS as payload by default nowadays. You just have to run the following in your coreboot checkout:<br />
<br />
<source lang="bash"><br />
$ make menuconfig<br />
$ make<br />
</source><br />
<br />
Both SeaBIOS and coreboot will be built, and SeaBIOS will be added as payload to the '''coreboot.rom''' image that is being built.<br />
<br />
== Manual build ==<br />
<br />
One can download the latest version of SeaBIOS through a git repository:<br />
<br />
<source lang="bash"><br />
$ git clone git://git.seabios.org/seabios.git seabios<br />
$ cd seabios<br />
</source><br />
<br />
There's also a [http://code.coreboot.org/p/seabios/source/changes/master/ gitweb] facility to browse the latest source code online.<br />
<br />
Run '''make menuconfig''' and set the following variables:<br />
<br />
* CONFIG_COREBOOT 1<br />
* CONFIG_DEBUG_SERIAL 1<br />
<br />
Then:<br />
<br />
<source lang="bash"><br />
$ make<br />
</source><br />
<br />
The final SeaBIOS payload file is '''out/bios.bin.elf'''.<br />
<br />
== coreboot ==<br />
<br />
For best results, configure coreboot with '''CONFIG_WRITE_HIGH_TABLES''' and '''CONFIG_VGA_BRIDGE_SETUP''' both enabled, and '''CONFIG_VGA_ROM_RUN''' and '''CONFIG_PCI_ROM_RUN''' both disabled.<br />
<br />
Finally, configure the SeaBIOS '''out/bios.bin.elf''' file as the coreboot payload and build coreboot. The resulting '''coreboot.rom''' file will contain both SeaBIOS and coreboot, and it can be flashed to a ROM chip.<br />
<br />
= SeaBIOS and CBFS =<br />
<br />
SeaBIOS can read the coreboot flash filesystem and extract files.<br />
<br />
When SeaBIOS scans the target machine's PCI devices, it will recognize option ROMs in CBFS that have the form '''pciVVVV,DDDD.rom'''. It will also run any file in the directory '''vgaroms/''' as a VGA option ROM not specific to a device and files in '''genroms/''' as a generic option ROM not specific to a device. In the above cases, SeaBIOS will recognize files with a '''.lzma''' suffix, and automatically decompress them (eg, '''pci1106,3344.rom.lzma''' and '''vgaroms/sgabios.bin.lzma''').<br />
<br />
SeaBIOS can also load a graphical bootsplash image from '''bootsplash.jpg''' or '''bootsplash.bmp''', payloads found in the CBFS directory '''img/''', and floppy images found in the '''floppyimg/''' directory.<br />
<br />
Further, SeaBIOS can obtain configuration information from CBFS. A file '''bootorder''' determines the order of devices and methods to attempt to boot the system from. Additional configuration items may be found in the CBFS '''etc/''' directory.<br />
<br />
The examples below show some common uses of these features.<br />
<br />
== Adding a VGA option ROM ==<br />
<br />
It is frequently necessary to add a VGA option ROM to CBFS in order to use a VGA adapter that is built-in to a motherboard. Note, VGA adapters on external cards (PCI, AGP, PCIe) do not require this step as SeaBIOS will automatically extract the VGA BIOS directly from the card. For machines without a VGA adapter, please follow the [[#Adding sgabios support|sgabios instructions]] below.<br />
<br />
The first step is to find the vendor and device ID of the built-in VGA adapter. This information can be found from '''lspci''':<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
01:00.0 VGA compatible controller [0300]: VIA Technologies, Inc. UniChrome Pro IGP ['''1106:3344'''] (rev 01) (prog-if 00 [VGA controller])<br />
</source><br />
<br />
In the above example, the VGA vendor/device ID is '''1106:3344'''. [[VGA support#How_to_retrieve_a_good_video_bios|Obtain the VGA ROM]] (eg, '''vgabios.bin''') and add it to the ROM with:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/vgabios.bin -n pci1106,3344.rom -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
Alternatively, SeaBIOS supports LZMA compressed option ROMs. Use the following to add a compressed option ROM instead:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/vgabios.bin > vgabios.bin.lzma<br />
$ ./build/cbfstool build/coreboot.rom add -f vgabios.bin.lzma -n pci1106,3344.rom.lzma -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
After the above is done, one can write the '''coreboot.rom''' file to flash. SeaBIOS will extract the VGA ROM and run it during boot.<br />
<br />
== Adding gpxe support ==<br />
<br />
A [[GPXE|gpxe]] option ROM can nicely complement SeaBIOS and coreboot by adding network boot support. Adding gpxe is similar to [[#Adding a VGA option ROM]]. The first step is to find the Ethernet vendor/device ID. For example:<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
00:09.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet ['''10ec:8167'''] (rev 10)<br />
</source><br />
<br />
Then one can build a gpxe option ROM. For example:<br />
<br />
<source lang="bash"><br />
$ cd /path/to/gpxe/src/<br />
$ make bin/10ec8167.rom<br />
</source><br />
<br />
And add it to the coreboot image. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/gpxe/src/bin/10ec8167.rom -n pci10ec,8167.rom -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
As with VGA option ROMs, the gpxe option ROM may be compressed with LZMA. However, compression won't significantly reduce gpxe's size as it implements its own compression.<br />
<br />
In addition to gpxe, other option ROMs can be added in the same manner.<br />
<br />
== Adding sgabios support ==<br />
<br />
An [http://code.google.com/p/sgabios/ sgabios] option ROM can forward many VGA BIOS requests and keyboard events over a serial port. One can deploy it in addition to the primary VGA BIOS or by itself.<br />
<br />
If the target machine does not have a VGA adapter, then one should install sgabios. Most bootloaders (eg, GRUB) require a VGA BIOS in order to function properly &mdash; the sgabios ROM can fill this requirement.<br />
<br />
Place the sgabios ROM file in the '''vgaroms/''' directory of CBFS. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/sgabios.bin -n vgaroms/sgabios.bin -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
When using sgabios, all the characters that SeaBIOS writes to the screen will be seen twice &mdash; once from SeaBIOS sending the character to the serial port and once from sgabios forwarding the character. To prevent the duplicates set the [[#Other Configuration items|config file]] '''etc/screen-and-debug''' to zero.<br />
<br />
== Adding a graphical "bootsplash" image ==<br />
<br />
SeaBIOS can show a custom [http://en.wikipedia.org/wiki/JPEG JPEG] image or [http://en.wikipedia.org/wiki/BMP_file_format BMP] image during bootup. To enable this, add the JPEG file to flash with the name '''bootsplash.jpg''' or BMP file as '''bootsplash.bmp'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/image.jpg -n bootsplash.jpg -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
The size of the image determines the video mode to use for showing the image. Make sure the dimensions of the image exactly correspond to an available video mode (eg, 640x480, or 1024x768), otherwise it will not be displayed.<br />
<br />
SeaBIOS will show the image during the wait for the boot menu (if the boot menu has been disabled, users will not see the image). The image should probably have "Press F12 for boot menu" embedded in it so users know they can enter the normal SeaBIOS boot menu. By default, the boot menu prompt (and thus graphical image) is shown for 2.5 seconds. This can be customized via a [[#Other Configuration items|configuration parameter]].<br />
<br />
The JPEG viewer in SeaBIOS uses a simplified decoding algorithm. It supports most common JPEGs, but does not support all possible formats. Please see the [[#Trouble reporting|Trouble reporting]] section if a valid image isn't displayed properly.<br />
<br />
== Adding payloads ==<br />
<br />
Most [[Payloads|payloads]] can also be launched from SeaBIOS. To add a payload, build the corresponding .elf file and then add it to the '''coreboot.rom''' file in the '''img/''' directory. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add-payload /path/to/payload.elf img/MyPayload l<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
During boot, one can press the '''F12''' key to get a boot menu. SeaBIOS will show all files in the '''img/''' directory, and one can instruct SeaBIOS to run them.<br />
<br />
SeaBIOS supports both uncompressed and LZMA compressed payloads.<br />
<br />
== Adding a floppy image ==<br />
<br />
It is possible to embed an image of a floppy in flash. SeaBIOS can then boot from and redirect floppy BIOS calls to the flash image. This is mainly useful for legacy software (such as DOS utilities). To use this feature, place a floppy image into the CBFS directory '''floppyimg/'''. For example:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/myfloppy.img > myfloppy.img.lzma<br />
$ ./build/cbfstool build/coreboot.rom add -f myfloppy.img.lzma -n floppyimg/MyFloppy.lzma -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
Both uncompressed and LZMA compressed images are supported. Several floppy formats are available: 360K, 1.2MB, 720K, 1.44MB, 2.88MB, 160K, 180K, 320K.<br />
<br />
The floppy image will appear as writable to the system, however all writes are discarded on reboot.<br />
<br />
When using this system, SeaBIOS reserves high-memory to store the floppy. The reserved memory is then no longer available for OS use, so this feature should only be used when needed.<br />
<br />
== Configuring boot order ==<br />
<br />
Place a file in CBFS with the name '''bootorder''' to configure the boot up order. The file should be ASCII text and contain one line per boot method. The description of each boot method follows an [https://secure.wikimedia.org/wikipedia/en/wiki/Open_firmware Open Firmware] device path format. SeaBIOS will attempt to boot from each item in the file &mdash; first line of the file first.<br />
<br />
The easiest way to find the available boot methods is to look for "Searching bootorder for" in the SeaBIOS serial output. For example, one may see lines similar to:<br />
<br />
Searching bootorder for: /pci@i0cf8/*@f/drive@1/disk@0<br />
Searching bootorder for: /pci@i0cf8/*@f,1/drive@2/disk@1<br />
Searching bootorder for: /pci@i0cf8/usb@10,4/*@2<br />
<br />
The above represents the patterns SeaBIOS will search for in the bootorder file. However, it's safe to just copy and paste the pattern into bootorder. For example, the file:<br />
<br />
/pci@i0cf8/usb@10,4/*@2<br />
/pci@i0cf8/*@f/drive@1/disk@0<br />
<br />
will instruct SeaBIOS to attempt to boot from the given USB drive first and then attempt the given ATA harddrive second.<br />
<br />
Once a file has been created, add it to CBFS with the name '''bootorder'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f mybootlist.txt -n bootorder -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
== Other Configuration items ==<br />
<br />
Additional configuration options are available in the CBFS '''etc/''' directory. For example, to set the duration of the boot menu to five and a half seconds, one would do the following:<br />
<br />
<source lang="bash"><br />
$ /path/to/seabios/tools/encodeint.py boot-menu-wait 5500<br />
$ ./build/cbfstool build/coreboot.rom add -f boot-menu-wait -n etc/boot-menu-wait -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
The SeaBIOS tool '''tools/encodeint.py''' will create a litte-endian encoded binary integer which can be placed into a CBFS file.<br />
<br />
{| border=1<br />
|+ Configuration variables<br />
|-<br />
! Filename !! Description<br />
|-<br />
| show-boot-menu || Controls the display of the boot menu. Set to 0 to disable the boot menu.<br />
|-<br />
| boot-menu-message || Customize the text boot menu message. Normally, when in text mode SeaBIOS will report the string "\nPress F12 for boot menu.\n\n". This field allows the string to be changed. (This is a string field, not an integer field; don't use encodeint.py, just place the desired string into a file and add as above.) This feature is only available in SeaBIOS git revisions after 20130901.<br />
|-<br />
| boot-menu-key || Controls which key activates the boot menu. The value stored is the DOS scan code (eg, 0x86 for F12, 0x01 for Esc). If this field is set, be sure to also customize the boot-menu-message field above. This feature is only available in SeaBIOS git revisions after 20130901.<br />
|-<br />
| boot-menu-wait || Amount of time (in milliseconds) to wait at the boot menu prompt before selecting the default boot.<br />
|-<br />
| boot-fail-wait || If no boot devices are found SeaBIOS will reboot after 60 seconds. Set this to the amount of time (in milliseconds) to customize the reboot delay or set to -1 to disable rebooting when no boot devices are found<br />
|-<br />
| extra-pci-roots || If the target machine has multiple independent root buses set this to a positive value. The SeaBIOS PCI probe will then search for the given number of extra root buses.<br />
|-<br />
| ps2-keyboard-spinup || Some laptops that emulate PS2 keyboards don't respond to keyboard commands immediately after powering on. One may specify the amount of time (in milliseconds) here to allow as additional time for the keyboard to become responsive. When this field is set, SeaBIOS will repeatedly attempt to detect the keyboard until the keyboard is found or the specified timeout is reached.<br />
|-<br />
| optionroms-checksum || Option ROMs are required to have correct checksums. However, some option ROMs in the wild don't correctly follow the specifications and have bad checksums. Set this to a zero value to allow SeaBIOS to execute them anyways.<br />
|-<br />
| s3-resume-vga-init || Set this to a non-zero value to instruct SeaBIOS to run the vga rom on an S3 resume.<br />
|-<br />
| screen-and-debug || Set this to a zero value to instruct SeaBIOS to not write characters it sends to the screen to the debug ports. This can be useful when using [[#Adding sgabios support|sgabios]].<br />
|-<br />
| floppy0 || Set this to the type of the first floppy drive in the system (only type 4 for 3.5 inch drives is supported). The floppy driver has not been tested on real-hardware; please report any success or failures to the seabios mailing list.<br />
|-<br />
| floppy1 || The type of the second floppy drive in the system. See the description of '''floppy0''' for more info.<br />
|}<br />
<br />
= Trouble reporting =<br />
<br />
If you are experiencing problems with SeaBIOS, it's useful to increase the debugging level. This is done by running '''make menuconfig''' and setting '''CONFIG_DEBUG_LEVEL''' to a higher value. A debug level of 8 will show a lot of diagnostic information without flooding the serial port (levels above 8 will frequently cause too much data).<br />
<br />
To report an issue, please collect the serial boot log with SeaBIOS set to a debug level of 8 and forward the full log along with a description of the problem to the coreboot [[Mailinglist|mailing list]].</div>KevinOConnorhttps://www.coreboot.org/index.php?title=SeaBIOS&diff=12292SeaBIOS2013-12-04T15:49:17Z<p>KevinOConnor: /* Windows */ Update text - many boards do have Windows compatible ACPI now.</p>
<hr />
<div>[http://www.seabios.org '''SeaBIOS'''] is an open-source legacy BIOS implementation which can be used as a coreboot [[Payloads|payload]]. It implements the standard [https://secure.wikimedia.org/wikipedia/en/wiki/BIOS BIOS] calling interfaces that a typical x86 proprietary BIOS implements.<br />
<br />
This page describes using SeaBIOS with coreboot. SeaBIOS can also run natively in [[QEMU]] and [http://bochs.sourceforge.net/ bochs] &mdash; see the [http://git.linuxtogo.org/?p=kevin/seabios.git;a=blob;f=README;hb=HEAD SeaBIOS README] file for information on non-coreboot uses.<br />
<br />
= Use cases =<br />
<br />
Any software requiring 16-bit BIOS services benefits from SeaBIOS (eg, Windows and DOS). SeaBIOS also enables booting Linux out of the box (using standard boot-loaders like GRUB and Syslinux).<br />
<br />
SeaBIOS supports booting from ATA hard drives, ATAPI CDROMs, USB hard drives, USB CDROMs, payloads in flash, and from [http://en.wikipedia.org/wiki/Option_ROM Option ROMs] (eg, SCSI or network cards). SeaBIOS can initialize and use a PS/2 keyboard or USB keyboard.<br />
<br />
== Windows ==<br />
<br />
SeaBIOS has been tested with Windows XP, Windows 2008, Windows Vista (64/32 bit), Windows 7 (32 bit and 64 bit).<br />
<br />
However, Windows has a very strict ACPI interpreter, and some coreboot boards do not have a complete [[ACPI in coreboot|ACPI definition]]. As a result, some coreboot boards may fail during Windows boot (eg, it may fail with a '''STOP 0xA5''' code).<br />
<br />
Many boards do have working ACPI and are able to boot XP/Vista/Windows 7. Please check the board documentation or ask on the [[Mailinglist|mailing list]] if unsure of the status.<br />
<br />
== Linux ==<br />
<br />
SeaBIOS has been tested with GRUB, LILO, and Syslinux. Linux booting works well.<br />
<br />
== Other ==<br />
<br />
SeaBIOS has also been tested with FreeDOS, NetBSD, and OpenBSD.<br />
<br />
Because SeaBIOS implements the standard x86 BIOS interfaces, it is expected many other operating systems and boot-loaders will work.<br />
<br />
= Building =<br />
<br />
== Building via coreboot's menuconfig ==<br />
<br />
Probably the easiest way to use SeaBIOS as coreboot payload is to simply use the coreboot build process, which downloads and builds SeaBIOS as payload by default nowadays. You just have to run the following in your coreboot checkout:<br />
<br />
<source lang="bash"><br />
$ make menuconfig<br />
$ make<br />
</source><br />
<br />
Both SeaBIOS and coreboot will be built, and SeaBIOS will be added as payload to the '''coreboot.rom''' image that is being built.<br />
<br />
== Manual build ==<br />
<br />
One can download the latest version of SeaBIOS through a git repository:<br />
<br />
<source lang="bash"><br />
$ git clone git://git.seabios.org/seabios.git seabios<br />
$ cd seabios<br />
</source><br />
<br />
There's also a [http://code.coreboot.org/p/seabios/source/changes/master/ gitweb] facility to browse the latest source code online.<br />
<br />
Run '''make menuconfig''' and set the following variables:<br />
<br />
* CONFIG_COREBOOT 1<br />
* CONFIG_DEBUG_SERIAL 1<br />
<br />
Then:<br />
<br />
<source lang="bash"><br />
$ make<br />
</source><br />
<br />
The final SeaBIOS payload file is '''out/bios.bin.elf'''.<br />
<br />
== coreboot ==<br />
<br />
For best results, configure coreboot with '''CONFIG_WRITE_HIGH_TABLES''' and '''CONFIG_VGA_BRIDGE_SETUP''' both enabled, and '''CONFIG_VGA_ROM_RUN''' and '''CONFIG_PCI_ROM_RUN''' both disabled.<br />
<br />
Finally, configure the SeaBIOS '''out/bios.bin.elf''' file as the coreboot payload and build coreboot. The resulting '''coreboot.rom''' file will contain both SeaBIOS and coreboot, and it can be flashed to a ROM chip.<br />
<br />
= SeaBIOS and CBFS =<br />
<br />
SeaBIOS can read the coreboot flash filesystem and extract files.<br />
<br />
When SeaBIOS scans the target machine's PCI devices, it will recognize option ROMs in CBFS that have the form '''pciVVVV,DDDD.rom'''. It will also run any file in the directory '''vgaroms/''' as a VGA option ROM not specific to a device and files in '''genroms/''' as a generic option ROM not specific to a device. In the above cases, SeaBIOS will recognize files with a '''.lzma''' suffix, and automatically decompress them (eg, '''pci1106,3344.rom.lzma''' and '''vgaroms/sgabios.bin.lzma''').<br />
<br />
SeaBIOS can also load a graphical bootsplash image from '''bootsplash.jpg''' or '''bootsplash.bmp''', payloads found in the CBFS directory '''img/''', and floppy images found in the '''floppyimg/''' directory.<br />
<br />
Further, SeaBIOS can obtain configuration information from CBFS. A file '''bootorder''' determines the order of devices and methods to attempt to boot the system from. Additional configuration items may be found in the CBFS '''etc/''' directory.<br />
<br />
The examples below show some common uses of these features.<br />
<br />
== Adding a VGA option ROM ==<br />
<br />
It is frequently necessary to add a VGA option ROM to CBFS in order to use a VGA adapter that is built-in to a motherboard. Note, VGA adapters on external cards (PCI, AGP, PCIe) do not require this step as SeaBIOS will automatically extract the VGA BIOS directly from the card. For machines without a VGA adapter, please follow the [[#Adding sgabios support|sgabios instructions]] below.<br />
<br />
The first step is to find the vendor and device ID of the built-in VGA adapter. This information can be found from '''lspci''':<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
01:00.0 VGA compatible controller [0300]: VIA Technologies, Inc. UniChrome Pro IGP ['''1106:3344'''] (rev 01) (prog-if 00 [VGA controller])<br />
</source><br />
<br />
In the above example, the VGA vendor/device ID is '''1106:3344'''. [[VGA support#How_to_retrieve_a_good_video_bios|Obtain the VGA ROM]] (eg, '''vgabios.bin''') and add it to the ROM with:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/vgabios.bin -n pci1106,3344.rom -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
Alternatively, SeaBIOS supports LZMA compressed option ROMs. Use the following to add a compressed option ROM instead:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/vgabios.bin > vgabios.bin.lzma<br />
$ ./build/cbfstool build/coreboot.rom add -f vgabios.bin.lzma -n pci1106,3344.rom.lzma -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
After the above is done, one can write the '''coreboot.rom''' file to flash. SeaBIOS will extract the VGA ROM and run it during boot.<br />
<br />
== Adding gpxe support ==<br />
<br />
A [[GPXE|gpxe]] option ROM can nicely complement SeaBIOS and coreboot by adding network boot support. Adding gpxe is similar to [[#Adding a VGA option ROM]]. The first step is to find the Ethernet vendor/device ID. For example:<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
00:09.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet ['''10ec:8167'''] (rev 10)<br />
</source><br />
<br />
Then one can build a gpxe option ROM. For example:<br />
<br />
<source lang="bash"><br />
$ cd /path/to/gpxe/src/<br />
$ make bin/10ec8167.rom<br />
</source><br />
<br />
And add it to the coreboot image. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/gpxe/src/bin/10ec8167.rom -n pci10ec,8167.rom -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
As with VGA option ROMs, the gpxe option ROM may be compressed with LZMA. However, compression won't significantly reduce gpxe's size as it implements its own compression.<br />
<br />
In addition to gpxe, other option ROMs can be added in the same manner.<br />
<br />
== Adding sgabios support ==<br />
<br />
An [http://code.google.com/p/sgabios/ sgabios] option ROM can forward many VGA BIOS requests and keyboard events over a serial port. One can deploy it in addition to the primary VGA BIOS or by itself.<br />
<br />
If the target machine does not have a VGA adapter, then one should install sgabios. Most bootloaders (eg, GRUB) require a VGA BIOS in order to function properly &mdash; the sgabios ROM can fill this requirement.<br />
<br />
Place the sgabios ROM file in the '''vgaroms/''' directory of CBFS. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/sgabios.bin -n vgaroms/sgabios.bin -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
When using sgabios, all the characters that SeaBIOS writes to the screen will be seen twice &mdash; once from SeaBIOS sending the character to the serial port and once from sgabios forwarding the character. To prevent the duplicates set the [[#Other Configuration items|config file]] '''etc/screen-and-debug''' to zero.<br />
<br />
== Adding a graphical "bootsplash" image ==<br />
<br />
SeaBIOS can show a custom [http://en.wikipedia.org/wiki/JPEG JPEG] image or [http://en.wikipedia.org/wiki/BMP_file_format BMP] image during bootup. To enable this, add the JPEG file to flash with the name '''bootsplash.jpg''' or BMP file as '''bootsplash.bmp'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f /path/to/image.jpg -n bootsplash.jpg -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
The size of the image determines the video mode to use for showing the image. Make sure the dimensions of the image exactly correspond to an available video mode (eg, 640x480, or 1024x768), otherwise it will not be displayed.<br />
<br />
SeaBIOS will show the image during the wait for the boot menu (if the boot menu has been disabled, users will not see the image). The image should probably have "Press F12 for boot menu" embedded in it so users know they can enter the normal SeaBIOS boot menu. By default, the boot menu prompt (and thus graphical image) is shown for 2.5 seconds. This can be customized via a [[#Other Configuration items|configuration parameter]].<br />
<br />
The JPEG viewer in SeaBIOS uses a simplified decoding algorithm. It supports most common JPEGs, but does not support all possible formats. Please see the [[#Trouble reporting|Trouble reporting]] section if a valid image isn't displayed properly.<br />
<br />
== Adding payloads ==<br />
<br />
Most [[Payloads|payloads]] can also be launched from SeaBIOS. To add a payload, build the corresponding .elf file and then add it to the '''coreboot.rom''' file in the '''img/''' directory. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add-payload /path/to/payload.elf img/MyPayload l<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
During boot, one can press the '''F12''' key to get a boot menu. SeaBIOS will show all files in the '''img/''' directory, and one can instruct SeaBIOS to run them.<br />
<br />
SeaBIOS supports both uncompressed and LZMA compressed payloads.<br />
<br />
== Adding a floppy image ==<br />
<br />
It is possible to embed an image of a floppy in flash. SeaBIOS can then boot from and redirect floppy BIOS calls to the flash image. This is mainly useful for legacy software (such as DOS utilities). To use this feature, place a floppy image into the CBFS directory '''floppyimg/'''. For example:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/myfloppy.img > myfloppy.img.lzma<br />
$ ./build/cbfstool build/coreboot.rom add -f myfloppy.img.lzma -n floppyimg/MyFloppy.lzma -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
Both uncompressed and LZMA compressed images are supported. Several floppy formats are available: 360K, 1.2MB, 720K, 1.44MB, 2.88MB, 160K, 180K, 320K.<br />
<br />
The floppy image will appear as writable to the system, however all writes are discarded on reboot.<br />
<br />
When using this system, SeaBIOS reserves high-memory to store the floppy. The reserved memory is then no longer available for OS use, so this feature should only be used when needed.<br />
<br />
== Configuring boot order ==<br />
<br />
Place a file in CBFS with the name '''bootorder''' to configure the boot up order. The file should be ASCII text and contain one line per boot method. The description of each boot method follows an [https://secure.wikimedia.org/wikipedia/en/wiki/Open_firmware Open Firmware] device path format. SeaBIOS will attempt to boot from each item in the file &mdash; first line of the file first.<br />
<br />
The easiest way to find the available boot methods is to look for "Searching bootorder for" in the SeaBIOS serial output. For example, one may see lines similar to:<br />
<br />
Searching bootorder for: /pci@i0cf8/*@f/drive@1/disk@0<br />
Searching bootorder for: /pci@i0cf8/*@f,1/drive@2/disk@1<br />
Searching bootorder for: /pci@i0cf8/usb@10,4/*@2<br />
<br />
The above represents the patterns SeaBIOS will search for in the bootorder file. However, it's safe to just copy and paste the pattern into bootorder. For example, the file:<br />
<br />
/pci@i0cf8/usb@10,4/*@2<br />
/pci@i0cf8/*@f/drive@1/disk@0<br />
<br />
will instruct SeaBIOS to attempt to boot from the given USB drive first and then attempt the given ATA harddrive second.<br />
<br />
Once a file has been created, add it to CBFS with the name '''bootorder'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool build/coreboot.rom add -f mybootlist.txt -n bootorder -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
== Other Configuration items ==<br />
<br />
Additional configuration options are available in the CBFS '''etc/''' directory. For example, to set the duration of the boot menu to five and a half seconds, one would do the following:<br />
<br />
<source lang="bash"><br />
$ /path/to/seabios/tools/encodeint.py boot-menu-wait 5500<br />
$ ./build/cbfstool build/coreboot.rom add -f boot-menu-wait -n etc/boot-menu-wait -t raw<br />
$ ./build/cbfstool build/coreboot.rom print<br />
</source><br />
<br />
The SeaBIOS tool '''tools/encodeint.py''' will create a litte-endian encoded binary integer which can be placed into a CBFS file.<br />
<br />
{| border=1<br />
|+ Configuration variables<br />
|-<br />
! Filename !! Description<br />
|-<br />
| boot-menu-wait || Amount of time (in milliseconds) to wait at the boot menu prompt before selecting the default boot.<br />
|-<br />
| extra-pci-roots || If the target machine has multiple independent root buses set this to a positive value. The SeaBIOS PCI probe will then search for the given number of extra root buses.<br />
|-<br />
| ps2-keyboard-spinup || Some PS2 keyboards don't respond to commands immediately after powering on. One may specify the amount of time (in milliseconds) here to allow as additional time for the keyboard to become responsive.<br />
|-<br />
| optionroms-checksum || Option ROMs are required to have correct checksums. However, some option ROMs in the wild don't correctly follow the specifications and have bad checksums. Set this to a zero value to allow SeaBIOS to execute them anyways.<br />
|-<br />
| s3-resume-vga-init || Set this to a non-zero value to instruct SeaBIOS to run the vga rom on an S3 resume.<br />
|-<br />
| screen-and-debug || Set this to a zero value to instruct SeaBIOS to not write characters it sends to the screen to the debug ports. This can be useful when using [[#Adding sgabios support|sgabios]].<br />
|-<br />
| boot-fail-wait || If no boot devices are found SeaBIOS will reboot after 60 seconds. Set this to the amount of time (in milliseconds) to customize the reboot delay or set to -1 to disable rebooting when no boot devices are found<br />
|-<br />
| floppy0 || Set this to the type of the first floppy drive in the system (only type 4 for 3.5 inch drives is supported). The floppy driver has not been tested on real-hardware; please report any success or failures to the seabios mailing list. This feature is only available in SeaBIOS git revisions after 20121201.<br />
|-<br />
| floppy1 || The type of the second floppy drive in the system. See the description of '''floppy0''' for more info.<br />
|}<br />
<br />
= Trouble reporting =<br />
<br />
If you are experiencing problems with SeaBIOS, it's useful to increase the debugging level. This is done by running '''make menuconfig''' and setting '''CONFIG_DEBUG_LEVEL''' to a higher value. A debug level of 8 will show a lot of diagnostic information without flooding the serial port (levels above 8 will frequently cause too much data).<br />
<br />
To report an issue, please collect the serial boot log with SeaBIOS set to a debug level of 8 and forward the full log along with a description of the problem to the coreboot [[Mailinglist|mailing list]].</div>KevinOConnorhttps://www.coreboot.org/index.php?title=SeaBIOS&diff=11340SeaBIOS2012-12-03T04:38:24Z<p>KevinOConnor: /* Other Configuration items */ Add floppy options.</p>
<hr />
<div>[http://www.seabios.org '''SeaBIOS'''] is an open-source legacy BIOS implementation which can be used as a coreboot [[Payloads|payload]]. It implements the standard [https://secure.wikimedia.org/wikipedia/en/wiki/BIOS BIOS] calling interfaces that a typical x86 proprietary BIOS implements.<br />
<br />
This page describes using SeaBIOS with coreboot. SeaBIOS can also run natively in [[QEMU]] and [http://bochs.sourceforge.net/ bochs] &mdash; see the [http://git.linuxtogo.org/?p=kevin/seabios.git;a=blob;f=README;hb=HEAD SeaBIOS README] file for information on non-coreboot uses.<br />
<br />
= Use cases =<br />
<br />
Any software requiring 16-bit BIOS services benefits from SeaBIOS (eg, Windows and DOS). SeaBIOS also enables booting Linux out of the box (using standard boot-loaders like GRUB and Syslinux).<br />
<br />
SeaBIOS supports booting from ATA hard drives, ATAPI CDROMs, USB hard drives, USB CDROMs, payloads in flash, and from [http://en.wikipedia.org/wiki/Option_ROM Option ROMs] (eg, SCSI or network cards). SeaBIOS can initialize and use a PS/2 keyboard or USB keyboard.<br />
<br />
== Windows ==<br />
<br />
SeaBIOS has been tested with Windows XP, Windows 2008, Windows Vista (64/32 bit), Windows 7 (32 bit and 64 bit).<br />
<br />
However, Windows has a very strict ACPI interpreter, and many coreboot boards do not have a complete [[ACPI in coreboot|ACPI definition]]. As a result, many coreboot boards will fail during Windows boot (eg, it may fail with a '''STOP 0xA5''' code).<br />
<br />
So far [[ASUS M2V-MX SE]] and [[GIGABYTE GA-M57SLI-S4]] have known good working ACPI and are able to boot XP/Vista/Windows 7. Please ask on the [[Mailinglist|mailing list]] for the status of other boards/chipsets.<br />
<br />
== Linux ==<br />
<br />
SeaBIOS has been tested with GRUB, LILO, and Syslinux. Linux booting works well.<br />
<br />
== Other ==<br />
<br />
SeaBIOS has also been tested with FreeDOS, NetBSD, and OpenBSD.<br />
<br />
Because SeaBIOS implements the standard x86 BIOS interfaces, it is expected many other operating systems and boot-loaders will work.<br />
<br />
= Building =<br />
<br />
== Building via coreboot's menuconfig ==<br />
<br />
Probably the easiest way to use SeaBIOS as coreboot payload is to simply use the coreboot build process, which downloads and builds SeaBIOS as payload by default nowadays. You just have to run the following in your coreboot checkout:<br />
<br />
<source lang="bash"><br />
$ make menuconfig<br />
$ make<br />
</source><br />
<br />
Both SeaBIOS and coreboot will be built, and SeaBIOS will be added as payload to the '''coreboot.rom''' image that is being built.<br />
<br />
== Manual build ==<br />
<br />
One can download the latest version of SeaBIOS through a git repository:<br />
<br />
<source lang="bash"><br />
$ git clone git://git.seabios.org/seabios.git seabios<br />
$ cd seabios<br />
</source><br />
<br />
There's also a [http://code.coreboot.org/p/seabios/source/changes/master/ gitweb] facility to browse the latest source code online.<br />
<br />
Run '''make menuconfig''' and set the following variables:<br />
<br />
* CONFIG_COREBOOT 1<br />
* CONFIG_DEBUG_SERIAL 1<br />
<br />
Then:<br />
<br />
<source lang="bash"><br />
$ make<br />
</source><br />
<br />
The final SeaBIOS payload file is '''out/bios.bin.elf'''.<br />
<br />
== coreboot ==<br />
<br />
For best results, configure coreboot with '''CONFIG_WRITE_HIGH_TABLES''' and '''CONFIG_VGA_BRIDGE_SETUP''' both enabled, and '''CONFIG_VGA_ROM_RUN''' and '''CONFIG_PCI_ROM_RUN''' both disabled.<br />
<br />
Finally, configure the SeaBIOS '''out/bios.bin.elf''' file as the coreboot payload and build coreboot. The resulting '''coreboot.rom''' file will contain both SeaBIOS and coreboot, and it can be flashed to a ROM chip.<br />
<br />
= SeaBIOS and CBFS =<br />
<br />
SeaBIOS can read the coreboot flash filesystem and extract files.<br />
<br />
When SeaBIOS scans the target machine's PCI devices, it will recognize option ROMs in CBFS that have the form '''pciVVVV,DDDD.rom'''. It will also run any file in the directory '''vgaroms/''' as a VGA option ROM not specific to a device and files in '''genroms/''' as a generic option ROM not specific to a device. In the above cases, SeaBIOS will recognize files with a '''.lzma''' suffix, and automatically decompress them (eg, '''pci1106,3344.rom.lzma''' and '''vgaroms/sgabios.bin.lzma''').<br />
<br />
SeaBIOS can also load a graphical bootsplash image from '''bootsplash.jpg''' or '''bootsplash.bmp''', payloads found in the CBFS directory '''img/''', and floppy images found in the '''floppyimg/''' directory.<br />
<br />
Further, SeaBIOS can obtain configuration information from CBFS. A file '''bootorder''' determines the order of devices and methods to attempt to boot the system from. Additional configuration items may be found in the CBFS '''etc/''' directory.<br />
<br />
The examples below show some common uses of these features.<br />
<br />
== Adding a VGA option ROM ==<br />
<br />
It is frequently necessary to add a VGA option ROM to CBFS in order to use a VGA adapter that is built-in to a motherboard. Note, VGA adapters on external cards (PCI, AGP, PCIe) do not require this step as SeaBIOS will automatically extract the VGA BIOS directly from the card. For machines without a VGA adapter, please follow the [[#Adding sgabios support|sgabios instructions]] below.<br />
<br />
The first step is to find the vendor and device ID of the built-in VGA adapter. This information can be found from '''lspci''':<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
01:00.0 VGA compatible controller [0300]: VIA Technologies, Inc. UniChrome Pro IGP ['''1106:3344'''] (rev 01) (prog-if 00 [VGA controller])<br />
</source><br />
<br />
In the above example, the VGA vendor/device ID is '''1106:3344'''. [[VGA support#How_to_retrieve_a_good_video_bios|Obtain the VGA ROM]] (eg, '''vgabios.bin''') and add it to the ROM with:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add /path/to/vgabios.bin pci1106,3344.rom raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
Alternatively, SeaBIOS supports LZMA compressed option ROMs. Use the following to add a compressed option ROM instead:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/vgabios.bin > vgabios.bin.lzma<br />
$ ./build/cbfstool coreboot.rom add vgabios.bin.lzma pci1106,3344.rom.lzma raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
After the above is done, one can write the '''coreboot.rom''' file to flash. SeaBIOS will extract the VGA ROM and run it during boot.<br />
<br />
== Adding gpxe support ==<br />
<br />
A [[GPXE|gpxe]] option ROM can nicely complement SeaBIOS and coreboot by adding network boot support. Adding gpxe is similar to [[#Adding a VGA option ROM]]. The first step is to find the Ethernet vendor/device ID. For example:<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
00:09.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet ['''10ec:8167'''] (rev 10)<br />
</source><br />
<br />
Then one can build a gpxe option ROM. For example:<br />
<br />
<source lang="bash"><br />
$ cd /path/to/gpxe/src/<br />
$ make bin/10ec8167.rom<br />
</source><br />
<br />
And add it to the coreboot image. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add /path/to/gpxe/src/bin/10ec8167.rom pci10ec,8167.rom raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
As with VGA option ROMs, the gpxe option ROM may be compressed with LZMA. However, compression won't significantly reduce gpxe's size as it implements its own compression.<br />
<br />
In addition to gpxe, other option ROMs can be added in the same manner.<br />
<br />
== Adding sgabios support ==<br />
<br />
An [http://code.google.com/p/sgabios/ sgabios] option ROM can forward many VGA BIOS requests and keyboard events over a serial port. One can deploy it in addition to the primary VGA BIOS or by itself.<br />
<br />
If the target machine does not have a VGA adapter, then one should install sgabios. Most bootloaders (eg, GRUB) require a VGA BIOS in order to function properly &mdash; the sgabios ROM can fill this requirement.<br />
<br />
Place the sgabios ROM file in the '''vgaroms/''' directory of CBFS. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add /path/to/sgabios.bin vgaroms/sgabios.bin raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
When using sgabios, all the characters that SeaBIOS writes to the screen will be seen twice &mdash; once from SeaBIOS sending the character to the serial port and once from sgabios forwarding the character. To prevent the duplicates set the [[#Other Configuration items|config file]] '''etc/screen-and-debug''' to zero.<br />
<br />
== Adding a graphical "bootsplash" image ==<br />
<br />
SeaBIOS can show a custom [http://en.wikipedia.org/wiki/JPEG JPEG] image or [http://en.wikipedia.org/wiki/BMP_file_format BMP] image during bootup. To enable this, add the JPEG file to flash with the name '''bootsplash.jpg''' or BMP file as '''bootsplash.bmp'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add /path/to/image.jpg bootsplash.jpg raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
The size of the image determines the video mode to use for showing the image. Make sure the dimensions of the image exactly correspond to an available video mode (eg, 640x480, or 1024x768), otherwise it will not be displayed.<br />
<br />
SeaBIOS will show the image during the wait for the boot menu (if the boot menu has been disabled, users will not see the image). The image should probably have "Press F12 for boot menu" embedded in it so users know they can enter the normal SeaBIOS boot menu. By default, the boot menu prompt (and thus graphical image) is shown for 2.5 seconds. This can be customized via a [[#Other Configuration items|configuration parameter]].<br />
<br />
The JPEG viewer in SeaBIOS uses a simplified decoding algorithm. It supports most common JPEGs, but does not support all possible formats. Please see the [[#Trouble reporting|Trouble reporting]] section if a valid image isn't displayed properly.<br />
<br />
== Adding payloads ==<br />
<br />
Most [[Payloads|payloads]] can also be launched from SeaBIOS. To add a payload, build the corresponding .elf file and then add it to the '''coreboot.rom''' file in the '''img/''' directory. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add-payload /path/to/payload.elf img/MyPayload l<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
During boot, one can press the '''F12''' key to get a boot menu. SeaBIOS will show all files in the '''img/''' directory, and one can instruct SeaBIOS to run them.<br />
<br />
SeaBIOS supports both uncompressed and LZMA compressed payloads.<br />
<br />
== Adding a floppy image ==<br />
<br />
It is possible to embed an image of a floppy in flash. SeaBIOS can then boot from and redirect floppy BIOS calls to the flash image. This is mainly useful for legacy software (such as DOS utilities). To use this feature, place a floppy image into the CBFS directory '''floppyimg/'''. For example:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/myfloppy.img > myfloppy.img.lzma<br />
$ ./build/cbfstool coreboot.rom add myfloppy.img.lzma floppyimg/MyFloppy.lzma raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
Both uncompressed and LZMA compressed images are supported. Several floppy formats are available: 360K, 1.2MB, 720K, 1.44MB, 2.88MB, 160K, 180K, 320K.<br />
<br />
The floppy image will appear as writable to the system, however all writes are discarded on reboot.<br />
<br />
When using this system, SeaBIOS reserves high-memory to store the floppy. The reserved memory is then no longer available for OS use, so this feature should only be used when needed.<br />
<br />
== Configuring boot order ==<br />
<br />
Place a file in CBFS with the name '''bootorder''' to configure the boot up order. The file should be ASCII text and contain one line per boot method. The description of each boot method follows an [https://secure.wikimedia.org/wikipedia/en/wiki/Open_firmware Open Firmware] device path format. SeaBIOS will attempt to boot from each item in the file &mdash; first line of the file first.<br />
<br />
The easiest way to find the available boot methods is to look for "Searching bootorder for" in the SeaBIOS serial output. For example, one may see lines similar to:<br />
<br />
Searching bootorder for: /pci@i0cf8/*@f/drive@1/disk@0<br />
Searching bootorder for: /pci@i0cf8/*@f,1/drive@2/disk@1<br />
Searching bootorder for: /pci@i0cf8/usb@10,4/*@2<br />
<br />
The above represents the patterns SeaBIOS will search for in the bootorder file. However, it's safe to just copy and paste the pattern into bootorder. For example, the file:<br />
<br />
/pci@i0cf8/usb@10,4/*@2<br />
/pci@i0cf8/*@f/drive@1/disk@0<br />
<br />
will instruct SeaBIOS to attempt to boot from the given USB drive first and then attempt the given ATA harddrive second.<br />
<br />
Once a file has been created, add it to CBFS with the name '''bootorder'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add mybootlist.txt bootorder raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
== Other Configuration items ==<br />
<br />
Additional configuration options are available in the CBFS '''etc/''' directory. For example, to set the duration of the boot menu to five and a half seconds, one would do the following:<br />
<br />
<source lang="bash"><br />
$ /path/to/seabios/tools/encodeint.py boot-menu-wait 5500<br />
$ ./build/cbfstool coreboot.rom add boot-menu-wait etc/boot-menu-wait raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
The SeaBIOS tool '''tools/encodeint.py''' will create a litte-endian encoded binary integer which can be placed into a CBFS file.<br />
<br />
{| border=1<br />
|+ Configuration variables<br />
|-<br />
! Filename !! Description<br />
|-<br />
| boot-menu-wait || Amount of time (in milliseconds) to wait at the boot menu prompt before selecting the default boot.<br />
|-<br />
| extra-pci-roots || If the target machine has multiple independent root buses set this to a positive value. The SeaBIOS PCI probe will then search for the given number of extra root buses.<br />
|-<br />
| ps2-keyboard-spinup || Some PS2 keyboards don't respond to commands immediately after powering on. One may specify the amount of time (in milliseconds) here to allow as additional time for the keyboard to become responsive.<br />
|-<br />
| optionroms-checksum || Option ROMs are required to have correct checksums. However, some option ROMs in the wild don't correctly follow the specifications and have bad checksums. Set this to a zero value to allow SeaBIOS to execute them anyways.<br />
|-<br />
| s3-resume-vga-init || Set this to a non-zero value to instruct SeaBIOS to run the vga rom on an S3 resume.<br />
|-<br />
| screen-and-debug || Set this to a zero value to instruct SeaBIOS to not write characters it sends to the screen to the debug ports. This can be useful when using [[#Adding sgabios support|sgabios]].<br />
|-<br />
| boot-fail-wait || If no boot devices are found SeaBIOS will reboot after 60 seconds. Set this to the amount of time (in milliseconds) to customize the reboot delay or set to -1 to disable rebooting when no boot devices are found<br />
|-<br />
| floppy0 || Set this to the type of the first floppy drive in the system (only type 4 for 3.5 inch drives is supported). The floppy driver has not been tested on real-hardware; please report any success or failures to the seabios mailing list. This feature is only available in SeaBIOS git revisions after 20121201.<br />
|-<br />
| floppy1 || The type of the second floppy drive in the system. See the description of '''floppy0''' for more info.<br />
|}<br />
<br />
= Trouble reporting =<br />
<br />
If you are experiencing problems with SeaBIOS, it's useful to increase the debugging level. This is done by running '''make menuconfig''' and setting '''CONFIG_DEBUG_LEVEL''' to a higher value. A debug level of 8 will show a lot of diagnostic information without flooding the serial port (levels above 8 will frequently cause too much data).<br />
<br />
To report an issue, please collect the serial boot log with SeaBIOS set to a debug level of 8 and forward the full log along with a description of the problem to the coreboot [[Mailinglist|mailing list]].</div>KevinOConnorhttps://www.coreboot.org/index.php?title=SeaBIOS&diff=11307SeaBIOS2012-11-20T03:19:42Z<p>KevinOConnor: /* Other Configuration items */ Latest SeaBIOS release has boot-fail-wait so no need to warn.</p>
<hr />
<div>[http://www.seabios.org '''SeaBIOS'''] is an open-source legacy BIOS implementation which can be used as a coreboot [[Payloads|payload]]. It implements the standard [https://secure.wikimedia.org/wikipedia/en/wiki/BIOS BIOS] calling interfaces that a typical x86 proprietary BIOS implements.<br />
<br />
This page describes using SeaBIOS with coreboot. SeaBIOS can also run natively in [[QEMU]] and [http://bochs.sourceforge.net/ bochs] &mdash; see the [http://git.linuxtogo.org/?p=kevin/seabios.git;a=blob;f=README;hb=HEAD SeaBIOS README] file for information on non-coreboot uses.<br />
<br />
= Use cases =<br />
<br />
Any software requiring 16-bit BIOS services benefits from SeaBIOS (eg, Windows and DOS). SeaBIOS also enables booting Linux out of the box (using standard boot-loaders like GRUB and Syslinux).<br />
<br />
SeaBIOS supports booting from ATA hard drives, ATAPI CDROMs, USB hard drives, USB CDROMs, payloads in flash, and from [http://en.wikipedia.org/wiki/Option_ROM Option ROMs] (eg, SCSI or network cards). SeaBIOS can initialize and use a PS/2 keyboard or USB keyboard.<br />
<br />
== Windows ==<br />
<br />
SeaBIOS has been tested with Windows XP, Windows 2008, Windows Vista (64/32 bit), Windows 7 (32 bit and 64 bit).<br />
<br />
However, Windows has a very strict ACPI interpreter, and many coreboot boards do not have a complete [[ACPI in coreboot|ACPI definition]]. As a result, many coreboot boards will fail during Windows boot (eg, it may fail with a '''STOP 0xA5''' code).<br />
<br />
So far [[ASUS M2V-MX SE]] and [[GIGABYTE GA-M57SLI-S4]] have known good working ACPI and are able to boot XP/Vista/Windows 7. Please ask on the [[Mailinglist|mailing list]] for the status of other boards/chipsets.<br />
<br />
== Linux ==<br />
<br />
SeaBIOS has been tested with GRUB, LILO, and Syslinux. Linux booting works well.<br />
<br />
== Other ==<br />
<br />
SeaBIOS has also been tested with FreeDOS, NetBSD, and OpenBSD.<br />
<br />
Because SeaBIOS implements the standard x86 BIOS interfaces, it is expected many other operating systems and boot-loaders will work.<br />
<br />
= Building =<br />
<br />
== Building via coreboot's menuconfig ==<br />
<br />
Probably the easiest way to use SeaBIOS as coreboot payload is to simply use the coreboot build process, which downloads and builds SeaBIOS as payload by default nowadays. You just have to run the following in your coreboot checkout:<br />
<br />
<source lang="bash"><br />
$ make menuconfig<br />
$ make<br />
</source><br />
<br />
Both SeaBIOS and coreboot will be built, and SeaBIOS will be added as payload to the '''coreboot.rom''' image that is being built.<br />
<br />
== Manual build ==<br />
<br />
One can download the latest version of SeaBIOS through a git repository:<br />
<br />
<source lang="bash"><br />
$ git clone git://git.seabios.org/seabios.git seabios<br />
$ cd seabios<br />
</source><br />
<br />
There's also a [http://code.coreboot.org/p/seabios/source/changes/master/ gitweb] facility to browse the latest source code online.<br />
<br />
Run '''make menuconfig''' and set the following variables:<br />
<br />
* CONFIG_COREBOOT 1<br />
* CONFIG_DEBUG_SERIAL 1<br />
<br />
Then:<br />
<br />
<source lang="bash"><br />
$ make<br />
</source><br />
<br />
The final SeaBIOS payload file is '''out/bios.bin.elf'''.<br />
<br />
== coreboot ==<br />
<br />
For best results, configure coreboot with '''CONFIG_WRITE_HIGH_TABLES''' and '''CONFIG_VGA_BRIDGE_SETUP''' both enabled, and '''CONFIG_VGA_ROM_RUN''' and '''CONFIG_PCI_ROM_RUN''' both disabled.<br />
<br />
Finally, configure the SeaBIOS '''out/bios.bin.elf''' file as the coreboot payload and build coreboot. The resulting '''coreboot.rom''' file will contain both SeaBIOS and coreboot, and it can be flashed to a ROM chip.<br />
<br />
= SeaBIOS and CBFS =<br />
<br />
SeaBIOS can read the coreboot flash filesystem and extract files.<br />
<br />
When SeaBIOS scans the target machine's PCI devices, it will recognize option ROMs in CBFS that have the form '''pciVVVV,DDDD.rom'''. It will also run any file in the directory '''vgaroms/''' as a VGA option ROM not specific to a device and files in '''genroms/''' as a generic option ROM not specific to a device. In the above cases, SeaBIOS will recognize files with a '''.lzma''' suffix, and automatically decompress them (eg, '''pci1106,3344.rom.lzma''' and '''vgaroms/sgabios.bin.lzma''').<br />
<br />
SeaBIOS can also load a graphical bootsplash image from '''bootsplash.jpg''' or '''bootsplash.bmp''', payloads found in the CBFS directory '''img/''', and floppy images found in the '''floppyimg/''' directory.<br />
<br />
Further, SeaBIOS can obtain configuration information from CBFS. A file '''bootorder''' determines the order of devices and methods to attempt to boot the system from. Additional configuration items may be found in the CBFS '''etc/''' directory.<br />
<br />
The examples below show some common uses of these features.<br />
<br />
== Adding a VGA option ROM ==<br />
<br />
It is frequently necessary to add a VGA option ROM to CBFS in order to use a VGA adapter that is built-in to a motherboard. Note, VGA adapters on external cards (PCI, AGP, PCIe) do not require this step as SeaBIOS will automatically extract the VGA BIOS directly from the card. For machines without a VGA adapter, please follow the [[#Adding sgabios support|sgabios instructions]] below.<br />
<br />
The first step is to find the vendor and device ID of the built-in VGA adapter. This information can be found from '''lspci''':<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
01:00.0 VGA compatible controller [0300]: VIA Technologies, Inc. UniChrome Pro IGP ['''1106:3344'''] (rev 01) (prog-if 00 [VGA controller])<br />
</source><br />
<br />
In the above example, the VGA vendor/device ID is '''1106:3344'''. [[VGA support#How_to_retrieve_a_good_video_bios|Obtain the VGA ROM]] (eg, '''vgabios.bin''') and add it to the ROM with:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add /path/to/vgabios.bin pci1106,3344.rom raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
Alternatively, SeaBIOS supports LZMA compressed option ROMs. Use the following to add a compressed option ROM instead:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/vgabios.bin > vgabios.bin.lzma<br />
$ ./build/cbfstool coreboot.rom add vgabios.bin.lzma pci1106,3344.rom.lzma raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
After the above is done, one can write the '''coreboot.rom''' file to flash. SeaBIOS will extract the VGA ROM and run it during boot.<br />
<br />
== Adding gpxe support ==<br />
<br />
A [[GPXE|gpxe]] option ROM can nicely complement SeaBIOS and coreboot by adding network boot support. Adding gpxe is similar to [[#Adding a VGA option ROM]]. The first step is to find the Ethernet vendor/device ID. For example:<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
00:09.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet ['''10ec:8167'''] (rev 10)<br />
</source><br />
<br />
Then one can build a gpxe option ROM. For example:<br />
<br />
<source lang="bash"><br />
$ cd /path/to/gpxe/src/<br />
$ make bin/10ec8167.rom<br />
</source><br />
<br />
And add it to the coreboot image. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add /path/to/gpxe/src/bin/10ec8167.rom pci10ec,8167.rom raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
As with VGA option ROMs, the gpxe option ROM may be compressed with LZMA. However, compression won't significantly reduce gpxe's size as it implements its own compression.<br />
<br />
In addition to gpxe, other option ROMs can be added in the same manner.<br />
<br />
== Adding sgabios support ==<br />
<br />
An [http://code.google.com/p/sgabios/ sgabios] option ROM can forward many VGA BIOS requests and keyboard events over a serial port. One can deploy it in addition to the primary VGA BIOS or by itself.<br />
<br />
If the target machine does not have a VGA adapter, then one should install sgabios. Most bootloaders (eg, GRUB) require a VGA BIOS in order to function properly &mdash; the sgabios ROM can fill this requirement.<br />
<br />
Place the sgabios ROM file in the '''vgaroms/''' directory of CBFS. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add /path/to/sgabios.bin vgaroms/sgabios.bin raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
When using sgabios, all the characters that SeaBIOS writes to the screen will be seen twice &mdash; once from SeaBIOS sending the character to the serial port and once from sgabios forwarding the character. To prevent the duplicates set the [[#Other Configuration items|config file]] '''etc/screen-and-debug''' to zero.<br />
<br />
== Adding a graphical "bootsplash" image ==<br />
<br />
SeaBIOS can show a custom [http://en.wikipedia.org/wiki/JPEG JPEG] image or [http://en.wikipedia.org/wiki/BMP_file_format BMP] image during bootup. To enable this, add the JPEG file to flash with the name '''bootsplash.jpg''' or BMP file as '''bootsplash.bmp'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add /path/to/image.jpg bootsplash.jpg raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
The size of the image determines the video mode to use for showing the image. Make sure the dimensions of the image exactly correspond to an available video mode (eg, 640x480, or 1024x768), otherwise it will not be displayed.<br />
<br />
SeaBIOS will show the image during the wait for the boot menu (if the boot menu has been disabled, users will not see the image). The image should probably have "Press F12 for boot menu" embedded in it so users know they can enter the normal SeaBIOS boot menu. By default, the boot menu prompt (and thus graphical image) is shown for 2.5 seconds. This can be customized via a [[#Other Configuration items|configuration parameter]].<br />
<br />
The JPEG viewer in SeaBIOS uses a simplified decoding algorithm. It supports most common JPEGs, but does not support all possible formats. Please see the [[#Trouble reporting|Trouble reporting]] section if a valid image isn't displayed properly.<br />
<br />
== Adding payloads ==<br />
<br />
Most [[Payloads|payloads]] can also be launched from SeaBIOS. To add a payload, build the corresponding .elf file and then add it to the '''coreboot.rom''' file in the '''img/''' directory. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add-payload /path/to/payload.elf img/MyPayload l<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
During boot, one can press the '''F12''' key to get a boot menu. SeaBIOS will show all files in the '''img/''' directory, and one can instruct SeaBIOS to run them.<br />
<br />
SeaBIOS supports both uncompressed and LZMA compressed payloads.<br />
<br />
== Adding a floppy image ==<br />
<br />
It is possible to embed an image of a floppy in flash. SeaBIOS can then boot from and redirect floppy BIOS calls to the flash image. This is mainly useful for legacy software (such as DOS utilities). To use this feature, place a floppy image into the CBFS directory '''floppyimg/'''. For example:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/myfloppy.img > myfloppy.img.lzma<br />
$ ./build/cbfstool coreboot.rom add myfloppy.img.lzma floppyimg/MyFloppy.lzma raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
Both uncompressed and LZMA compressed images are supported. Several floppy formats are available: 360K, 1.2MB, 720K, 1.44MB, 2.88MB, 160K, 180K, 320K.<br />
<br />
The floppy image will appear as writable to the system, however all writes are discarded on reboot.<br />
<br />
When using this system, SeaBIOS reserves high-memory to store the floppy. The reserved memory is then no longer available for OS use, so this feature should only be used when needed.<br />
<br />
== Configuring boot order ==<br />
<br />
Place a file in CBFS with the name '''bootorder''' to configure the boot up order. The file should be ASCII text and contain one line per boot method. The description of each boot method follows an [https://secure.wikimedia.org/wikipedia/en/wiki/Open_firmware Open Firmware] device path format. SeaBIOS will attempt to boot from each item in the file &mdash; first line of the file first.<br />
<br />
The easiest way to find the available boot methods is to look for "Searching bootorder for" in the SeaBIOS serial output. For example, one may see lines similar to:<br />
<br />
Searching bootorder for: /pci@i0cf8/*@f/drive@1/disk@0<br />
Searching bootorder for: /pci@i0cf8/*@f,1/drive@2/disk@1<br />
Searching bootorder for: /pci@i0cf8/usb@10,4/*@2<br />
<br />
The above represents the patterns SeaBIOS will search for in the bootorder file. However, it's safe to just copy and paste the pattern into bootorder. For example, the file:<br />
<br />
/pci@i0cf8/usb@10,4/*@2<br />
/pci@i0cf8/*@f/drive@1/disk@0<br />
<br />
will instruct SeaBIOS to attempt to boot from the given USB drive first and then attempt the given ATA harddrive second.<br />
<br />
Once a file has been created, add it to CBFS with the name '''bootorder'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add mybootlist.txt bootorder raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
== Other Configuration items ==<br />
<br />
Additional configuration options are available in the CBFS '''etc/''' directory. For example, to set the duration of the boot menu to five and a half seconds, one would do the following:<br />
<br />
<source lang="bash"><br />
$ /path/to/seabios/tools/encodeint.py boot-menu-wait 5500<br />
$ ./build/cbfstool coreboot.rom add boot-menu-wait etc/boot-menu-wait raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
The SeaBIOS tool '''tools/encodeint.py''' will create a litte-endian encoded binary integer which can be placed into a CBFS file.<br />
<br />
{| border=1<br />
|+ Configuration variables<br />
|-<br />
! Filename !! Description<br />
|-<br />
| boot-menu-wait || Amount of time (in milliseconds) to wait at the boot menu prompt before selecting the default boot.<br />
|-<br />
| extra-pci-roots || If the target machine has multiple independent root buses set this to a positive value. The SeaBIOS PCI probe will then search for the given number of extra root buses.<br />
|-<br />
| ps2-keyboard-spinup || Some PS2 keyboards don't respond to commands immediately after powering on. One may specify the amount of time (in milliseconds) here to allow as additional time for the keyboard to become responsive.<br />
|-<br />
| optionroms-checksum || Option ROMs are required to have correct checksums. However, some option ROMs in the wild don't correctly follow the specifications and have bad checksums. Set this to a zero value to allow SeaBIOS to execute them anyways.<br />
|-<br />
| s3-resume-vga-init || Set this to a non-zero value to instruct SeaBIOS to run the vga rom on an S3 resume.<br />
|-<br />
| screen-and-debug || Set this to a zero value to instruct SeaBIOS to not write characters it sends to the screen to the debug ports. This can be useful when using [[#Adding sgabios support|sgabios]].<br />
|-<br />
| boot-fail-wait || If no boot devices are found SeaBIOS will reboot after 60 seconds. Set this to the amount of time (in milliseconds) to customize the reboot delay or set to -1 to disable rebooting when no boot devices are found<br />
|}<br />
<br />
= Trouble reporting =<br />
<br />
If you are experiencing problems with SeaBIOS, it's useful to increase the debugging level. This is done by running '''make menuconfig''' and setting '''CONFIG_DEBUG_LEVEL''' to a higher value. A debug level of 8 will show a lot of diagnostic information without flooding the serial port (levels above 8 will frequently cause too much data).<br />
<br />
To report an issue, please collect the serial boot log with SeaBIOS set to a debug level of 8 and forward the full log along with a description of the problem to the coreboot [[Mailinglist|mailing list]].</div>KevinOConnorhttps://www.coreboot.org/index.php?title=SeaBIOS&diff=11097SeaBIOS2012-06-09T13:26:59Z<p>KevinOConnor: /* SeaBIOS and CBFS */ Not bootsplash.bmp in overview.</p>
<hr />
<div>[http://www.seabios.org '''SeaBIOS'''] is an open-source legacy BIOS implementation which can be used as a coreboot [[Payloads|payload]]. It implements the standard [https://secure.wikimedia.org/wikipedia/en/wiki/BIOS BIOS] calling interfaces that a typical x86 proprietary BIOS implements.<br />
<br />
This page describes using SeaBIOS with coreboot. SeaBIOS can also run natively in [[QEMU]] and [http://bochs.sourceforge.net/ bochs] &mdash; see the [http://git.linuxtogo.org/?p=kevin/seabios.git;a=blob;f=README;hb=HEAD SeaBIOS README] file for information on non-coreboot uses.<br />
<br />
= Use cases =<br />
<br />
Any software requiring 16-bit BIOS services benefits from SeaBIOS (eg, Windows and DOS). SeaBIOS also enables booting Linux out of the box (using standard boot-loaders like GRUB and Syslinux).<br />
<br />
SeaBIOS supports booting from ATA hard drives, ATAPI CDROMs, USB hard drives, USB CDROMs, payloads in flash, and from [http://en.wikipedia.org/wiki/Option_ROM Option ROMs] (eg, SCSI or network cards). SeaBIOS can initialize and use a PS/2 keyboard or USB keyboard.<br />
<br />
== Windows ==<br />
<br />
SeaBIOS has been tested with Windows XP, Windows 2008, Windows Vista (64/32 bit), Windows 7 (32 bit and 64 bit).<br />
<br />
However, Windows has a very strict ACPI interpreter, and many coreboot boards do not have a complete [[ACPI in coreboot|ACPI definition]]. As a result, many coreboot boards will fail during Windows boot (eg, it may fail with a '''STOP 0xA5''' code).<br />
<br />
So far [[ASUS M2V-MX SE]] and [[GIGABYTE GA-M57SLI-S4]] have known good working ACPI and are able to boot XP/Vista/Windows 7. Please ask on the [[Mailinglist|mailing list]] for the status of other boards/chipsets.<br />
<br />
== Linux ==<br />
<br />
SeaBIOS has been tested with GRUB, LILO, and Syslinux. Linux booting works well.<br />
<br />
== Other ==<br />
<br />
SeaBIOS has also been tested with FreeDOS, NetBSD, and OpenBSD.<br />
<br />
Because SeaBIOS implements the standard x86 BIOS interfaces, it is expected many other operating systems and boot-loaders will work.<br />
<br />
= Building =<br />
<br />
== Building via coreboot's menuconfig ==<br />
<br />
Probably the easiest way to use SeaBIOS as coreboot payload is to simply use the coreboot build process, which downloads and builds SeaBIOS as payload by default nowadays. You just have to run the following in your coreboot checkout:<br />
<br />
<source lang="bash"><br />
$ make menuconfig<br />
$ make<br />
</source><br />
<br />
Both SeaBIOS and coreboot will be built, and SeaBIOS will be added as payload to the '''coreboot.rom''' image that is being built.<br />
<br />
== Manual build ==<br />
<br />
One can download the latest version of SeaBIOS through a git repository:<br />
<br />
<source lang="bash"><br />
$ git clone git://git.seabios.org/seabios.git seabios<br />
$ cd seabios<br />
</source><br />
<br />
There's also a [http://code.coreboot.org/p/seabios/source/changes/master/ gitweb] facility to browse the latest source code online.<br />
<br />
Run '''make menuconfig''' and set the following variables:<br />
<br />
* CONFIG_COREBOOT 1<br />
* CONFIG_DEBUG_SERIAL 1<br />
<br />
Then:<br />
<br />
<source lang="bash"><br />
$ make<br />
</source><br />
<br />
The final SeaBIOS payload file is '''out/bios.bin.elf'''.<br />
<br />
== coreboot ==<br />
<br />
For best results, configure coreboot with '''CONFIG_WRITE_HIGH_TABLES''' and '''CONFIG_VGA_BRIDGE_SETUP''' both enabled, and '''CONFIG_VGA_ROM_RUN''' and '''CONFIG_PCI_ROM_RUN''' both disabled.<br />
<br />
Finally, configure the SeaBIOS '''out/bios.bin.elf''' file as the coreboot payload and build coreboot. The resulting '''coreboot.rom''' file will contain both SeaBIOS and coreboot, and it can be flashed to a ROM chip.<br />
<br />
= SeaBIOS and CBFS =<br />
<br />
SeaBIOS can read the coreboot flash filesystem and extract files.<br />
<br />
When SeaBIOS scans the target machine's PCI devices, it will recognize option ROMs in CBFS that have the form '''pciVVVV,DDDD.rom'''. It will also run any file in the directory '''vgaroms/''' as a VGA option ROM not specific to a device and files in '''genroms/''' as a generic option ROM not specific to a device. In the above cases, SeaBIOS will recognize files with a '''.lzma''' suffix, and automatically decompress them (eg, '''pci1106,3344.rom.lzma''' and '''vgaroms/sgabios.bin.lzma''').<br />
<br />
SeaBIOS can also load a graphical bootsplash image from '''bootsplash.jpg''' or '''bootsplash.bmp''', payloads found in the CBFS directory '''img/''', and floppy images found in the '''floppyimg/''' directory.<br />
<br />
Further, SeaBIOS can obtain configuration information from CBFS. A file '''bootorder''' determines the order of devices and methods to attempt to boot the system from. Additional configuration items may be found in the CBFS '''etc/''' directory.<br />
<br />
The examples below show some common uses of these features.<br />
<br />
== Adding a VGA option ROM ==<br />
<br />
It is frequently necessary to add a VGA option ROM to CBFS in order to use a VGA adapter that is built-in to a motherboard. Note, VGA adapters on external cards (PCI, AGP, PCIe) do not require this step as SeaBIOS will automatically extract the VGA BIOS directly from the card. For machines without a VGA adapter, please follow the [[#Adding sgabios support|sgabios instructions]] below.<br />
<br />
The first step is to find the vendor and device ID of the built-in VGA adapter. This information can be found from '''lspci''':<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
01:00.0 VGA compatible controller [0300]: VIA Technologies, Inc. UniChrome Pro IGP ['''1106:3344'''] (rev 01) (prog-if 00 [VGA controller])<br />
</source><br />
<br />
In the above example, the VGA vendor/device ID is '''1106:3344'''. [[VGA support#How_to_retrieve_a_good_video_bios|Obtain the VGA ROM]] (eg, '''vgabios.bin''') and add it to the ROM with:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add /path/to/vgabios.bin pci1106,3344.rom raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
Alternatively, SeaBIOS supports LZMA compressed option ROMs. Use the following to add a compressed option ROM instead:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/vgabios.bin > vgabios.bin.lzma<br />
$ ./build/cbfstool coreboot.rom add vgabios.bin.lzma pci1106,3344.rom.lzma raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
After the above is done, one can write the '''coreboot.rom''' file to flash. SeaBIOS will extract the VGA ROM and run it during boot.<br />
<br />
== Adding gpxe support ==<br />
<br />
A [[GPXE|gpxe]] option ROM can nicely complement SeaBIOS and coreboot by adding network boot support. Adding gpxe is similar to [[#Adding a VGA option ROM]]. The first step is to find the Ethernet vendor/device ID. For example:<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
00:09.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet ['''10ec:8167'''] (rev 10)<br />
</source><br />
<br />
Then one can build a gpxe option ROM. For example:<br />
<br />
<source lang="bash"><br />
$ cd /path/to/gpxe/src/<br />
$ make bin/10ec8167.rom<br />
</source><br />
<br />
And add it to the coreboot image. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add /path/to/gpxe/src/bin/10ec8167.rom pci10ec,8167.rom raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
As with VGA option ROMs, the gpxe option ROM may be compressed with LZMA. However, compression won't significantly reduce gpxe's size as it implements its own compression.<br />
<br />
In addition to gpxe, other option ROMs can be added in the same manner.<br />
<br />
== Adding sgabios support ==<br />
<br />
An [http://code.google.com/p/sgabios/ sgabios] option ROM can forward many VGA BIOS requests and keyboard events over a serial port. One can deploy it in addition to the primary VGA BIOS or by itself.<br />
<br />
If the target machine does not have a VGA adapter, then one should install sgabios. Most bootloaders (eg, GRUB) require a VGA BIOS in order to function properly &mdash; the sgabios ROM can fill this requirement.<br />
<br />
Place the sgabios ROM file in the '''vgaroms/''' directory of CBFS. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add /path/to/sgabios.bin vgaroms/sgabios.bin raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
When using sgabios, all the characters that SeaBIOS writes to the screen will be seen twice &mdash; once from SeaBIOS sending the character to the serial port and once from sgabios forwarding the character. To prevent the duplicates set the [[#Other Configuration items|config file]] '''etc/screen-and-debug''' to zero.<br />
<br />
== Adding a graphical "bootsplash" image ==<br />
<br />
SeaBIOS can show a custom [http://en.wikipedia.org/wiki/JPEG JPEG] image or [http://en.wikipedia.org/wiki/BMP_file_format BMP] image during bootup. To enable this, add the JPEG file to flash with the name '''bootsplash.jpg''' or BMP file as '''bootsplash.bmp'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add /path/to/image.jpg bootsplash.jpg raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
The size of the image determines the video mode to use for showing the image. Make sure the dimensions of the image exactly correspond to an available video mode (eg, 640x480, or 1024x768), otherwise it will not be displayed.<br />
<br />
SeaBIOS will show the image during the wait for the boot menu (if the boot menu has been disabled, users will not see the image). The image should probably have "Press F12 for boot menu" embedded in it so users know they can enter the normal SeaBIOS boot menu. By default, the boot menu prompt (and thus graphical image) is shown for 2.5 seconds. This can be customized via a [[#Other Configuration items|configuration parameter]].<br />
<br />
The JPEG viewer in SeaBIOS uses a simplified decoding algorithm. It supports most common JPEGs, but does not support all possible formats. Please see the [[#Trouble reporting|Trouble reporting]] section if a valid image isn't displayed properly.<br />
<br />
== Adding payloads ==<br />
<br />
Most [[Payloads|payloads]] can also be launched from SeaBIOS. To add a payload, build the corresponding .elf file and then add it to the '''coreboot.rom''' file in the '''img/''' directory. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add-payload /path/to/payload.elf img/MyPayload l<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
During boot, one can press the '''F12''' key to get a boot menu. SeaBIOS will show all files in the '''img/''' directory, and one can instruct SeaBIOS to run them.<br />
<br />
SeaBIOS supports both uncompressed and LZMA compressed payloads.<br />
<br />
== Adding a floppy image ==<br />
<br />
It is possible to embed an image of a floppy in flash. SeaBIOS can then boot from and redirect floppy BIOS calls to the flash image. This is mainly useful for legacy software (such as DOS utilities). To use this feature, place a floppy image into the CBFS directory '''floppyimg/'''. For example:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/myfloppy.img > myfloppy.img.lzma<br />
$ ./build/cbfstool coreboot.rom add myfloppy.img.lzma floppyimg/MyFloppy.lzma raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
Both uncompressed and LZMA compressed images are supported. Several floppy formats are available: 360K, 1.2MB, 720K, 1.44MB, 2.88MB, 160K, 180K, 320K.<br />
<br />
The floppy image will appear as writable to the system, however all writes are discarded on reboot.<br />
<br />
When using this system, SeaBIOS reserves high-memory to store the floppy. The reserved memory is then no longer available for OS use, so this feature should only be used when needed.<br />
<br />
== Configuring boot order ==<br />
<br />
Place a file in CBFS with the name '''bootorder''' to configure the boot up order. The file should be ASCII text and contain one line per boot method. The description of each boot method follows an [https://secure.wikimedia.org/wikipedia/en/wiki/Open_firmware Open Firmware] device path format. SeaBIOS will attempt to boot from each item in the file &mdash; first line of the file first.<br />
<br />
The easiest way to find the available boot methods is to look for "Searching bootorder for" in the SeaBIOS serial output. For example, one may see lines similar to:<br />
<br />
Searching bootorder for: /pci@i0cf8/*@f/drive@1/disk@0<br />
Searching bootorder for: /pci@i0cf8/*@f,1/drive@2/disk@1<br />
Searching bootorder for: /pci@i0cf8/usb@10,4/*@2<br />
<br />
The above represents the patterns SeaBIOS will search for in the bootorder file. However, it's safe to just copy and paste the pattern into bootorder. For example, the file:<br />
<br />
/pci@i0cf8/usb@10,4/*@2<br />
/pci@i0cf8/*@f/drive@1/disk@0<br />
<br />
will instruct SeaBIOS to attempt to boot from the given USB drive first and then attempt the given ATA harddrive second.<br />
<br />
Once a file has been created, add it to CBFS with the name '''bootorder'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add mybootlist.txt bootorder raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
== Other Configuration items ==<br />
<br />
Additional configuration options are available in the CBFS '''etc/''' directory. For example, to set the duration of the boot menu to five and a half seconds, one would do the following:<br />
<br />
<source lang="bash"><br />
$ /path/to/seabios/tools/encodeint.py boot-menu-wait 5500<br />
$ ./build/cbfstool coreboot.rom add boot-menu-wait etc/boot-menu-wait raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
The SeaBIOS tool '''tools/encodeint.py''' will create a litte-endian encoded binary integer which can be placed into a CBFS file.<br />
<br />
{| border=1<br />
|+ Configuration variables<br />
|-<br />
! Filename !! Description<br />
|-<br />
| boot-menu-wait || Amount of time (in milliseconds) to wait at the boot menu prompt before selecting the default boot.<br />
|-<br />
| extra-pci-roots || If the target machine has multiple independent root buses set this to a positive value. The SeaBIOS PCI probe will then search for the given number of extra root buses.<br />
|-<br />
| ps2-keyboard-spinup || Some PS2 keyboards don't respond to commands immediately after powering on. One may specify the amount of time (in milliseconds) here to allow as additional time for the keyboard to become responsive.<br />
|-<br />
| optionroms-checksum || Option ROMs are required to have correct checksums. However, some option ROMs in the wild don't correctly follow the specifications and have bad checksums. Set this to a zero value to allow SeaBIOS to execute them anyways.<br />
|-<br />
| s3-resume-vga-init || Set this to a non-zero value to instruct SeaBIOS to run the vga rom on an S3 resume.<br />
|-<br />
| screen-and-debug || Set this to a zero value to instruct SeaBIOS to not write characters it sends to the screen to the debug ports. This can be useful when using [[#Adding sgabios support|sgabios]].<br />
|-<br />
| boot-fail-wait || If no boot devices are found SeaBIOS will reboot after 60 seconds. Set this to the amount of time (in milliseconds) to customize the reboot delay or set to -1 to disable rebooting when no boot devices are found. (This setting is only in git versions after 20120601.)<br />
|}<br />
<br />
= Trouble reporting =<br />
<br />
If you are experiencing problems with SeaBIOS, it's useful to increase the debugging level. This is done by running '''make menuconfig''' and setting '''CONFIG_DEBUG_LEVEL''' to a higher value. A debug level of 8 will show a lot of diagnostic information without flooding the serial port (levels above 8 will frequently cause too much data).<br />
<br />
To report an issue, please collect the serial boot log with SeaBIOS set to a debug level of 8 and forward the full log along with a description of the problem to the coreboot [[Mailinglist|mailing list]].</div>KevinOConnorhttps://www.coreboot.org/index.php?title=SeaBIOS&diff=11096SeaBIOS2012-06-09T13:25:34Z<p>KevinOConnor: /* Adding sgabios support */ Old CONFIG_SCREEN_AND_DEBUG no longer present</p>
<hr />
<div>[http://www.seabios.org '''SeaBIOS'''] is an open-source legacy BIOS implementation which can be used as a coreboot [[Payloads|payload]]. It implements the standard [https://secure.wikimedia.org/wikipedia/en/wiki/BIOS BIOS] calling interfaces that a typical x86 proprietary BIOS implements.<br />
<br />
This page describes using SeaBIOS with coreboot. SeaBIOS can also run natively in [[QEMU]] and [http://bochs.sourceforge.net/ bochs] &mdash; see the [http://git.linuxtogo.org/?p=kevin/seabios.git;a=blob;f=README;hb=HEAD SeaBIOS README] file for information on non-coreboot uses.<br />
<br />
= Use cases =<br />
<br />
Any software requiring 16-bit BIOS services benefits from SeaBIOS (eg, Windows and DOS). SeaBIOS also enables booting Linux out of the box (using standard boot-loaders like GRUB and Syslinux).<br />
<br />
SeaBIOS supports booting from ATA hard drives, ATAPI CDROMs, USB hard drives, USB CDROMs, payloads in flash, and from [http://en.wikipedia.org/wiki/Option_ROM Option ROMs] (eg, SCSI or network cards). SeaBIOS can initialize and use a PS/2 keyboard or USB keyboard.<br />
<br />
== Windows ==<br />
<br />
SeaBIOS has been tested with Windows XP, Windows 2008, Windows Vista (64/32 bit), Windows 7 (32 bit and 64 bit).<br />
<br />
However, Windows has a very strict ACPI interpreter, and many coreboot boards do not have a complete [[ACPI in coreboot|ACPI definition]]. As a result, many coreboot boards will fail during Windows boot (eg, it may fail with a '''STOP 0xA5''' code).<br />
<br />
So far [[ASUS M2V-MX SE]] and [[GIGABYTE GA-M57SLI-S4]] have known good working ACPI and are able to boot XP/Vista/Windows 7. Please ask on the [[Mailinglist|mailing list]] for the status of other boards/chipsets.<br />
<br />
== Linux ==<br />
<br />
SeaBIOS has been tested with GRUB, LILO, and Syslinux. Linux booting works well.<br />
<br />
== Other ==<br />
<br />
SeaBIOS has also been tested with FreeDOS, NetBSD, and OpenBSD.<br />
<br />
Because SeaBIOS implements the standard x86 BIOS interfaces, it is expected many other operating systems and boot-loaders will work.<br />
<br />
= Building =<br />
<br />
== Building via coreboot's menuconfig ==<br />
<br />
Probably the easiest way to use SeaBIOS as coreboot payload is to simply use the coreboot build process, which downloads and builds SeaBIOS as payload by default nowadays. You just have to run the following in your coreboot checkout:<br />
<br />
<source lang="bash"><br />
$ make menuconfig<br />
$ make<br />
</source><br />
<br />
Both SeaBIOS and coreboot will be built, and SeaBIOS will be added as payload to the '''coreboot.rom''' image that is being built.<br />
<br />
== Manual build ==<br />
<br />
One can download the latest version of SeaBIOS through a git repository:<br />
<br />
<source lang="bash"><br />
$ git clone git://git.seabios.org/seabios.git seabios<br />
$ cd seabios<br />
</source><br />
<br />
There's also a [http://code.coreboot.org/p/seabios/source/changes/master/ gitweb] facility to browse the latest source code online.<br />
<br />
Run '''make menuconfig''' and set the following variables:<br />
<br />
* CONFIG_COREBOOT 1<br />
* CONFIG_DEBUG_SERIAL 1<br />
<br />
Then:<br />
<br />
<source lang="bash"><br />
$ make<br />
</source><br />
<br />
The final SeaBIOS payload file is '''out/bios.bin.elf'''.<br />
<br />
== coreboot ==<br />
<br />
For best results, configure coreboot with '''CONFIG_WRITE_HIGH_TABLES''' and '''CONFIG_VGA_BRIDGE_SETUP''' both enabled, and '''CONFIG_VGA_ROM_RUN''' and '''CONFIG_PCI_ROM_RUN''' both disabled.<br />
<br />
Finally, configure the SeaBIOS '''out/bios.bin.elf''' file as the coreboot payload and build coreboot. The resulting '''coreboot.rom''' file will contain both SeaBIOS and coreboot, and it can be flashed to a ROM chip.<br />
<br />
= SeaBIOS and CBFS =<br />
<br />
SeaBIOS can read the coreboot flash filesystem and extract files.<br />
<br />
When SeaBIOS scans the target machine's PCI devices, it will recognize option ROMs in CBFS that have the form '''pciVVVV,DDDD.rom'''. It will also run any file in the directory '''vgaroms/''' as a VGA option ROM not specific to a device and files in '''genroms/''' as a generic option ROM not specific to a device. In the above cases, SeaBIOS will recognize files with a '''.lzma''' suffix, and automatically decompress them (eg, '''pci1106,3344.rom.lzma''' and '''vgaroms/sgabios.bin.lzma''').<br />
<br />
SeaBIOS can also load a graphical bootsplash image from '''bootsplash.jpg''', payloads found in the CBFS directory '''img/''', and floppy images found in the '''floppyimg/''' directory.<br />
<br />
Further, SeaBIOS can obtain configuration information from CBFS. A file '''bootorder''' determines the order of devices and methods to attempt to boot the system from. Additional configuration items may be found in the CBFS '''etc/''' directory.<br />
<br />
The examples below show some common uses of these features.<br />
<br />
== Adding a VGA option ROM ==<br />
<br />
It is frequently necessary to add a VGA option ROM to CBFS in order to use a VGA adapter that is built-in to a motherboard. Note, VGA adapters on external cards (PCI, AGP, PCIe) do not require this step as SeaBIOS will automatically extract the VGA BIOS directly from the card. For machines without a VGA adapter, please follow the [[#Adding sgabios support|sgabios instructions]] below.<br />
<br />
The first step is to find the vendor and device ID of the built-in VGA adapter. This information can be found from '''lspci''':<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
01:00.0 VGA compatible controller [0300]: VIA Technologies, Inc. UniChrome Pro IGP ['''1106:3344'''] (rev 01) (prog-if 00 [VGA controller])<br />
</source><br />
<br />
In the above example, the VGA vendor/device ID is '''1106:3344'''. [[VGA support#How_to_retrieve_a_good_video_bios|Obtain the VGA ROM]] (eg, '''vgabios.bin''') and add it to the ROM with:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add /path/to/vgabios.bin pci1106,3344.rom raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
Alternatively, SeaBIOS supports LZMA compressed option ROMs. Use the following to add a compressed option ROM instead:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/vgabios.bin > vgabios.bin.lzma<br />
$ ./build/cbfstool coreboot.rom add vgabios.bin.lzma pci1106,3344.rom.lzma raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
After the above is done, one can write the '''coreboot.rom''' file to flash. SeaBIOS will extract the VGA ROM and run it during boot.<br />
<br />
== Adding gpxe support ==<br />
<br />
A [[GPXE|gpxe]] option ROM can nicely complement SeaBIOS and coreboot by adding network boot support. Adding gpxe is similar to [[#Adding a VGA option ROM]]. The first step is to find the Ethernet vendor/device ID. For example:<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
00:09.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet ['''10ec:8167'''] (rev 10)<br />
</source><br />
<br />
Then one can build a gpxe option ROM. For example:<br />
<br />
<source lang="bash"><br />
$ cd /path/to/gpxe/src/<br />
$ make bin/10ec8167.rom<br />
</source><br />
<br />
And add it to the coreboot image. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add /path/to/gpxe/src/bin/10ec8167.rom pci10ec,8167.rom raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
As with VGA option ROMs, the gpxe option ROM may be compressed with LZMA. However, compression won't significantly reduce gpxe's size as it implements its own compression.<br />
<br />
In addition to gpxe, other option ROMs can be added in the same manner.<br />
<br />
== Adding sgabios support ==<br />
<br />
An [http://code.google.com/p/sgabios/ sgabios] option ROM can forward many VGA BIOS requests and keyboard events over a serial port. One can deploy it in addition to the primary VGA BIOS or by itself.<br />
<br />
If the target machine does not have a VGA adapter, then one should install sgabios. Most bootloaders (eg, GRUB) require a VGA BIOS in order to function properly &mdash; the sgabios ROM can fill this requirement.<br />
<br />
Place the sgabios ROM file in the '''vgaroms/''' directory of CBFS. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add /path/to/sgabios.bin vgaroms/sgabios.bin raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
When using sgabios, all the characters that SeaBIOS writes to the screen will be seen twice &mdash; once from SeaBIOS sending the character to the serial port and once from sgabios forwarding the character. To prevent the duplicates set the [[#Other Configuration items|config file]] '''etc/screen-and-debug''' to zero.<br />
<br />
== Adding a graphical "bootsplash" image ==<br />
<br />
SeaBIOS can show a custom [http://en.wikipedia.org/wiki/JPEG JPEG] image or [http://en.wikipedia.org/wiki/BMP_file_format BMP] image during bootup. To enable this, add the JPEG file to flash with the name '''bootsplash.jpg''' or BMP file as '''bootsplash.bmp'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add /path/to/image.jpg bootsplash.jpg raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
The size of the image determines the video mode to use for showing the image. Make sure the dimensions of the image exactly correspond to an available video mode (eg, 640x480, or 1024x768), otherwise it will not be displayed.<br />
<br />
SeaBIOS will show the image during the wait for the boot menu (if the boot menu has been disabled, users will not see the image). The image should probably have "Press F12 for boot menu" embedded in it so users know they can enter the normal SeaBIOS boot menu. By default, the boot menu prompt (and thus graphical image) is shown for 2.5 seconds. This can be customized via a [[#Other Configuration items|configuration parameter]].<br />
<br />
The JPEG viewer in SeaBIOS uses a simplified decoding algorithm. It supports most common JPEGs, but does not support all possible formats. Please see the [[#Trouble reporting|Trouble reporting]] section if a valid image isn't displayed properly.<br />
<br />
== Adding payloads ==<br />
<br />
Most [[Payloads|payloads]] can also be launched from SeaBIOS. To add a payload, build the corresponding .elf file and then add it to the '''coreboot.rom''' file in the '''img/''' directory. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add-payload /path/to/payload.elf img/MyPayload l<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
During boot, one can press the '''F12''' key to get a boot menu. SeaBIOS will show all files in the '''img/''' directory, and one can instruct SeaBIOS to run them.<br />
<br />
SeaBIOS supports both uncompressed and LZMA compressed payloads.<br />
<br />
== Adding a floppy image ==<br />
<br />
It is possible to embed an image of a floppy in flash. SeaBIOS can then boot from and redirect floppy BIOS calls to the flash image. This is mainly useful for legacy software (such as DOS utilities). To use this feature, place a floppy image into the CBFS directory '''floppyimg/'''. For example:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/myfloppy.img > myfloppy.img.lzma<br />
$ ./build/cbfstool coreboot.rom add myfloppy.img.lzma floppyimg/MyFloppy.lzma raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
Both uncompressed and LZMA compressed images are supported. Several floppy formats are available: 360K, 1.2MB, 720K, 1.44MB, 2.88MB, 160K, 180K, 320K.<br />
<br />
The floppy image will appear as writable to the system, however all writes are discarded on reboot.<br />
<br />
When using this system, SeaBIOS reserves high-memory to store the floppy. The reserved memory is then no longer available for OS use, so this feature should only be used when needed.<br />
<br />
== Configuring boot order ==<br />
<br />
Place a file in CBFS with the name '''bootorder''' to configure the boot up order. The file should be ASCII text and contain one line per boot method. The description of each boot method follows an [https://secure.wikimedia.org/wikipedia/en/wiki/Open_firmware Open Firmware] device path format. SeaBIOS will attempt to boot from each item in the file &mdash; first line of the file first.<br />
<br />
The easiest way to find the available boot methods is to look for "Searching bootorder for" in the SeaBIOS serial output. For example, one may see lines similar to:<br />
<br />
Searching bootorder for: /pci@i0cf8/*@f/drive@1/disk@0<br />
Searching bootorder for: /pci@i0cf8/*@f,1/drive@2/disk@1<br />
Searching bootorder for: /pci@i0cf8/usb@10,4/*@2<br />
<br />
The above represents the patterns SeaBIOS will search for in the bootorder file. However, it's safe to just copy and paste the pattern into bootorder. For example, the file:<br />
<br />
/pci@i0cf8/usb@10,4/*@2<br />
/pci@i0cf8/*@f/drive@1/disk@0<br />
<br />
will instruct SeaBIOS to attempt to boot from the given USB drive first and then attempt the given ATA harddrive second.<br />
<br />
Once a file has been created, add it to CBFS with the name '''bootorder'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add mybootlist.txt bootorder raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
== Other Configuration items ==<br />
<br />
Additional configuration options are available in the CBFS '''etc/''' directory. For example, to set the duration of the boot menu to five and a half seconds, one would do the following:<br />
<br />
<source lang="bash"><br />
$ /path/to/seabios/tools/encodeint.py boot-menu-wait 5500<br />
$ ./build/cbfstool coreboot.rom add boot-menu-wait etc/boot-menu-wait raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
The SeaBIOS tool '''tools/encodeint.py''' will create a litte-endian encoded binary integer which can be placed into a CBFS file.<br />
<br />
{| border=1<br />
|+ Configuration variables<br />
|-<br />
! Filename !! Description<br />
|-<br />
| boot-menu-wait || Amount of time (in milliseconds) to wait at the boot menu prompt before selecting the default boot.<br />
|-<br />
| extra-pci-roots || If the target machine has multiple independent root buses set this to a positive value. The SeaBIOS PCI probe will then search for the given number of extra root buses.<br />
|-<br />
| ps2-keyboard-spinup || Some PS2 keyboards don't respond to commands immediately after powering on. One may specify the amount of time (in milliseconds) here to allow as additional time for the keyboard to become responsive.<br />
|-<br />
| optionroms-checksum || Option ROMs are required to have correct checksums. However, some option ROMs in the wild don't correctly follow the specifications and have bad checksums. Set this to a zero value to allow SeaBIOS to execute them anyways.<br />
|-<br />
| s3-resume-vga-init || Set this to a non-zero value to instruct SeaBIOS to run the vga rom on an S3 resume.<br />
|-<br />
| screen-and-debug || Set this to a zero value to instruct SeaBIOS to not write characters it sends to the screen to the debug ports. This can be useful when using [[#Adding sgabios support|sgabios]].<br />
|-<br />
| boot-fail-wait || If no boot devices are found SeaBIOS will reboot after 60 seconds. Set this to the amount of time (in milliseconds) to customize the reboot delay or set to -1 to disable rebooting when no boot devices are found. (This setting is only in git versions after 20120601.)<br />
|}<br />
<br />
= Trouble reporting =<br />
<br />
If you are experiencing problems with SeaBIOS, it's useful to increase the debugging level. This is done by running '''make menuconfig''' and setting '''CONFIG_DEBUG_LEVEL''' to a higher value. A debug level of 8 will show a lot of diagnostic information without flooding the serial port (levels above 8 will frequently cause too much data).<br />
<br />
To report an issue, please collect the serial boot log with SeaBIOS set to a debug level of 8 and forward the full log along with a description of the problem to the coreboot [[Mailinglist|mailing list]].</div>KevinOConnorhttps://www.coreboot.org/index.php?title=SeaBIOS&diff=11095SeaBIOS2012-06-09T13:23:08Z<p>KevinOConnor: /* Adding a graphical "bootsplash" image */ Note BMPs and config parameter system.</p>
<hr />
<div>[http://www.seabios.org '''SeaBIOS'''] is an open-source legacy BIOS implementation which can be used as a coreboot [[Payloads|payload]]. It implements the standard [https://secure.wikimedia.org/wikipedia/en/wiki/BIOS BIOS] calling interfaces that a typical x86 proprietary BIOS implements.<br />
<br />
This page describes using SeaBIOS with coreboot. SeaBIOS can also run natively in [[QEMU]] and [http://bochs.sourceforge.net/ bochs] &mdash; see the [http://git.linuxtogo.org/?p=kevin/seabios.git;a=blob;f=README;hb=HEAD SeaBIOS README] file for information on non-coreboot uses.<br />
<br />
= Use cases =<br />
<br />
Any software requiring 16-bit BIOS services benefits from SeaBIOS (eg, Windows and DOS). SeaBIOS also enables booting Linux out of the box (using standard boot-loaders like GRUB and Syslinux).<br />
<br />
SeaBIOS supports booting from ATA hard drives, ATAPI CDROMs, USB hard drives, USB CDROMs, payloads in flash, and from [http://en.wikipedia.org/wiki/Option_ROM Option ROMs] (eg, SCSI or network cards). SeaBIOS can initialize and use a PS/2 keyboard or USB keyboard.<br />
<br />
== Windows ==<br />
<br />
SeaBIOS has been tested with Windows XP, Windows 2008, Windows Vista (64/32 bit), Windows 7 (32 bit and 64 bit).<br />
<br />
However, Windows has a very strict ACPI interpreter, and many coreboot boards do not have a complete [[ACPI in coreboot|ACPI definition]]. As a result, many coreboot boards will fail during Windows boot (eg, it may fail with a '''STOP 0xA5''' code).<br />
<br />
So far [[ASUS M2V-MX SE]] and [[GIGABYTE GA-M57SLI-S4]] have known good working ACPI and are able to boot XP/Vista/Windows 7. Please ask on the [[Mailinglist|mailing list]] for the status of other boards/chipsets.<br />
<br />
== Linux ==<br />
<br />
SeaBIOS has been tested with GRUB, LILO, and Syslinux. Linux booting works well.<br />
<br />
== Other ==<br />
<br />
SeaBIOS has also been tested with FreeDOS, NetBSD, and OpenBSD.<br />
<br />
Because SeaBIOS implements the standard x86 BIOS interfaces, it is expected many other operating systems and boot-loaders will work.<br />
<br />
= Building =<br />
<br />
== Building via coreboot's menuconfig ==<br />
<br />
Probably the easiest way to use SeaBIOS as coreboot payload is to simply use the coreboot build process, which downloads and builds SeaBIOS as payload by default nowadays. You just have to run the following in your coreboot checkout:<br />
<br />
<source lang="bash"><br />
$ make menuconfig<br />
$ make<br />
</source><br />
<br />
Both SeaBIOS and coreboot will be built, and SeaBIOS will be added as payload to the '''coreboot.rom''' image that is being built.<br />
<br />
== Manual build ==<br />
<br />
One can download the latest version of SeaBIOS through a git repository:<br />
<br />
<source lang="bash"><br />
$ git clone git://git.seabios.org/seabios.git seabios<br />
$ cd seabios<br />
</source><br />
<br />
There's also a [http://code.coreboot.org/p/seabios/source/changes/master/ gitweb] facility to browse the latest source code online.<br />
<br />
Run '''make menuconfig''' and set the following variables:<br />
<br />
* CONFIG_COREBOOT 1<br />
* CONFIG_DEBUG_SERIAL 1<br />
<br />
Then:<br />
<br />
<source lang="bash"><br />
$ make<br />
</source><br />
<br />
The final SeaBIOS payload file is '''out/bios.bin.elf'''.<br />
<br />
== coreboot ==<br />
<br />
For best results, configure coreboot with '''CONFIG_WRITE_HIGH_TABLES''' and '''CONFIG_VGA_BRIDGE_SETUP''' both enabled, and '''CONFIG_VGA_ROM_RUN''' and '''CONFIG_PCI_ROM_RUN''' both disabled.<br />
<br />
Finally, configure the SeaBIOS '''out/bios.bin.elf''' file as the coreboot payload and build coreboot. The resulting '''coreboot.rom''' file will contain both SeaBIOS and coreboot, and it can be flashed to a ROM chip.<br />
<br />
= SeaBIOS and CBFS =<br />
<br />
SeaBIOS can read the coreboot flash filesystem and extract files.<br />
<br />
When SeaBIOS scans the target machine's PCI devices, it will recognize option ROMs in CBFS that have the form '''pciVVVV,DDDD.rom'''. It will also run any file in the directory '''vgaroms/''' as a VGA option ROM not specific to a device and files in '''genroms/''' as a generic option ROM not specific to a device. In the above cases, SeaBIOS will recognize files with a '''.lzma''' suffix, and automatically decompress them (eg, '''pci1106,3344.rom.lzma''' and '''vgaroms/sgabios.bin.lzma''').<br />
<br />
SeaBIOS can also load a graphical bootsplash image from '''bootsplash.jpg''', payloads found in the CBFS directory '''img/''', and floppy images found in the '''floppyimg/''' directory.<br />
<br />
Further, SeaBIOS can obtain configuration information from CBFS. A file '''bootorder''' determines the order of devices and methods to attempt to boot the system from. Additional configuration items may be found in the CBFS '''etc/''' directory.<br />
<br />
The examples below show some common uses of these features.<br />
<br />
== Adding a VGA option ROM ==<br />
<br />
It is frequently necessary to add a VGA option ROM to CBFS in order to use a VGA adapter that is built-in to a motherboard. Note, VGA adapters on external cards (PCI, AGP, PCIe) do not require this step as SeaBIOS will automatically extract the VGA BIOS directly from the card. For machines without a VGA adapter, please follow the [[#Adding sgabios support|sgabios instructions]] below.<br />
<br />
The first step is to find the vendor and device ID of the built-in VGA adapter. This information can be found from '''lspci''':<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
01:00.0 VGA compatible controller [0300]: VIA Technologies, Inc. UniChrome Pro IGP ['''1106:3344'''] (rev 01) (prog-if 00 [VGA controller])<br />
</source><br />
<br />
In the above example, the VGA vendor/device ID is '''1106:3344'''. [[VGA support#How_to_retrieve_a_good_video_bios|Obtain the VGA ROM]] (eg, '''vgabios.bin''') and add it to the ROM with:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add /path/to/vgabios.bin pci1106,3344.rom raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
Alternatively, SeaBIOS supports LZMA compressed option ROMs. Use the following to add a compressed option ROM instead:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/vgabios.bin > vgabios.bin.lzma<br />
$ ./build/cbfstool coreboot.rom add vgabios.bin.lzma pci1106,3344.rom.lzma raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
After the above is done, one can write the '''coreboot.rom''' file to flash. SeaBIOS will extract the VGA ROM and run it during boot.<br />
<br />
== Adding gpxe support ==<br />
<br />
A [[GPXE|gpxe]] option ROM can nicely complement SeaBIOS and coreboot by adding network boot support. Adding gpxe is similar to [[#Adding a VGA option ROM]]. The first step is to find the Ethernet vendor/device ID. For example:<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
00:09.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet ['''10ec:8167'''] (rev 10)<br />
</source><br />
<br />
Then one can build a gpxe option ROM. For example:<br />
<br />
<source lang="bash"><br />
$ cd /path/to/gpxe/src/<br />
$ make bin/10ec8167.rom<br />
</source><br />
<br />
And add it to the coreboot image. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add /path/to/gpxe/src/bin/10ec8167.rom pci10ec,8167.rom raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
As with VGA option ROMs, the gpxe option ROM may be compressed with LZMA. However, compression won't significantly reduce gpxe's size as it implements its own compression.<br />
<br />
In addition to gpxe, other option ROMs can be added in the same manner.<br />
<br />
== Adding sgabios support ==<br />
<br />
An [http://code.google.com/p/sgabios/ sgabios] option ROM can forward many VGA BIOS requests and keyboard events over a serial port. One can deploy it in addition to the primary VGA BIOS or by itself.<br />
<br />
If the target machine does not have a VGA adapter, then one should install sgabios. Most bootloaders (eg, GRUB) require a VGA BIOS in order to function properly &mdash; the sgabios ROM can fill this requirement.<br />
<br />
Place the sgabios ROM file in the '''vgaroms/''' directory of CBFS. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add /path/to/sgabios.bin vgaroms/sgabios.bin raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
When using sgabios, all the characters that SeaBIOS writes to the screen will be seen twice &mdash; once from SeaBIOS sending the character to the serial port and once from sgabios forwarding the character. To prevent the duplicates unset '''CONFIG_SCREEN_AND_DEBUG''' in '''make menuconfig''' or (on newer versions of SeaBIOS) set the [[#Other Configuration items|config file]] '''etc/screen-and-debug''' to zero.<br />
<br />
== Adding a graphical "bootsplash" image ==<br />
<br />
SeaBIOS can show a custom [http://en.wikipedia.org/wiki/JPEG JPEG] image or [http://en.wikipedia.org/wiki/BMP_file_format BMP] image during bootup. To enable this, add the JPEG file to flash with the name '''bootsplash.jpg''' or BMP file as '''bootsplash.bmp'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add /path/to/image.jpg bootsplash.jpg raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
The size of the image determines the video mode to use for showing the image. Make sure the dimensions of the image exactly correspond to an available video mode (eg, 640x480, or 1024x768), otherwise it will not be displayed.<br />
<br />
SeaBIOS will show the image during the wait for the boot menu (if the boot menu has been disabled, users will not see the image). The image should probably have "Press F12 for boot menu" embedded in it so users know they can enter the normal SeaBIOS boot menu. By default, the boot menu prompt (and thus graphical image) is shown for 2.5 seconds. This can be customized via a [[#Other Configuration items|configuration parameter]].<br />
<br />
The JPEG viewer in SeaBIOS uses a simplified decoding algorithm. It supports most common JPEGs, but does not support all possible formats. Please see the [[#Trouble reporting|Trouble reporting]] section if a valid image isn't displayed properly.<br />
<br />
== Adding payloads ==<br />
<br />
Most [[Payloads|payloads]] can also be launched from SeaBIOS. To add a payload, build the corresponding .elf file and then add it to the '''coreboot.rom''' file in the '''img/''' directory. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add-payload /path/to/payload.elf img/MyPayload l<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
During boot, one can press the '''F12''' key to get a boot menu. SeaBIOS will show all files in the '''img/''' directory, and one can instruct SeaBIOS to run them.<br />
<br />
SeaBIOS supports both uncompressed and LZMA compressed payloads.<br />
<br />
== Adding a floppy image ==<br />
<br />
It is possible to embed an image of a floppy in flash. SeaBIOS can then boot from and redirect floppy BIOS calls to the flash image. This is mainly useful for legacy software (such as DOS utilities). To use this feature, place a floppy image into the CBFS directory '''floppyimg/'''. For example:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/myfloppy.img > myfloppy.img.lzma<br />
$ ./build/cbfstool coreboot.rom add myfloppy.img.lzma floppyimg/MyFloppy.lzma raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
Both uncompressed and LZMA compressed images are supported. Several floppy formats are available: 360K, 1.2MB, 720K, 1.44MB, 2.88MB, 160K, 180K, 320K.<br />
<br />
The floppy image will appear as writable to the system, however all writes are discarded on reboot.<br />
<br />
When using this system, SeaBIOS reserves high-memory to store the floppy. The reserved memory is then no longer available for OS use, so this feature should only be used when needed.<br />
<br />
== Configuring boot order ==<br />
<br />
Place a file in CBFS with the name '''bootorder''' to configure the boot up order. The file should be ASCII text and contain one line per boot method. The description of each boot method follows an [https://secure.wikimedia.org/wikipedia/en/wiki/Open_firmware Open Firmware] device path format. SeaBIOS will attempt to boot from each item in the file &mdash; first line of the file first.<br />
<br />
The easiest way to find the available boot methods is to look for "Searching bootorder for" in the SeaBIOS serial output. For example, one may see lines similar to:<br />
<br />
Searching bootorder for: /pci@i0cf8/*@f/drive@1/disk@0<br />
Searching bootorder for: /pci@i0cf8/*@f,1/drive@2/disk@1<br />
Searching bootorder for: /pci@i0cf8/usb@10,4/*@2<br />
<br />
The above represents the patterns SeaBIOS will search for in the bootorder file. However, it's safe to just copy and paste the pattern into bootorder. For example, the file:<br />
<br />
/pci@i0cf8/usb@10,4/*@2<br />
/pci@i0cf8/*@f/drive@1/disk@0<br />
<br />
will instruct SeaBIOS to attempt to boot from the given USB drive first and then attempt the given ATA harddrive second.<br />
<br />
Once a file has been created, add it to CBFS with the name '''bootorder'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add mybootlist.txt bootorder raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
== Other Configuration items ==<br />
<br />
Additional configuration options are available in the CBFS '''etc/''' directory. For example, to set the duration of the boot menu to five and a half seconds, one would do the following:<br />
<br />
<source lang="bash"><br />
$ /path/to/seabios/tools/encodeint.py boot-menu-wait 5500<br />
$ ./build/cbfstool coreboot.rom add boot-menu-wait etc/boot-menu-wait raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
The SeaBIOS tool '''tools/encodeint.py''' will create a litte-endian encoded binary integer which can be placed into a CBFS file.<br />
<br />
{| border=1<br />
|+ Configuration variables<br />
|-<br />
! Filename !! Description<br />
|-<br />
| boot-menu-wait || Amount of time (in milliseconds) to wait at the boot menu prompt before selecting the default boot.<br />
|-<br />
| extra-pci-roots || If the target machine has multiple independent root buses set this to a positive value. The SeaBIOS PCI probe will then search for the given number of extra root buses.<br />
|-<br />
| ps2-keyboard-spinup || Some PS2 keyboards don't respond to commands immediately after powering on. One may specify the amount of time (in milliseconds) here to allow as additional time for the keyboard to become responsive.<br />
|-<br />
| optionroms-checksum || Option ROMs are required to have correct checksums. However, some option ROMs in the wild don't correctly follow the specifications and have bad checksums. Set this to a zero value to allow SeaBIOS to execute them anyways.<br />
|-<br />
| s3-resume-vga-init || Set this to a non-zero value to instruct SeaBIOS to run the vga rom on an S3 resume.<br />
|-<br />
| screen-and-debug || Set this to a zero value to instruct SeaBIOS to not write characters it sends to the screen to the debug ports. This can be useful when using [[#Adding sgabios support|sgabios]].<br />
|-<br />
| boot-fail-wait || If no boot devices are found SeaBIOS will reboot after 60 seconds. Set this to the amount of time (in milliseconds) to customize the reboot delay or set to -1 to disable rebooting when no boot devices are found. (This setting is only in git versions after 20120601.)<br />
|}<br />
<br />
= Trouble reporting =<br />
<br />
If you are experiencing problems with SeaBIOS, it's useful to increase the debugging level. This is done by running '''make menuconfig''' and setting '''CONFIG_DEBUG_LEVEL''' to a higher value. A debug level of 8 will show a lot of diagnostic information without flooding the serial port (levels above 8 will frequently cause too much data).<br />
<br />
To report an issue, please collect the serial boot log with SeaBIOS set to a debug level of 8 and forward the full log along with a description of the problem to the coreboot [[Mailinglist|mailing list]].</div>KevinOConnorhttps://www.coreboot.org/index.php?title=SeaBIOS&diff=11094SeaBIOS2012-06-09T13:16:30Z<p>KevinOConnor: /* Other Configuration items */ Add boot-fail-wait description; improve ps2-keyboard-spinup desc.</p>
<hr />
<div>[http://www.seabios.org '''SeaBIOS'''] is an open-source legacy BIOS implementation which can be used as a coreboot [[Payloads|payload]]. It implements the standard [https://secure.wikimedia.org/wikipedia/en/wiki/BIOS BIOS] calling interfaces that a typical x86 proprietary BIOS implements.<br />
<br />
This page describes using SeaBIOS with coreboot. SeaBIOS can also run natively in [[QEMU]] and [http://bochs.sourceforge.net/ bochs] &mdash; see the [http://git.linuxtogo.org/?p=kevin/seabios.git;a=blob;f=README;hb=HEAD SeaBIOS README] file for information on non-coreboot uses.<br />
<br />
= Use cases =<br />
<br />
Any software requiring 16-bit BIOS services benefits from SeaBIOS (eg, Windows and DOS). SeaBIOS also enables booting Linux out of the box (using standard boot-loaders like GRUB and Syslinux).<br />
<br />
SeaBIOS supports booting from ATA hard drives, ATAPI CDROMs, USB hard drives, USB CDROMs, payloads in flash, and from [http://en.wikipedia.org/wiki/Option_ROM Option ROMs] (eg, SCSI or network cards). SeaBIOS can initialize and use a PS/2 keyboard or USB keyboard.<br />
<br />
== Windows ==<br />
<br />
SeaBIOS has been tested with Windows XP, Windows 2008, Windows Vista (64/32 bit), Windows 7 (32 bit and 64 bit).<br />
<br />
However, Windows has a very strict ACPI interpreter, and many coreboot boards do not have a complete [[ACPI in coreboot|ACPI definition]]. As a result, many coreboot boards will fail during Windows boot (eg, it may fail with a '''STOP 0xA5''' code).<br />
<br />
So far [[ASUS M2V-MX SE]] and [[GIGABYTE GA-M57SLI-S4]] have known good working ACPI and are able to boot XP/Vista/Windows 7. Please ask on the [[Mailinglist|mailing list]] for the status of other boards/chipsets.<br />
<br />
== Linux ==<br />
<br />
SeaBIOS has been tested with GRUB, LILO, and Syslinux. Linux booting works well.<br />
<br />
== Other ==<br />
<br />
SeaBIOS has also been tested with FreeDOS, NetBSD, and OpenBSD.<br />
<br />
Because SeaBIOS implements the standard x86 BIOS interfaces, it is expected many other operating systems and boot-loaders will work.<br />
<br />
= Building =<br />
<br />
== Building via coreboot's menuconfig ==<br />
<br />
Probably the easiest way to use SeaBIOS as coreboot payload is to simply use the coreboot build process, which downloads and builds SeaBIOS as payload by default nowadays. You just have to run the following in your coreboot checkout:<br />
<br />
<source lang="bash"><br />
$ make menuconfig<br />
$ make<br />
</source><br />
<br />
Both SeaBIOS and coreboot will be built, and SeaBIOS will be added as payload to the '''coreboot.rom''' image that is being built.<br />
<br />
== Manual build ==<br />
<br />
One can download the latest version of SeaBIOS through a git repository:<br />
<br />
<source lang="bash"><br />
$ git clone git://git.seabios.org/seabios.git seabios<br />
$ cd seabios<br />
</source><br />
<br />
There's also a [http://code.coreboot.org/p/seabios/source/changes/master/ gitweb] facility to browse the latest source code online.<br />
<br />
Run '''make menuconfig''' and set the following variables:<br />
<br />
* CONFIG_COREBOOT 1<br />
* CONFIG_DEBUG_SERIAL 1<br />
<br />
Then:<br />
<br />
<source lang="bash"><br />
$ make<br />
</source><br />
<br />
The final SeaBIOS payload file is '''out/bios.bin.elf'''.<br />
<br />
== coreboot ==<br />
<br />
For best results, configure coreboot with '''CONFIG_WRITE_HIGH_TABLES''' and '''CONFIG_VGA_BRIDGE_SETUP''' both enabled, and '''CONFIG_VGA_ROM_RUN''' and '''CONFIG_PCI_ROM_RUN''' both disabled.<br />
<br />
Finally, configure the SeaBIOS '''out/bios.bin.elf''' file as the coreboot payload and build coreboot. The resulting '''coreboot.rom''' file will contain both SeaBIOS and coreboot, and it can be flashed to a ROM chip.<br />
<br />
= SeaBIOS and CBFS =<br />
<br />
SeaBIOS can read the coreboot flash filesystem and extract files.<br />
<br />
When SeaBIOS scans the target machine's PCI devices, it will recognize option ROMs in CBFS that have the form '''pciVVVV,DDDD.rom'''. It will also run any file in the directory '''vgaroms/''' as a VGA option ROM not specific to a device and files in '''genroms/''' as a generic option ROM not specific to a device. In the above cases, SeaBIOS will recognize files with a '''.lzma''' suffix, and automatically decompress them (eg, '''pci1106,3344.rom.lzma''' and '''vgaroms/sgabios.bin.lzma''').<br />
<br />
SeaBIOS can also load a graphical bootsplash image from '''bootsplash.jpg''', payloads found in the CBFS directory '''img/''', and floppy images found in the '''floppyimg/''' directory.<br />
<br />
Further, SeaBIOS can obtain configuration information from CBFS. A file '''bootorder''' determines the order of devices and methods to attempt to boot the system from. Additional configuration items may be found in the CBFS '''etc/''' directory.<br />
<br />
The examples below show some common uses of these features.<br />
<br />
== Adding a VGA option ROM ==<br />
<br />
It is frequently necessary to add a VGA option ROM to CBFS in order to use a VGA adapter that is built-in to a motherboard. Note, VGA adapters on external cards (PCI, AGP, PCIe) do not require this step as SeaBIOS will automatically extract the VGA BIOS directly from the card. For machines without a VGA adapter, please follow the [[#Adding sgabios support|sgabios instructions]] below.<br />
<br />
The first step is to find the vendor and device ID of the built-in VGA adapter. This information can be found from '''lspci''':<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
01:00.0 VGA compatible controller [0300]: VIA Technologies, Inc. UniChrome Pro IGP ['''1106:3344'''] (rev 01) (prog-if 00 [VGA controller])<br />
</source><br />
<br />
In the above example, the VGA vendor/device ID is '''1106:3344'''. [[VGA support#How_to_retrieve_a_good_video_bios|Obtain the VGA ROM]] (eg, '''vgabios.bin''') and add it to the ROM with:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add /path/to/vgabios.bin pci1106,3344.rom raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
Alternatively, SeaBIOS supports LZMA compressed option ROMs. Use the following to add a compressed option ROM instead:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/vgabios.bin > vgabios.bin.lzma<br />
$ ./build/cbfstool coreboot.rom add vgabios.bin.lzma pci1106,3344.rom.lzma raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
After the above is done, one can write the '''coreboot.rom''' file to flash. SeaBIOS will extract the VGA ROM and run it during boot.<br />
<br />
== Adding gpxe support ==<br />
<br />
A [[GPXE|gpxe]] option ROM can nicely complement SeaBIOS and coreboot by adding network boot support. Adding gpxe is similar to [[#Adding a VGA option ROM]]. The first step is to find the Ethernet vendor/device ID. For example:<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
00:09.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet ['''10ec:8167'''] (rev 10)<br />
</source><br />
<br />
Then one can build a gpxe option ROM. For example:<br />
<br />
<source lang="bash"><br />
$ cd /path/to/gpxe/src/<br />
$ make bin/10ec8167.rom<br />
</source><br />
<br />
And add it to the coreboot image. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add /path/to/gpxe/src/bin/10ec8167.rom pci10ec,8167.rom raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
As with VGA option ROMs, the gpxe option ROM may be compressed with LZMA. However, compression won't significantly reduce gpxe's size as it implements its own compression.<br />
<br />
In addition to gpxe, other option ROMs can be added in the same manner.<br />
<br />
== Adding sgabios support ==<br />
<br />
An [http://code.google.com/p/sgabios/ sgabios] option ROM can forward many VGA BIOS requests and keyboard events over a serial port. One can deploy it in addition to the primary VGA BIOS or by itself.<br />
<br />
If the target machine does not have a VGA adapter, then one should install sgabios. Most bootloaders (eg, GRUB) require a VGA BIOS in order to function properly &mdash; the sgabios ROM can fill this requirement.<br />
<br />
Place the sgabios ROM file in the '''vgaroms/''' directory of CBFS. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add /path/to/sgabios.bin vgaroms/sgabios.bin raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
When using sgabios, all the characters that SeaBIOS writes to the screen will be seen twice &mdash; once from SeaBIOS sending the character to the serial port and once from sgabios forwarding the character. To prevent the duplicates unset '''CONFIG_SCREEN_AND_DEBUG''' in '''make menuconfig''' or (on newer versions of SeaBIOS) set the [[#Other Configuration items|config file]] '''etc/screen-and-debug''' to zero.<br />
<br />
== Adding a graphical "bootsplash" image ==<br />
<br />
SeaBIOS can show a custom [http://en.wikipedia.org/wiki/JPEG JPEG] image during bootup. To enable this, add the JPEG file to flash with the name '''bootsplash.jpg'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add /path/to/image.jpg bootsplash.jpg raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
The size of the JPEG image determines the video mode to use for showing the image. Make sure the dimensions of the image exactly correspond to an available video mode (eg, 640x480, or 1024x768), otherwise it will not be displayed.<br />
<br />
SeaBIOS will show the image during the wait for the boot menu (if the boot menu has been disabled, users will not see the image). The image should probably have "Press F12 for boot menu" embedded in it so users know they can enter the normal SeaBIOS boot menu. By default, the boot menu prompt (and thus graphical image) is shown for 2.5 seconds. This can be customized by modifying SeaBIOS' '''CONFIG_BOOTMENU_WAIT''' in '''make menuconfig'''.<br />
<br />
The JPEG viewer in SeaBIOS uses a simplified decoding algorithm. It supports most common JPEGs, but does not support all possible formats. Please see the [[#Trouble reporting|Trouble reporting]] section if a valid image isn't displayed properly.<br />
<br />
== Adding payloads ==<br />
<br />
Most [[Payloads|payloads]] can also be launched from SeaBIOS. To add a payload, build the corresponding .elf file and then add it to the '''coreboot.rom''' file in the '''img/''' directory. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add-payload /path/to/payload.elf img/MyPayload l<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
During boot, one can press the '''F12''' key to get a boot menu. SeaBIOS will show all files in the '''img/''' directory, and one can instruct SeaBIOS to run them.<br />
<br />
SeaBIOS supports both uncompressed and LZMA compressed payloads.<br />
<br />
== Adding a floppy image ==<br />
<br />
It is possible to embed an image of a floppy in flash. SeaBIOS can then boot from and redirect floppy BIOS calls to the flash image. This is mainly useful for legacy software (such as DOS utilities). To use this feature, place a floppy image into the CBFS directory '''floppyimg/'''. For example:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/myfloppy.img > myfloppy.img.lzma<br />
$ ./build/cbfstool coreboot.rom add myfloppy.img.lzma floppyimg/MyFloppy.lzma raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
Both uncompressed and LZMA compressed images are supported. Several floppy formats are available: 360K, 1.2MB, 720K, 1.44MB, 2.88MB, 160K, 180K, 320K.<br />
<br />
The floppy image will appear as writable to the system, however all writes are discarded on reboot.<br />
<br />
When using this system, SeaBIOS reserves high-memory to store the floppy. The reserved memory is then no longer available for OS use, so this feature should only be used when needed.<br />
<br />
== Configuring boot order ==<br />
<br />
Place a file in CBFS with the name '''bootorder''' to configure the boot up order. The file should be ASCII text and contain one line per boot method. The description of each boot method follows an [https://secure.wikimedia.org/wikipedia/en/wiki/Open_firmware Open Firmware] device path format. SeaBIOS will attempt to boot from each item in the file &mdash; first line of the file first.<br />
<br />
The easiest way to find the available boot methods is to look for "Searching bootorder for" in the SeaBIOS serial output. For example, one may see lines similar to:<br />
<br />
Searching bootorder for: /pci@i0cf8/*@f/drive@1/disk@0<br />
Searching bootorder for: /pci@i0cf8/*@f,1/drive@2/disk@1<br />
Searching bootorder for: /pci@i0cf8/usb@10,4/*@2<br />
<br />
The above represents the patterns SeaBIOS will search for in the bootorder file. However, it's safe to just copy and paste the pattern into bootorder. For example, the file:<br />
<br />
/pci@i0cf8/usb@10,4/*@2<br />
/pci@i0cf8/*@f/drive@1/disk@0<br />
<br />
will instruct SeaBIOS to attempt to boot from the given USB drive first and then attempt the given ATA harddrive second.<br />
<br />
Once a file has been created, add it to CBFS with the name '''bootorder'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add mybootlist.txt bootorder raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
== Other Configuration items ==<br />
<br />
Additional configuration options are available in the CBFS '''etc/''' directory. For example, to set the duration of the boot menu to five and a half seconds, one would do the following:<br />
<br />
<source lang="bash"><br />
$ /path/to/seabios/tools/encodeint.py boot-menu-wait 5500<br />
$ ./build/cbfstool coreboot.rom add boot-menu-wait etc/boot-menu-wait raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
The SeaBIOS tool '''tools/encodeint.py''' will create a litte-endian encoded binary integer which can be placed into a CBFS file.<br />
<br />
{| border=1<br />
|+ Configuration variables<br />
|-<br />
! Filename !! Description<br />
|-<br />
| boot-menu-wait || Amount of time (in milliseconds) to wait at the boot menu prompt before selecting the default boot.<br />
|-<br />
| extra-pci-roots || If the target machine has multiple independent root buses set this to a positive value. The SeaBIOS PCI probe will then search for the given number of extra root buses.<br />
|-<br />
| ps2-keyboard-spinup || Some PS2 keyboards don't respond to commands immediately after powering on. One may specify the amount of time (in milliseconds) here to allow as additional time for the keyboard to become responsive.<br />
|-<br />
| optionroms-checksum || Option ROMs are required to have correct checksums. However, some option ROMs in the wild don't correctly follow the specifications and have bad checksums. Set this to a zero value to allow SeaBIOS to execute them anyways.<br />
|-<br />
| s3-resume-vga-init || Set this to a non-zero value to instruct SeaBIOS to run the vga rom on an S3 resume.<br />
|-<br />
| screen-and-debug || Set this to a zero value to instruct SeaBIOS to not write characters it sends to the screen to the debug ports. This can be useful when using [[#Adding sgabios support|sgabios]].<br />
|-<br />
| boot-fail-wait || If no boot devices are found SeaBIOS will reboot after 60 seconds. Set this to the amount of time (in milliseconds) to customize the reboot delay or set to -1 to disable rebooting when no boot devices are found. (This setting is only in git versions after 20120601.)<br />
|}<br />
<br />
= Trouble reporting =<br />
<br />
If you are experiencing problems with SeaBIOS, it's useful to increase the debugging level. This is done by running '''make menuconfig''' and setting '''CONFIG_DEBUG_LEVEL''' to a higher value. A debug level of 8 will show a lot of diagnostic information without flooding the serial port (levels above 8 will frequently cause too much data).<br />
<br />
To report an issue, please collect the serial boot log with SeaBIOS set to a debug level of 8 and forward the full log along with a description of the problem to the coreboot [[Mailinglist|mailing list]].</div>KevinOConnorhttps://www.coreboot.org/index.php?title=SeaBIOS&diff=10901SeaBIOS2011-10-05T01:48:00Z<p>KevinOConnor: /* Other Configuration items */ Remove warning - now in released version.</p>
<hr />
<div>[http://www.seabios.org '''SeaBIOS'''] is an open-source legacy BIOS implementation which can be used as a coreboot [[Payloads|payload]]. It implements the standard [https://secure.wikimedia.org/wikipedia/en/wiki/BIOS BIOS] calling interfaces that a typical x86 proprietary BIOS implements.<br />
<br />
This page describes using SeaBIOS with coreboot. SeaBIOS can also run natively in [[QEMU]] and [http://bochs.sourceforge.net/ bochs] &mdash; see the [http://git.linuxtogo.org/?p=kevin/seabios.git;a=blob;f=README;hb=HEAD SeaBIOS README] file for information on non-coreboot uses.<br />
<br />
= Use cases =<br />
<br />
Any software requiring 16-bit BIOS services benefits from SeaBIOS (eg, Windows and DOS). SeaBIOS also enables booting Linux out of the box (using standard boot-loaders like GRUB and Syslinux).<br />
<br />
SeaBIOS supports booting from ATA hard drives, ATAPI CDROMs, USB hard drives, USB CDROMs, payloads in flash, and from [http://en.wikipedia.org/wiki/Option_ROM Option ROMs] (eg, SCSI or network cards). SeaBIOS can initialize and use a PS/2 keyboard or USB keyboard.<br />
<br />
== Windows ==<br />
<br />
SeaBIOS has been tested with Windows XP, Windows 2008, Windows Vista (64/32 bit), Windows 7 (32 bit and 64 bit).<br />
<br />
However, Windows has a very strict ACPI interpreter, and many coreboot boards do not have a complete [[ACPI in coreboot|ACPI definition]]. As a result, many coreboot boards will fail during Windows boot (eg, it may fail with a '''STOP 0xA5''' code).<br />
<br />
So far [[ASUS M2V-MX SE]] and [[GIGABYTE GA-M57SLI-S4]] have known good working ACPI and are able to boot XP/Vista/Windows 7. Please ask on the [[Mailinglist|mailing list]] for the status of other boards/chipsets.<br />
<br />
== Linux ==<br />
<br />
SeaBIOS has been tested with GRUB, LILO, and Syslinux. Linux booting works well.<br />
<br />
== Other ==<br />
<br />
SeaBIOS has also been tested with FreeDOS, NetBSD, and OpenBSD.<br />
<br />
Because SeaBIOS implements the standard x86 BIOS interfaces, it is expected many other operating systems and boot-loaders will work.<br />
<br />
= Building =<br />
<br />
== Building via coreboot's menuconfig ==<br />
<br />
Probably the easiest way to use SeaBIOS as coreboot payload is to simply use the coreboot build process, which downloads and builds SeaBIOS as payload by default nowadays. You just have to run the following in your coreboot checkout:<br />
<br />
<source lang="bash"><br />
$ make menuconfig<br />
$ make<br />
</source><br />
<br />
Both SeaBIOS and coreboot will be built, and SeaBIOS will be added as payload to the '''coreboot.rom''' image that is being built.<br />
<br />
== Manual build ==<br />
<br />
One can download the latest version of SeaBIOS through a git repository:<br />
<br />
<source lang="bash"><br />
$ git clone git://git.seabios.org/seabios.git seabios<br />
$ cd seabios<br />
</source><br />
<br />
There's also a [http://code.coreboot.org/p/seabios/source/changes/master/ gitweb] facility to browse the latest source code online.<br />
<br />
Run '''make menuconfig''' and set the following variables:<br />
<br />
* CONFIG_COREBOOT 1<br />
* CONFIG_DEBUG_SERIAL 1<br />
<br />
Then:<br />
<br />
<source lang="bash"><br />
$ make<br />
</source><br />
<br />
The final SeaBIOS payload file is '''out/bios.bin.elf'''.<br />
<br />
== coreboot ==<br />
<br />
For best results, configure coreboot with '''CONFIG_WRITE_HIGH_TABLES''' and '''CONFIG_VGA_BRIDGE_SETUP''' both enabled, and '''CONFIG_VGA_ROM_RUN''' and '''CONFIG_PCI_ROM_RUN''' both disabled.<br />
<br />
Finally, configure the SeaBIOS '''out/bios.bin.elf''' file as the coreboot payload and build coreboot. The resulting '''coreboot.rom''' file will contain both SeaBIOS and coreboot, and it can be flashed to a ROM chip.<br />
<br />
= SeaBIOS and CBFS =<br />
<br />
SeaBIOS can read the coreboot flash filesystem and extract files.<br />
<br />
When SeaBIOS scans the target machine's PCI devices, it will recognize option ROMs in CBFS that have the form '''pciVVVV,DDDD.rom'''. It will also run any file in the directory '''vgaroms/''' as a VGA option ROM not specific to a device and files in '''genroms/''' as a generic option ROM not specific to a device. In the above cases, SeaBIOS will recognize files with a '''.lzma''' suffix, and automatically decompress them (eg, '''pci1106,3344.rom.lzma''' and '''vgaroms/sgabios.bin.lzma''').<br />
<br />
SeaBIOS can also load a graphical bootsplash image from '''bootsplash.jpg''', payloads found in the CBFS directory '''img/''', and floppy images found in the '''floppyimg/''' directory.<br />
<br />
Further, SeaBIOS can obtain configuration information from CBFS. A file '''bootorder''' determines the order of devices and methods to attempt to boot the system from. Additional configuration items may be found in the CBFS '''etc/''' directory.<br />
<br />
The examples below show some common uses of these features.<br />
<br />
== Adding a VGA option ROM ==<br />
<br />
It is frequently necessary to add a VGA option ROM to CBFS in order to use a VGA adapter that is built-in to a motherboard. Note, VGA adapters on external cards (PCI, AGP, PCIe) do not require this step as SeaBIOS will automatically extract the VGA BIOS directly from the card. For machines without a VGA adapter, please follow the [[#Adding sgabios support|sgabios instructions]] below.<br />
<br />
The first step is to find the vendor and device ID of the built-in VGA adapter. This information can be found from '''lspci''':<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
01:00.0 VGA compatible controller [0300]: VIA Technologies, Inc. UniChrome Pro IGP ['''1106:3344'''] (rev 01) (prog-if 00 [VGA controller])<br />
</source><br />
<br />
In the above example, the VGA vendor/device ID is '''1106:3344'''. [[VGA support#How_to_retrieve_a_good_video_bios|Obtain the VGA ROM]] (eg, '''vgabios.bin''') and add it to the ROM with:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add /path/to/vgabios.bin pci1106,3344.rom raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
Alternatively, SeaBIOS supports LZMA compressed option ROMs. Use the following to add a compressed option ROM instead:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/vgabios.bin > vgabios.bin.lzma<br />
$ ./build/cbfstool coreboot.rom add vgabios.bin.lzma pci1106,3344.rom.lzma raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
After the above is done, one can write the '''coreboot.rom''' file to flash. SeaBIOS will extract the VGA ROM and run it during boot.<br />
<br />
== Adding gpxe support ==<br />
<br />
A [[GPXE|gpxe]] option ROM can nicely complement SeaBIOS and coreboot by adding network boot support. Adding gpxe is similar to [[#Adding a VGA option ROM]]. The first step is to find the Ethernet vendor/device ID. For example:<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
00:09.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet ['''10ec:8167'''] (rev 10)<br />
</source><br />
<br />
Then one can build a gpxe option ROM. For example:<br />
<br />
<source lang="bash"><br />
$ cd /path/to/gpxe/src/<br />
$ make bin/10ec8167.rom<br />
</source><br />
<br />
And add it to the coreboot image. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add /path/to/gpxe/src/bin/10ec8167.rom pci10ec,8167.rom raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
As with VGA option ROMs, the gpxe option ROM may be compressed with LZMA. However, compression won't significantly reduce gpxe's size as it implements its own compression.<br />
<br />
In addition to gpxe, other option ROMs can be added in the same manner.<br />
<br />
== Adding sgabios support ==<br />
<br />
An [http://code.google.com/p/sgabios/ sgabios] option ROM can forward many VGA BIOS requests and keyboard events over a serial port. One can deploy it in addition to the primary VGA BIOS or by itself.<br />
<br />
If the target machine does not have a VGA adapter, then one should install sgabios. Most bootloaders (eg, GRUB) require a VGA BIOS in order to function properly &mdash; the sgabios ROM can fill this requirement.<br />
<br />
Place the sgabios ROM file in the '''vgaroms/''' directory of CBFS. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add /path/to/sgabios.bin vgaroms/sgabios.bin raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
When using sgabios, all the characters that SeaBIOS writes to the screen will be seen twice &mdash; once from SeaBIOS sending the character to the serial port and once from sgabios forwarding the character. To prevent the duplicates unset '''CONFIG_SCREEN_AND_DEBUG''' in '''make menuconfig''' or (on newer versions of SeaBIOS) set the [[#Other Configuration items|config file]] '''etc/screen-and-debug''' to zero.<br />
<br />
== Adding a graphical "bootsplash" image ==<br />
<br />
SeaBIOS can show a custom [http://en.wikipedia.org/wiki/JPEG JPEG] image during bootup. To enable this, add the JPEG file to flash with the name '''bootsplash.jpg'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add /path/to/image.jpg bootsplash.jpg raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
The size of the JPEG image determines the video mode to use for showing the image. Make sure the dimensions of the image exactly correspond to an available video mode (eg, 640x480, or 1024x768), otherwise it will not be displayed.<br />
<br />
SeaBIOS will show the image during the wait for the boot menu (if the boot menu has been disabled, users will not see the image). The image should probably have "Press F12 for boot menu" embedded in it so users know they can enter the normal SeaBIOS boot menu. By default, the boot menu prompt (and thus graphical image) is shown for 2.5 seconds. This can be customized by modifying SeaBIOS' '''CONFIG_BOOTMENU_WAIT''' in '''make menuconfig'''.<br />
<br />
The JPEG viewer in SeaBIOS uses a simplified decoding algorithm. It supports most common JPEGs, but does not support all possible formats. Please see the [[#Trouble reporting|Trouble reporting]] section if a valid image isn't displayed properly.<br />
<br />
== Adding payloads ==<br />
<br />
Most [[Payloads|payloads]] can also be launched from SeaBIOS. To add a payload, build the corresponding .elf file and then add it to the '''coreboot.rom''' file in the '''img/''' directory. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add-payload /path/to/payload.elf img/MyPayload l<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
During boot, one can press the '''F12''' key to get a boot menu. SeaBIOS will show all files in the '''img/''' directory, and one can instruct SeaBIOS to run them.<br />
<br />
SeaBIOS supports both uncompressed and LZMA compressed payloads.<br />
<br />
== Adding a floppy image ==<br />
<br />
It is possible to embed an image of a floppy in flash. SeaBIOS can then boot from and redirect floppy BIOS calls to the flash image. This is mainly useful for legacy software (such as DOS utilities). To use this feature, place a floppy image into the CBFS directory '''floppyimg/'''. For example:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/myfloppy.img > myfloppy.img.lzma<br />
$ ./build/cbfstool coreboot.rom add myfloppy.img.lzma floppyimg/MyFloppy.lzma raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
Both uncompressed and LZMA compressed images are supported. Several floppy formats are available: 360K, 1.2MB, 720K, 1.44MB, 2.88MB, 160K, 180K, 320K.<br />
<br />
The floppy image will appear as writable to the system, however all writes are discarded on reboot.<br />
<br />
When using this system, SeaBIOS reserves high-memory to store the floppy. The reserved memory is then no longer available for OS use, so this feature should only be used when needed.<br />
<br />
== Configuring boot order ==<br />
<br />
Place a file in CBFS with the name '''bootorder''' to configure the boot up order. The file should be ASCII text and contain one line per boot method. The description of each boot method follows an [https://secure.wikimedia.org/wikipedia/en/wiki/Open_firmware Open Firmware] device path format. SeaBIOS will attempt to boot from each item in the file &mdash; first line of the file first.<br />
<br />
The easiest way to find the available boot methods is to look for "Searching bootorder for" in the SeaBIOS serial output. For example, one may see lines similar to:<br />
<br />
Searching bootorder for: /pci@i0cf8/*@f/drive@1/disk@0<br />
Searching bootorder for: /pci@i0cf8/*@f,1/drive@2/disk@1<br />
Searching bootorder for: /pci@i0cf8/usb@10,4/*@2<br />
<br />
The above represents the patterns SeaBIOS will search for in the bootorder file. However, it's safe to just copy and paste the pattern into bootorder. For example, the file:<br />
<br />
/pci@i0cf8/usb@10,4/*@2<br />
/pci@i0cf8/*@f/drive@1/disk@0<br />
<br />
will instruct SeaBIOS to attempt to boot from the given USB drive first and then attempt the given ATA harddrive second.<br />
<br />
Once a file has been created, add it to CBFS with the name '''bootorder'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add mybootlist.txt bootorder raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
== Other Configuration items ==<br />
<br />
Additional configuration options are available in the CBFS '''etc/''' directory. For example, to set the duration of the boot menu to five and a half seconds, one would do the following:<br />
<br />
<source lang="bash"><br />
$ /path/to/seabios/tools/encodeint.py boot-menu-wait 5500<br />
$ ./build/cbfstool coreboot.rom add boot-menu-wait etc/boot-menu-wait raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
The SeaBIOS tool '''tools/encodeint.py''' will create a litte-endian encoded binary integer which can be placed into a CBFS file.<br />
<br />
{| border=1<br />
|+ Configuration variables<br />
|-<br />
! Filename !! Description<br />
|-<br />
| boot-menu-wait || Amount of time (in milliseconds) to wait at the boot menu prompt before selecting the default boot.<br />
|-<br />
| extra-pci-roots || If the target machine has multiple independent root buses set this to a positive value. The SeaBIOS PCI probe will then search for the given number of extra root buses.<br />
|-<br />
| ps2-keyboard-spinup || Some PS2 keyboards don't respond to commands immediately after powering on. Specify a positive value here to allow additional time for the keyboard to become responsive.<br />
|-<br />
| optionroms-checksum || Option ROMs are required to have correct checksums. However, some option ROMs in the wild don't correctly follow the specifications and have bad checksums. Set this to a zero value to allow SeaBIOS to execute them anyways.<br />
|-<br />
| s3-resume-vga-init || Set this to a non-zero value to instruct SeaBIOS to run the vga rom on an S3 resume.<br />
|-<br />
| screen-and-debug || Set this to a zero value to instruct SeaBIOS to not write characters it sends to the screen to the debug ports. This can be useful when using [[#Adding sgabios support|sgabios]].<br />
|}<br />
<br />
= Trouble reporting =<br />
<br />
If you are experiencing problems with SeaBIOS, it's useful to increase the debugging level. This is done by running '''make menuconfig''' and setting '''CONFIG_DEBUG_LEVEL''' to a higher value. A debug level of 8 will show a lot of diagnostic information without flooding the serial port (levels above 8 will frequently cause too much data).<br />
<br />
To report an issue, please collect the serial boot log with SeaBIOS set to a debug level of 8 and forward the full log along with a description of the problem to the coreboot [[Mailinglist|mailing list]].</div>KevinOConnorhttps://www.coreboot.org/index.php?title=SeaBIOS&diff=10856SeaBIOS2011-07-09T14:34:49Z<p>KevinOConnor: /* SeaBIOS and CBFS */ Add info on new configuration file interface.</p>
<hr />
<div>[http://www.seabios.org '''SeaBIOS'''] is an open-source legacy BIOS implementation which can be used as a coreboot [[Payloads|payload]]. It implements the standard [https://secure.wikimedia.org/wikipedia/en/wiki/BIOS BIOS] calling interfaces that a typical x86 proprietary BIOS implements.<br />
<br />
This page describes using SeaBIOS with coreboot. SeaBIOS can also run natively in [[QEMU]] and [http://bochs.sourceforge.net/ bochs] &mdash; see the [http://git.linuxtogo.org/?p=kevin/seabios.git;a=blob;f=README;hb=HEAD SeaBIOS README] file for information on non-coreboot uses.<br />
<br />
= Use cases =<br />
<br />
Any software requiring 16-bit BIOS services benefits from SeaBIOS (eg, Windows and DOS). SeaBIOS also enables booting Linux out of the box (using standard boot-loaders like GRUB and Syslinux).<br />
<br />
SeaBIOS supports booting from ATA hard drives, ATAPI CDROMs, USB hard drives, USB CDROMs, payloads in flash, and from [http://en.wikipedia.org/wiki/Option_ROM Option ROMs] (eg, SCSI or network cards). SeaBIOS can initialize and use a PS/2 keyboard or USB keyboard.<br />
<br />
== Windows ==<br />
<br />
SeaBIOS has been tested with Windows XP, Windows 2008, Windows Vista (64/32 bit), Windows 7 (32 bit and 64 bit).<br />
<br />
However, Windows has a very strict ACPI interpreter, and many coreboot boards do not have a complete [[ACPI in coreboot|ACPI definition]]. As a result, many coreboot boards will fail during Windows boot (eg, it may fail with a '''STOP 0xA5''' code).<br />
<br />
So far [[ASUS M2V-MX SE]] and [[GIGABYTE GA-M57SLI-S4]] have known good working ACPI and are able to boot XP/Vista/Windows 7. Please ask on the [[Mailinglist|mailing list]] for the status of other boards/chipsets.<br />
<br />
== Linux ==<br />
<br />
SeaBIOS has been tested with GRUB, LILO, and Syslinux. Linux booting works well.<br />
<br />
== Other ==<br />
<br />
SeaBIOS has also been tested with FreeDOS, NetBSD, and OpenBSD.<br />
<br />
Because SeaBIOS implements the standard x86 BIOS interfaces, it is expected many other operating systems and boot-loaders will work.<br />
<br />
= Building =<br />
<br />
== Building via coreboot's menuconfig ==<br />
<br />
Probably the easiest way to use SeaBIOS as coreboot payload is to simply use the coreboot build process, which downloads and builds SeaBIOS as payload by default nowadays. You just have to run the following in your coreboot checkout:<br />
<br />
<source lang="bash"><br />
$ make menuconfig<br />
$ make<br />
</source><br />
<br />
Both SeaBIOS and coreboot will be built, and SeaBIOS will be added as payload to the '''coreboot.rom''' image that is being built.<br />
<br />
== Manual build ==<br />
<br />
One can download the latest version of SeaBIOS through a git repository:<br />
<br />
<source lang="bash"><br />
$ git clone git://git.seabios.org/seabios.git seabios<br />
$ cd seabios<br />
</source><br />
<br />
There's also a [http://code.coreboot.org/p/seabios/source/changes/master/ gitweb] facility to browse the latest source code online.<br />
<br />
Run '''make menuconfig''' and set the following variables:<br />
<br />
* CONFIG_COREBOOT 1<br />
* CONFIG_DEBUG_SERIAL 1<br />
<br />
Then:<br />
<br />
<source lang="bash"><br />
$ make<br />
</source><br />
<br />
The final SeaBIOS payload file is '''out/bios.bin.elf'''.<br />
<br />
== coreboot ==<br />
<br />
For best results, configure coreboot with '''CONFIG_WRITE_HIGH_TABLES''' and '''CONFIG_VGA_BRIDGE_SETUP''' both enabled, and '''CONFIG_VGA_ROM_RUN''' and '''CONFIG_PCI_ROM_RUN''' both disabled.<br />
<br />
Finally, configure the SeaBIOS '''out/bios.bin.elf''' file as the coreboot payload and build coreboot. The resulting '''coreboot.rom''' file will contain both SeaBIOS and coreboot, and it can be flashed to a ROM chip.<br />
<br />
= SeaBIOS and CBFS =<br />
<br />
SeaBIOS can read the coreboot flash filesystem and extract files.<br />
<br />
When SeaBIOS scans the target machine's PCI devices, it will recognize option ROMs in CBFS that have the form '''pciVVVV,DDDD.rom'''. It will also run any file in the directory '''vgaroms/''' as a VGA option ROM not specific to a device and files in '''genroms/''' as a generic option ROM not specific to a device. In the above cases, SeaBIOS will recognize files with a '''.lzma''' suffix, and automatically decompress them (eg, '''pci1106,3344.rom.lzma''' and '''vgaroms/sgabios.bin.lzma''').<br />
<br />
SeaBIOS can also load a graphical bootsplash image from '''bootsplash.jpg''', payloads found in the CBFS directory '''img/''', and floppy images found in the '''floppyimg/''' directory.<br />
<br />
Further, SeaBIOS can obtain configuration information from CBFS. A file '''bootorder''' determines the order of devices and methods to attempt to boot the system from. Additional configuration items may be found in the CBFS '''etc/''' directory.<br />
<br />
The examples below show some common uses of these features.<br />
<br />
== Adding a VGA option ROM ==<br />
<br />
It is frequently necessary to add a VGA option ROM to CBFS in order to use a VGA adapter that is built-in to a motherboard. Note, VGA adapters on external cards (PCI, AGP, PCIe) do not require this step as SeaBIOS will automatically extract the VGA BIOS directly from the card. For machines without a VGA adapter, please follow the [[#Adding sgabios support|sgabios instructions]] below.<br />
<br />
The first step is to find the vendor and device ID of the built-in VGA adapter. This information can be found from '''lspci''':<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
01:00.0 VGA compatible controller [0300]: VIA Technologies, Inc. UniChrome Pro IGP ['''1106:3344'''] (rev 01) (prog-if 00 [VGA controller])<br />
</source><br />
<br />
In the above example, the VGA vendor/device ID is '''1106:3344'''. [[VGA support#How_to_retrieve_a_good_video_bios|Obtain the VGA ROM]] (eg, '''vgabios.bin''') and add it to the ROM with:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add /path/to/vgabios.bin pci1106,3344.rom raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
Alternatively, SeaBIOS supports LZMA compressed option ROMs. Use the following to add a compressed option ROM instead:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/vgabios.bin > vgabios.bin.lzma<br />
$ ./build/cbfstool coreboot.rom add vgabios.bin.lzma pci1106,3344.rom.lzma raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
After the above is done, one can write the '''coreboot.rom''' file to flash. SeaBIOS will extract the VGA ROM and run it during boot.<br />
<br />
== Adding gpxe support ==<br />
<br />
A [[GPXE|gpxe]] option ROM can nicely complement SeaBIOS and coreboot by adding network boot support. Adding gpxe is similar to [[#Adding a VGA option ROM]]. The first step is to find the Ethernet vendor/device ID. For example:<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
00:09.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet ['''10ec:8167'''] (rev 10)<br />
</source><br />
<br />
Then one can build a gpxe option ROM. For example:<br />
<br />
<source lang="bash"><br />
$ cd /path/to/gpxe/src/<br />
$ make bin/10ec8167.rom<br />
</source><br />
<br />
And add it to the coreboot image. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add /path/to/gpxe/src/bin/10ec8167.rom pci10ec,8167.rom raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
As with VGA option ROMs, the gpxe option ROM may be compressed with LZMA. However, compression won't significantly reduce gpxe's size as it implements its own compression.<br />
<br />
In addition to gpxe, other option ROMs can be added in the same manner.<br />
<br />
== Adding sgabios support ==<br />
<br />
An [http://code.google.com/p/sgabios/ sgabios] option ROM can forward many VGA BIOS requests and keyboard events over a serial port. One can deploy it in addition to the primary VGA BIOS or by itself.<br />
<br />
If the target machine does not have a VGA adapter, then one should install sgabios. Most bootloaders (eg, GRUB) require a VGA BIOS in order to function properly &mdash; the sgabios ROM can fill this requirement.<br />
<br />
Place the sgabios ROM file in the '''vgaroms/''' directory of CBFS. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add /path/to/sgabios.bin vgaroms/sgabios.bin raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
When using sgabios, all the characters that SeaBIOS writes to the screen will be seen twice &mdash; once from SeaBIOS sending the character to the serial port and once from sgabios forwarding the character. To prevent the duplicates unset '''CONFIG_SCREEN_AND_DEBUG''' in '''make menuconfig''' or (on newer versions of SeaBIOS) set the [[#Other Configuration items|config file]] '''etc/screen-and-debug''' to zero.<br />
<br />
== Adding a graphical "bootsplash" image ==<br />
<br />
SeaBIOS can show a custom [http://en.wikipedia.org/wiki/JPEG JPEG] image during bootup. To enable this, add the JPEG file to flash with the name '''bootsplash.jpg'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add /path/to/image.jpg bootsplash.jpg raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
The size of the JPEG image determines the video mode to use for showing the image. Make sure the dimensions of the image exactly correspond to an available video mode (eg, 640x480, or 1024x768), otherwise it will not be displayed.<br />
<br />
SeaBIOS will show the image during the wait for the boot menu (if the boot menu has been disabled, users will not see the image). The image should probably have "Press F12 for boot menu" embedded in it so users know they can enter the normal SeaBIOS boot menu. By default, the boot menu prompt (and thus graphical image) is shown for 2.5 seconds. This can be customized by modifying SeaBIOS' '''CONFIG_BOOTMENU_WAIT''' in '''make menuconfig'''.<br />
<br />
The JPEG viewer in SeaBIOS uses a simplified decoding algorithm. It supports most common JPEGs, but does not support all possible formats. Please see the [[#Trouble reporting|Trouble reporting]] section if a valid image isn't displayed properly.<br />
<br />
== Adding payloads ==<br />
<br />
Most [[Payloads|payloads]] can also be launched from SeaBIOS. To add a payload, build the corresponding .elf file and then add it to the '''coreboot.rom''' file in the '''img/''' directory. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add-payload /path/to/payload.elf img/MyPayload l<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
During boot, one can press the '''F12''' key to get a boot menu. SeaBIOS will show all files in the '''img/''' directory, and one can instruct SeaBIOS to run them.<br />
<br />
SeaBIOS supports both uncompressed and LZMA compressed payloads.<br />
<br />
== Adding a floppy image ==<br />
<br />
It is possible to embed an image of a floppy in flash. SeaBIOS can then boot from and redirect floppy BIOS calls to the flash image. This is mainly useful for legacy software (such as DOS utilities). To use this feature, place a floppy image into the CBFS directory '''floppyimg/'''. For example:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/myfloppy.img > myfloppy.img.lzma<br />
$ ./build/cbfstool coreboot.rom add myfloppy.img.lzma floppyimg/MyFloppy.lzma raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
Both uncompressed and LZMA compressed images are supported. Several floppy formats are available: 360K, 1.2MB, 720K, 1.44MB, 2.88MB, 160K, 180K, 320K.<br />
<br />
The floppy image will appear as writable to the system, however all writes are discarded on reboot.<br />
<br />
When using this system, SeaBIOS reserves high-memory to store the floppy. The reserved memory is then no longer available for OS use, so this feature should only be used when needed.<br />
<br />
== Configuring boot order ==<br />
<br />
Place a file in CBFS with the name '''bootorder''' to configure the boot up order. The file should be ASCII text and contain one line per boot method. The description of each boot method follows an [https://secure.wikimedia.org/wikipedia/en/wiki/Open_firmware Open Firmware] device path format. SeaBIOS will attempt to boot from each item in the file &mdash; first line of the file first.<br />
<br />
The easiest way to find the available boot methods is to look for "Searching bootorder for" in the SeaBIOS serial output. For example, one may see lines similar to:<br />
<br />
Searching bootorder for: /pci@i0cf8/*@f/drive@1/disk@0<br />
Searching bootorder for: /pci@i0cf8/*@f,1/drive@2/disk@1<br />
Searching bootorder for: /pci@i0cf8/usb@10,4/*@2<br />
<br />
The above represents the patterns SeaBIOS will search for in the bootorder file. However, it's safe to just copy and paste the pattern into bootorder. For example, the file:<br />
<br />
/pci@i0cf8/usb@10,4/*@2<br />
/pci@i0cf8/*@f/drive@1/disk@0<br />
<br />
will instruct SeaBIOS to attempt to boot from the given USB drive first and then attempt the given ATA harddrive second.<br />
<br />
Once a file has been created, add it to CBFS with the name '''bootorder'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add mybootlist.txt bootorder raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
== Other Configuration items ==<br />
<br />
'''This feature is only available in SeaBIOS git versions after 20110708.'''<br />
<br />
Additional configuration options are available in the CBFS '''etc/''' directory. For example, to set the duration of the boot menu to five and a half seconds, one would do the following:<br />
<br />
<source lang="bash"><br />
$ /path/to/seabios/tools/encodeint.py boot-menu-wait 5500<br />
$ ./build/cbfstool coreboot.rom add boot-menu-wait etc/boot-menu-wait raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
The SeaBIOS tool '''tools/encodeint.py''' will create a litte-endian encoded binary integer which can be placed into a CBFS file.<br />
<br />
{| border=1<br />
|+ Configuration variables<br />
|-<br />
! Filename !! Description<br />
|-<br />
| boot-menu-wait || Amount of time (in milliseconds) to wait at the boot menu prompt before selecting the default boot.<br />
|-<br />
| extra-pci-roots || If the target machine has multiple independent root buses set this to a positive value. The SeaBIOS PCI probe will then search for the given number of extra root buses.<br />
|-<br />
| ps2-keyboard-spinup || Some PS2 keyboards don't respond to commands immediately after powering on. Specify a positive value here to allow additional time for the keyboard to become responsive.<br />
|-<br />
| optionroms-checksum || Option ROMs are required to have correct checksums. However, some option ROMs in the wild don't correctly follow the specifications and have bad checksums. Set this to a zero value to allow SeaBIOS to execute them anyways.<br />
|-<br />
| s3-resume-vga-init || Set this to a non-zero value to instruct SeaBIOS to run the vga rom on an S3 resume.<br />
|-<br />
| screen-and-debug || Set this to a zero value to instruct SeaBIOS to not write characters it sends to the screen to the debug ports. This can be useful when using [[#Adding sgabios support|sgabios]].<br />
|}<br />
<br />
= Trouble reporting =<br />
<br />
If you are experiencing problems with SeaBIOS, it's useful to increase the debugging level. This is done by running '''make menuconfig''' and setting '''CONFIG_DEBUG_LEVEL''' to a higher value. A debug level of 8 will show a lot of diagnostic information without flooding the serial port (levels above 8 will frequently cause too much data).<br />
<br />
To report an issue, please collect the serial boot log with SeaBIOS set to a debug level of 8 and forward the full log along with a description of the problem to the coreboot [[Mailinglist|mailing list]].</div>KevinOConnorhttps://www.coreboot.org/index.php?title=SeaBIOS&diff=10633SeaBIOS2011-03-01T02:52:35Z<p>KevinOConnor: /* Manual build */ Bold "make menuconfig"</p>
<hr />
<div>[http://www.seabios.org '''SeaBIOS'''] is an open-source legacy BIOS implementation which can be used as a coreboot [[Payloads|payload]]. It implements the standard BIOS calling interfaces that a typical x86 proprietary BIOS implements.<br />
<br />
This page describes using SeaBIOS with coreboot. SeaBIOS can also run natively in [[QEMU]] and bochs &mdash; see the [http://git.linuxtogo.org/?p=kevin/seabios.git;a=blob;f=README;hb=HEAD SeaBIOS README] file for information on non-coreboot uses.<br />
<br />
= Use cases =<br />
<br />
Any software requiring 16-bit BIOS services benefits from SeaBIOS (eg, Windows and DOS). SeaBIOS also enables booting Linux out of the box (using standard boot-loaders like GRUB and Syslinux).<br />
<br />
SeaBIOS supports booting from ATA hard drives, ATAPI CDROMs, USB hard drives, USB CDROMs, payloads in flash, and from [http://en.wikipedia.org/wiki/Option_ROM Option ROMs] (eg, SCSI or network cards). SeaBIOS can initialize and use a PS/2 keyboard or USB keyboard.<br />
<br />
== Windows ==<br />
<br />
SeaBIOS has been tested with Windows XP, Windows Vista (64/32 bit), and Windows 7 Beta (64 bit).<br />
<br />
However, Windows has a very strict ACPI interpreter, and many coreboot boards do not have a complete [[ACPI in coreboot|ACPI definition]]. As a result, many coreboot boards will fail during Windows boot (eg, it may fail with a '''STOP 0xA5''' code).<br />
<br />
So far [[ASUS M2V-MX SE]] and [[GIGABYTE GA-M57SLI-S4]] have known good working ACPI and are able to boot XP/Vista/Windows 7. Please ask on the [[Mailinglist|mailing list]] for the status of other boards/chipsets.<br />
<br />
== Linux ==<br />
<br />
SeaBIOS has been tested with GRUB, LILO, and Syslinux. Linux booting works well.<br />
<br />
== Other ==<br />
<br />
SeaBIOS has also been tested with FreeDOS, NetBSD, and OpenBSD.<br />
<br />
Because SeaBIOS implements the standard x86 BIOS interfaces, it is expected many other operating systems and boot-loaders will work.<br />
<br />
= Building =<br />
<br />
== Building via coreboot's menuconfig ==<br />
<br />
Probably the easiest way to use SeaBIOS as coreboot payload is to simply use the coreboot build process, which downloads and builds SeaBIOS as payload by default nowadays. You just have to run the following in your coreboot checkout:<br />
<br />
<source lang="bash"><br />
$ make menuconfig<br />
$ make<br />
</source><br />
<br />
Both SeaBIOS and coreboot will be built, and SeaBIOS will be added as payload to the '''coreboot.rom''' image that is being built.<br />
<br />
== Manual build ==<br />
<br />
One can download the latest version of SeaBIOS through a git repository:<br />
<br />
<source lang="bash"><br />
$ git clone git://git.seabios.org/seabios.git seabios<br />
$ cd seabios<br />
</source><br />
<br />
There's also a [http://code.coreboot.org/p/seabios/source/changes/master/ gitweb] facility to browse the latest source code online.<br />
<br />
Run '''make menuconfig''' and set the following variables:<br />
<br />
* CONFIG_COREBOOT 1<br />
* CONFIG_DEBUG_SERIAL 1<br />
<br />
Then:<br />
<br />
<source lang="bash"><br />
$ make<br />
</source><br />
<br />
The final SeaBIOS payload file is '''out/bios.bin.elf'''.<br />
<br />
== coreboot ==<br />
<br />
For best results, configure coreboot with CONFIG_WRITE_HIGH_TABLES and CONFIG_VGA_BRIDGE_SETUP both enabled, and CONFIG_VGA_ROM_RUN and CONFIG_PCI_ROM_RUN both disabled.<br />
<br />
Finally, configure the SeaBIOS '''out/bios.bin.elf''' file as the coreboot payload and build coreboot. The resulting '''coreboot.rom''' file will contain both SeaBIOS and coreboot, and it can be flashed to a ROM chip.<br />
<br />
= SeaBIOS and CBFS =<br />
<br />
SeaBIOS can read the coreboot flash filesystem and extract files.<br />
<br />
When SeaBIOS scans the target machine's PCI devices, it will recognize option ROMs in CBFS that have the form '''pciVVVV,DDDD.rom'''. It will also run any file in the directory '''vgaroms/''' as a VGA option ROM not specific to a device and files in '''genroms/''' as a generic option ROM not specific to a device. In the above cases, SeaBIOS will recognize files with a '''.lzma''' suffix, and automatically decompress them (eg, '''pci1106,3344.rom.lzma''' and '''vgaroms/sgabios.bin.lzma''').<br />
<br />
SeaBIOS can also load a graphical bootsplash image from '''bootsplash.jpg''', payloads found in the CBFS directory '''img/''', and floppy images found in the '''floppyimg/''' directory.<br />
<br />
Further, SeaBIOS can obtain configuration information from CBFS. A file '''bootorder''' determines the order of devices and methods to attempt to boot the system from.<br />
<br />
The examples below show some common uses of these features.<br />
<br />
== Adding a VGA option ROM ==<br />
<br />
It is frequently necessary to add a VGA option ROM to CBFS in order to use a VGA adapter that is built-in to a motherboard. Note, VGA adapters on external cards (PCI, AGP, PCIe) do not require this step as SeaBIOS will automatically extract the VGA BIOS directly from the card. For machines without a VGA adapter, please follow the [[#Adding sgabios support|sgabios instructions]] below.<br />
<br />
The first step is to find the vendor and device ID of the built-in VGA adapter. This information can be found from '''lspci''':<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
01:00.0 VGA compatible controller [0300]: VIA Technologies, Inc. UniChrome Pro IGP ['''1106:3344'''] (rev 01) (prog-if 00 [VGA controller])<br />
</source><br />
<br />
In the above example, the VGA vendor/device ID is '''1106:3344'''. [[VGA support#How_to_retrieve_a_good_video_bios|Obtain the VGA ROM]] (eg, '''vgabios.bin''') and add it to the ROM with:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add /path/to/vgabios.bin pci1106,3344.rom raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
Alternatively, SeaBIOS supports LZMA compressed option ROMs. Use the following to add a compressed option ROM instead:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/vgabios.bin > vgabios.bin.lzma<br />
$ ./build/cbfstool coreboot.rom add vgabios.bin.lzma pci1106,3344.rom.lzma raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
After the above is done, one can write the '''coreboot.rom''' file to flash. SeaBIOS will extract the VGA ROM and run it during boot.<br />
<br />
== Adding gpxe support ==<br />
<br />
A [[GPXE|gpxe]] option ROM can nicely complement SeaBIOS and coreboot by adding network boot support. Adding gpxe is similar to [[#Adding a VGA option ROM]]. The first step is to find the Ethernet vendor/device ID. For example:<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
00:09.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet ['''10ec:8167'''] (rev 10)<br />
</source><br />
<br />
Then one can build a gpxe option ROM. For example:<br />
<br />
<source lang="bash"><br />
$ cd /path/to/gpxe/src/<br />
$ make bin/10ec8167.rom<br />
</source><br />
<br />
And add it to the coreboot image. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add /path/to/gpxe/src/bin/10ec8167.rom pci10ec,8167.rom raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
As with VGA option ROMs, the gpxe option ROM may be compressed with LZMA. However, compression won't significantly reduce gpxe's size as it implements its own compression.<br />
<br />
In addition to gpxe, other option ROMs can be added in the same manner.<br />
<br />
== Adding sgabios support ==<br />
<br />
An [http://code.google.com/p/sgabios/ sgabios] option ROM can forward many VGA BIOS requests and keyboard events over a serial port. One can deploy it in addition to the primary VGA BIOS or by itself.<br />
<br />
If the target machine does not have a VGA adapter, then one should install sgabios. Most bootloaders (eg, GRUB) require a VGA BIOS in order to function properly &mdash; the sgabios ROM can fill this requirement.<br />
<br />
Place the sgabios ROM file in the '''vgaroms/''' directory of CBFS. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add /path/to/sgabios.bin vgaroms/sgabios.bin raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
When using sgabios, all the characters that SeaBIOS writes to the screen will be seen twice &mdash; once from SeaBIOS sending the character to the serial port and once from sgabios forwarding the character. To prevent the duplicates unset '''CONFIG_SCREEN_AND_DEBUG''' in '''make menuconfig'''.<br />
<br />
== Adding a graphical "bootsplash" image ==<br />
<br />
SeaBIOS can show a custom [http://en.wikipedia.org/wiki/JPEG JPEG] image during bootup. To enable this, add the JPEG file to flash with the name '''bootsplash.jpg'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add /path/to/image.jpg bootsplash.jpg raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
The size of the JPEG image determines the video mode to use for showing the image. Make sure the dimensions of the image exactly correspond to an available video mode (eg, 640x480, or 1024x768), otherwise it will not be displayed.<br />
<br />
SeaBIOS will show the image during the wait for the boot menu (if the boot menu has been disabled, users will not see the image). The image should probably have "Press F12 for boot menu" embedded in it so users know they can enter the normal SeaBIOS boot menu. By default, the boot menu prompt (and thus graphical image) is shown for 2.5 seconds. This can be customized by modifying SeaBIOS' '''CONFIG_BOOTMENU_WAIT''' in '''make menuconfig'''.<br />
<br />
The JPEG viewer in SeaBIOS uses a simplified decoding algorithm. It supports most common JPEGs, but does not support all possible formats. Please see the [[#Trouble reporting]] section if a valid image isn't displayed properly.<br />
<br />
== Adding payloads ==<br />
<br />
Most [[Payloads|payloads]] can also be launched from SeaBIOS. To add a payload, build the corresponding .elf file and then add it to the '''coreboot.rom''' file in the '''img/''' directory. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add-payload /path/to/payload.elf img/MyPayload l<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
During boot, one can press the '''F12''' key to get a boot menu. SeaBIOS will show all files in the '''img/''' directory, and one can instruct SeaBIOS to run them.<br />
<br />
SeaBIOS supports both uncompressed and LZMA compressed payloads.<br />
<br />
== Adding a floppy image ==<br />
<br />
It is possible to embed an image of a floppy in flash. SeaBIOS can then boot from and redirect floppy BIOS calls to the flash image. This is mainly useful for legacy software (such as DOS utilities). To use this feature, place a floppy image into the CBFS directory '''floppyimg/'''. For example:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/myfloppy.img > myfloppy.img.lzma<br />
$ ./build/cbfstool coreboot.rom add myfloppy.img.lzma floppyimg/MyFloppy.lzma raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
Both uncompressed and LZMA compressed images are supported. Several floppy formats are available: 360K, 1.2MB, 720K, 1.44MB, 2.88MB, 160K, 180K, 320K.<br />
<br />
The floppy image will appear as writable to the system, however all writes are discarded on reboot.<br />
<br />
When using this system, SeaBIOS reserves high-memory to store the floppy. The reserved memory is then no longer available for OS use, so this feature should only be used when needed.<br />
<br />
== Configuring boot order ==<br />
<br />
Place a file in CBFS with the name '''bootorder''' to configure the boot up order. The file should be ASCII text and contain one line per boot method. The description of each boot method follows an Open Firmware device path format. SeaBIOS will attempt to boot from each item in the file - first line of the file first.<br />
<br />
The easiest way to find the available boot methods is to look for "Searching bootorder for" in the SeaBIOS serial output. For example, one may see lines similar to:<br />
<br />
Searching bootorder for: /pci@i0cf8/*@f/drive@1/disk@0<br />
Searching bootorder for: /pci@i0cf8/*@f,1/drive@2/disk@1<br />
Searching bootorder for: /pci@i0cf8/usb@10,4/*@2<br />
<br />
The above represents the patterns SeaBIOS will search for in the bootorder file. However, it's safe to just copy and paste the pattern into bootorder. For example, the file:<br />
<br />
/pci@i0cf8/usb@10,4/*@2<br />
/pci@i0cf8/*@f/drive@1/disk@0<br />
<br />
will instruct SeaBIOS to attempt to boot from the given USB drive first and then attempt the given ATA harddrive second.<br />
<br />
Once a file has been created, add it to CBFS with the name '''bootorder'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add mybootlist.txt bootorder raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
= Trouble reporting =<br />
<br />
If you are experiencing problems with SeaBIOS, it's useful to increase the debugging level. This is done by running '''make menuconfig''' and setting '''CONFIG_DEBUG_LEVEL''' to a higher value. A debug level of 8 will show a lot of diagnostic information without flooding the serial port (levels above 8 will frequently cause too much data).<br />
<br />
To report an issue, please collect the serial boot log with SeaBIOS set to a debug level of 8 and forward the full log along with a description of the problem to the coreboot [[Mailinglist|mailing list]].</div>KevinOConnorhttps://www.coreboot.org/index.php?title=SeaBIOS&diff=10632SeaBIOS2011-03-01T02:51:52Z<p>KevinOConnor: /* Trouble reporting */ Remove reference to editing config.h</p>
<hr />
<div>[http://www.seabios.org '''SeaBIOS'''] is an open-source legacy BIOS implementation which can be used as a coreboot [[Payloads|payload]]. It implements the standard BIOS calling interfaces that a typical x86 proprietary BIOS implements.<br />
<br />
This page describes using SeaBIOS with coreboot. SeaBIOS can also run natively in [[QEMU]] and bochs &mdash; see the [http://git.linuxtogo.org/?p=kevin/seabios.git;a=blob;f=README;hb=HEAD SeaBIOS README] file for information on non-coreboot uses.<br />
<br />
= Use cases =<br />
<br />
Any software requiring 16-bit BIOS services benefits from SeaBIOS (eg, Windows and DOS). SeaBIOS also enables booting Linux out of the box (using standard boot-loaders like GRUB and Syslinux).<br />
<br />
SeaBIOS supports booting from ATA hard drives, ATAPI CDROMs, USB hard drives, USB CDROMs, payloads in flash, and from [http://en.wikipedia.org/wiki/Option_ROM Option ROMs] (eg, SCSI or network cards). SeaBIOS can initialize and use a PS/2 keyboard or USB keyboard.<br />
<br />
== Windows ==<br />
<br />
SeaBIOS has been tested with Windows XP, Windows Vista (64/32 bit), and Windows 7 Beta (64 bit).<br />
<br />
However, Windows has a very strict ACPI interpreter, and many coreboot boards do not have a complete [[ACPI in coreboot|ACPI definition]]. As a result, many coreboot boards will fail during Windows boot (eg, it may fail with a '''STOP 0xA5''' code).<br />
<br />
So far [[ASUS M2V-MX SE]] and [[GIGABYTE GA-M57SLI-S4]] have known good working ACPI and are able to boot XP/Vista/Windows 7. Please ask on the [[Mailinglist|mailing list]] for the status of other boards/chipsets.<br />
<br />
== Linux ==<br />
<br />
SeaBIOS has been tested with GRUB, LILO, and Syslinux. Linux booting works well.<br />
<br />
== Other ==<br />
<br />
SeaBIOS has also been tested with FreeDOS, NetBSD, and OpenBSD.<br />
<br />
Because SeaBIOS implements the standard x86 BIOS interfaces, it is expected many other operating systems and boot-loaders will work.<br />
<br />
= Building =<br />
<br />
== Building via coreboot's menuconfig ==<br />
<br />
Probably the easiest way to use SeaBIOS as coreboot payload is to simply use the coreboot build process, which downloads and builds SeaBIOS as payload by default nowadays. You just have to run the following in your coreboot checkout:<br />
<br />
<source lang="bash"><br />
$ make menuconfig<br />
$ make<br />
</source><br />
<br />
Both SeaBIOS and coreboot will be built, and SeaBIOS will be added as payload to the '''coreboot.rom''' image that is being built.<br />
<br />
== Manual build ==<br />
<br />
One can download the latest version of SeaBIOS through a git repository:<br />
<br />
<source lang="bash"><br />
$ git clone git://git.seabios.org/seabios.git seabios<br />
$ cd seabios<br />
</source><br />
<br />
There's also a [http://code.coreboot.org/p/seabios/source/changes/master/ gitweb] facility to browse the latest source code online.<br />
<br />
Run make menuconfig and set the following variables:<br />
<br />
* CONFIG_COREBOOT 1<br />
* CONFIG_DEBUG_SERIAL 1<br />
<br />
Then:<br />
<br />
<source lang="bash"><br />
$ make<br />
</source><br />
<br />
The final SeaBIOS payload file is '''out/bios.bin.elf'''.<br />
<br />
== coreboot ==<br />
<br />
For best results, configure coreboot with CONFIG_WRITE_HIGH_TABLES and CONFIG_VGA_BRIDGE_SETUP both enabled, and CONFIG_VGA_ROM_RUN and CONFIG_PCI_ROM_RUN both disabled.<br />
<br />
Finally, configure the SeaBIOS '''out/bios.bin.elf''' file as the coreboot payload and build coreboot. The resulting '''coreboot.rom''' file will contain both SeaBIOS and coreboot, and it can be flashed to a ROM chip.<br />
<br />
= SeaBIOS and CBFS =<br />
<br />
SeaBIOS can read the coreboot flash filesystem and extract files.<br />
<br />
When SeaBIOS scans the target machine's PCI devices, it will recognize option ROMs in CBFS that have the form '''pciVVVV,DDDD.rom'''. It will also run any file in the directory '''vgaroms/''' as a VGA option ROM not specific to a device and files in '''genroms/''' as a generic option ROM not specific to a device. In the above cases, SeaBIOS will recognize files with a '''.lzma''' suffix, and automatically decompress them (eg, '''pci1106,3344.rom.lzma''' and '''vgaroms/sgabios.bin.lzma''').<br />
<br />
SeaBIOS can also load a graphical bootsplash image from '''bootsplash.jpg''', payloads found in the CBFS directory '''img/''', and floppy images found in the '''floppyimg/''' directory.<br />
<br />
Further, SeaBIOS can obtain configuration information from CBFS. A file '''bootorder''' determines the order of devices and methods to attempt to boot the system from.<br />
<br />
The examples below show some common uses of these features.<br />
<br />
== Adding a VGA option ROM ==<br />
<br />
It is frequently necessary to add a VGA option ROM to CBFS in order to use a VGA adapter that is built-in to a motherboard. Note, VGA adapters on external cards (PCI, AGP, PCIe) do not require this step as SeaBIOS will automatically extract the VGA BIOS directly from the card. For machines without a VGA adapter, please follow the [[#Adding sgabios support|sgabios instructions]] below.<br />
<br />
The first step is to find the vendor and device ID of the built-in VGA adapter. This information can be found from '''lspci''':<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
01:00.0 VGA compatible controller [0300]: VIA Technologies, Inc. UniChrome Pro IGP ['''1106:3344'''] (rev 01) (prog-if 00 [VGA controller])<br />
</source><br />
<br />
In the above example, the VGA vendor/device ID is '''1106:3344'''. [[VGA support#How_to_retrieve_a_good_video_bios|Obtain the VGA ROM]] (eg, '''vgabios.bin''') and add it to the ROM with:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add /path/to/vgabios.bin pci1106,3344.rom raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
Alternatively, SeaBIOS supports LZMA compressed option ROMs. Use the following to add a compressed option ROM instead:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/vgabios.bin > vgabios.bin.lzma<br />
$ ./build/cbfstool coreboot.rom add vgabios.bin.lzma pci1106,3344.rom.lzma raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
After the above is done, one can write the '''coreboot.rom''' file to flash. SeaBIOS will extract the VGA ROM and run it during boot.<br />
<br />
== Adding gpxe support ==<br />
<br />
A [[GPXE|gpxe]] option ROM can nicely complement SeaBIOS and coreboot by adding network boot support. Adding gpxe is similar to [[#Adding a VGA option ROM]]. The first step is to find the Ethernet vendor/device ID. For example:<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
00:09.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet ['''10ec:8167'''] (rev 10)<br />
</source><br />
<br />
Then one can build a gpxe option ROM. For example:<br />
<br />
<source lang="bash"><br />
$ cd /path/to/gpxe/src/<br />
$ make bin/10ec8167.rom<br />
</source><br />
<br />
And add it to the coreboot image. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add /path/to/gpxe/src/bin/10ec8167.rom pci10ec,8167.rom raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
As with VGA option ROMs, the gpxe option ROM may be compressed with LZMA. However, compression won't significantly reduce gpxe's size as it implements its own compression.<br />
<br />
In addition to gpxe, other option ROMs can be added in the same manner.<br />
<br />
== Adding sgabios support ==<br />
<br />
An [http://code.google.com/p/sgabios/ sgabios] option ROM can forward many VGA BIOS requests and keyboard events over a serial port. One can deploy it in addition to the primary VGA BIOS or by itself.<br />
<br />
If the target machine does not have a VGA adapter, then one should install sgabios. Most bootloaders (eg, GRUB) require a VGA BIOS in order to function properly &mdash; the sgabios ROM can fill this requirement.<br />
<br />
Place the sgabios ROM file in the '''vgaroms/''' directory of CBFS. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add /path/to/sgabios.bin vgaroms/sgabios.bin raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
When using sgabios, all the characters that SeaBIOS writes to the screen will be seen twice &mdash; once from SeaBIOS sending the character to the serial port and once from sgabios forwarding the character. To prevent the duplicates unset '''CONFIG_SCREEN_AND_DEBUG''' in '''make menuconfig'''.<br />
<br />
== Adding a graphical "bootsplash" image ==<br />
<br />
SeaBIOS can show a custom [http://en.wikipedia.org/wiki/JPEG JPEG] image during bootup. To enable this, add the JPEG file to flash with the name '''bootsplash.jpg'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add /path/to/image.jpg bootsplash.jpg raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
The size of the JPEG image determines the video mode to use for showing the image. Make sure the dimensions of the image exactly correspond to an available video mode (eg, 640x480, or 1024x768), otherwise it will not be displayed.<br />
<br />
SeaBIOS will show the image during the wait for the boot menu (if the boot menu has been disabled, users will not see the image). The image should probably have "Press F12 for boot menu" embedded in it so users know they can enter the normal SeaBIOS boot menu. By default, the boot menu prompt (and thus graphical image) is shown for 2.5 seconds. This can be customized by modifying SeaBIOS' '''CONFIG_BOOTMENU_WAIT''' in '''make menuconfig'''.<br />
<br />
The JPEG viewer in SeaBIOS uses a simplified decoding algorithm. It supports most common JPEGs, but does not support all possible formats. Please see the [[#Trouble reporting]] section if a valid image isn't displayed properly.<br />
<br />
== Adding payloads ==<br />
<br />
Most [[Payloads|payloads]] can also be launched from SeaBIOS. To add a payload, build the corresponding .elf file and then add it to the '''coreboot.rom''' file in the '''img/''' directory. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add-payload /path/to/payload.elf img/MyPayload l<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
During boot, one can press the '''F12''' key to get a boot menu. SeaBIOS will show all files in the '''img/''' directory, and one can instruct SeaBIOS to run them.<br />
<br />
SeaBIOS supports both uncompressed and LZMA compressed payloads.<br />
<br />
== Adding a floppy image ==<br />
<br />
It is possible to embed an image of a floppy in flash. SeaBIOS can then boot from and redirect floppy BIOS calls to the flash image. This is mainly useful for legacy software (such as DOS utilities). To use this feature, place a floppy image into the CBFS directory '''floppyimg/'''. For example:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/myfloppy.img > myfloppy.img.lzma<br />
$ ./build/cbfstool coreboot.rom add myfloppy.img.lzma floppyimg/MyFloppy.lzma raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
Both uncompressed and LZMA compressed images are supported. Several floppy formats are available: 360K, 1.2MB, 720K, 1.44MB, 2.88MB, 160K, 180K, 320K.<br />
<br />
The floppy image will appear as writable to the system, however all writes are discarded on reboot.<br />
<br />
When using this system, SeaBIOS reserves high-memory to store the floppy. The reserved memory is then no longer available for OS use, so this feature should only be used when needed.<br />
<br />
== Configuring boot order ==<br />
<br />
Place a file in CBFS with the name '''bootorder''' to configure the boot up order. The file should be ASCII text and contain one line per boot method. The description of each boot method follows an Open Firmware device path format. SeaBIOS will attempt to boot from each item in the file - first line of the file first.<br />
<br />
The easiest way to find the available boot methods is to look for "Searching bootorder for" in the SeaBIOS serial output. For example, one may see lines similar to:<br />
<br />
Searching bootorder for: /pci@i0cf8/*@f/drive@1/disk@0<br />
Searching bootorder for: /pci@i0cf8/*@f,1/drive@2/disk@1<br />
Searching bootorder for: /pci@i0cf8/usb@10,4/*@2<br />
<br />
The above represents the patterns SeaBIOS will search for in the bootorder file. However, it's safe to just copy and paste the pattern into bootorder. For example, the file:<br />
<br />
/pci@i0cf8/usb@10,4/*@2<br />
/pci@i0cf8/*@f/drive@1/disk@0<br />
<br />
will instruct SeaBIOS to attempt to boot from the given USB drive first and then attempt the given ATA harddrive second.<br />
<br />
Once a file has been created, add it to CBFS with the name '''bootorder'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add mybootlist.txt bootorder raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
= Trouble reporting =<br />
<br />
If you are experiencing problems with SeaBIOS, it's useful to increase the debugging level. This is done by running '''make menuconfig''' and setting '''CONFIG_DEBUG_LEVEL''' to a higher value. A debug level of 8 will show a lot of diagnostic information without flooding the serial port (levels above 8 will frequently cause too much data).<br />
<br />
To report an issue, please collect the serial boot log with SeaBIOS set to a debug level of 8 and forward the full log along with a description of the problem to the coreboot [[Mailinglist|mailing list]].</div>KevinOConnorhttps://www.coreboot.org/index.php?title=SeaBIOS&diff=10631SeaBIOS2011-03-01T02:50:10Z<p>KevinOConnor: /* Manual build */ No need to set CONFIG_VGAHOOKS - it's on by default.</p>
<hr />
<div>[http://www.seabios.org '''SeaBIOS'''] is an open-source legacy BIOS implementation which can be used as a coreboot [[Payloads|payload]]. It implements the standard BIOS calling interfaces that a typical x86 proprietary BIOS implements.<br />
<br />
This page describes using SeaBIOS with coreboot. SeaBIOS can also run natively in [[QEMU]] and bochs &mdash; see the [http://git.linuxtogo.org/?p=kevin/seabios.git;a=blob;f=README;hb=HEAD SeaBIOS README] file for information on non-coreboot uses.<br />
<br />
= Use cases =<br />
<br />
Any software requiring 16-bit BIOS services benefits from SeaBIOS (eg, Windows and DOS). SeaBIOS also enables booting Linux out of the box (using standard boot-loaders like GRUB and Syslinux).<br />
<br />
SeaBIOS supports booting from ATA hard drives, ATAPI CDROMs, USB hard drives, USB CDROMs, payloads in flash, and from [http://en.wikipedia.org/wiki/Option_ROM Option ROMs] (eg, SCSI or network cards). SeaBIOS can initialize and use a PS/2 keyboard or USB keyboard.<br />
<br />
== Windows ==<br />
<br />
SeaBIOS has been tested with Windows XP, Windows Vista (64/32 bit), and Windows 7 Beta (64 bit).<br />
<br />
However, Windows has a very strict ACPI interpreter, and many coreboot boards do not have a complete [[ACPI in coreboot|ACPI definition]]. As a result, many coreboot boards will fail during Windows boot (eg, it may fail with a '''STOP 0xA5''' code).<br />
<br />
So far [[ASUS M2V-MX SE]] and [[GIGABYTE GA-M57SLI-S4]] have known good working ACPI and are able to boot XP/Vista/Windows 7. Please ask on the [[Mailinglist|mailing list]] for the status of other boards/chipsets.<br />
<br />
== Linux ==<br />
<br />
SeaBIOS has been tested with GRUB, LILO, and Syslinux. Linux booting works well.<br />
<br />
== Other ==<br />
<br />
SeaBIOS has also been tested with FreeDOS, NetBSD, and OpenBSD.<br />
<br />
Because SeaBIOS implements the standard x86 BIOS interfaces, it is expected many other operating systems and boot-loaders will work.<br />
<br />
= Building =<br />
<br />
== Building via coreboot's menuconfig ==<br />
<br />
Probably the easiest way to use SeaBIOS as coreboot payload is to simply use the coreboot build process, which downloads and builds SeaBIOS as payload by default nowadays. You just have to run the following in your coreboot checkout:<br />
<br />
<source lang="bash"><br />
$ make menuconfig<br />
$ make<br />
</source><br />
<br />
Both SeaBIOS and coreboot will be built, and SeaBIOS will be added as payload to the '''coreboot.rom''' image that is being built.<br />
<br />
== Manual build ==<br />
<br />
One can download the latest version of SeaBIOS through a git repository:<br />
<br />
<source lang="bash"><br />
$ git clone git://git.seabios.org/seabios.git seabios<br />
$ cd seabios<br />
</source><br />
<br />
There's also a [http://code.coreboot.org/p/seabios/source/changes/master/ gitweb] facility to browse the latest source code online.<br />
<br />
Run make menuconfig and set the following variables:<br />
<br />
* CONFIG_COREBOOT 1<br />
* CONFIG_DEBUG_SERIAL 1<br />
<br />
Then:<br />
<br />
<source lang="bash"><br />
$ make<br />
</source><br />
<br />
The final SeaBIOS payload file is '''out/bios.bin.elf'''.<br />
<br />
== coreboot ==<br />
<br />
For best results, configure coreboot with CONFIG_WRITE_HIGH_TABLES and CONFIG_VGA_BRIDGE_SETUP both enabled, and CONFIG_VGA_ROM_RUN and CONFIG_PCI_ROM_RUN both disabled.<br />
<br />
Finally, configure the SeaBIOS '''out/bios.bin.elf''' file as the coreboot payload and build coreboot. The resulting '''coreboot.rom''' file will contain both SeaBIOS and coreboot, and it can be flashed to a ROM chip.<br />
<br />
= SeaBIOS and CBFS =<br />
<br />
SeaBIOS can read the coreboot flash filesystem and extract files.<br />
<br />
When SeaBIOS scans the target machine's PCI devices, it will recognize option ROMs in CBFS that have the form '''pciVVVV,DDDD.rom'''. It will also run any file in the directory '''vgaroms/''' as a VGA option ROM not specific to a device and files in '''genroms/''' as a generic option ROM not specific to a device. In the above cases, SeaBIOS will recognize files with a '''.lzma''' suffix, and automatically decompress them (eg, '''pci1106,3344.rom.lzma''' and '''vgaroms/sgabios.bin.lzma''').<br />
<br />
SeaBIOS can also load a graphical bootsplash image from '''bootsplash.jpg''', payloads found in the CBFS directory '''img/''', and floppy images found in the '''floppyimg/''' directory.<br />
<br />
Further, SeaBIOS can obtain configuration information from CBFS. A file '''bootorder''' determines the order of devices and methods to attempt to boot the system from.<br />
<br />
The examples below show some common uses of these features.<br />
<br />
== Adding a VGA option ROM ==<br />
<br />
It is frequently necessary to add a VGA option ROM to CBFS in order to use a VGA adapter that is built-in to a motherboard. Note, VGA adapters on external cards (PCI, AGP, PCIe) do not require this step as SeaBIOS will automatically extract the VGA BIOS directly from the card. For machines without a VGA adapter, please follow the [[#Adding sgabios support|sgabios instructions]] below.<br />
<br />
The first step is to find the vendor and device ID of the built-in VGA adapter. This information can be found from '''lspci''':<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
01:00.0 VGA compatible controller [0300]: VIA Technologies, Inc. UniChrome Pro IGP ['''1106:3344'''] (rev 01) (prog-if 00 [VGA controller])<br />
</source><br />
<br />
In the above example, the VGA vendor/device ID is '''1106:3344'''. [[VGA support#How_to_retrieve_a_good_video_bios|Obtain the VGA ROM]] (eg, '''vgabios.bin''') and add it to the ROM with:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add /path/to/vgabios.bin pci1106,3344.rom raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
Alternatively, SeaBIOS supports LZMA compressed option ROMs. Use the following to add a compressed option ROM instead:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/vgabios.bin > vgabios.bin.lzma<br />
$ ./build/cbfstool coreboot.rom add vgabios.bin.lzma pci1106,3344.rom.lzma raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
After the above is done, one can write the '''coreboot.rom''' file to flash. SeaBIOS will extract the VGA ROM and run it during boot.<br />
<br />
== Adding gpxe support ==<br />
<br />
A [[GPXE|gpxe]] option ROM can nicely complement SeaBIOS and coreboot by adding network boot support. Adding gpxe is similar to [[#Adding a VGA option ROM]]. The first step is to find the Ethernet vendor/device ID. For example:<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
00:09.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet ['''10ec:8167'''] (rev 10)<br />
</source><br />
<br />
Then one can build a gpxe option ROM. For example:<br />
<br />
<source lang="bash"><br />
$ cd /path/to/gpxe/src/<br />
$ make bin/10ec8167.rom<br />
</source><br />
<br />
And add it to the coreboot image. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add /path/to/gpxe/src/bin/10ec8167.rom pci10ec,8167.rom raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
As with VGA option ROMs, the gpxe option ROM may be compressed with LZMA. However, compression won't significantly reduce gpxe's size as it implements its own compression.<br />
<br />
In addition to gpxe, other option ROMs can be added in the same manner.<br />
<br />
== Adding sgabios support ==<br />
<br />
An [http://code.google.com/p/sgabios/ sgabios] option ROM can forward many VGA BIOS requests and keyboard events over a serial port. One can deploy it in addition to the primary VGA BIOS or by itself.<br />
<br />
If the target machine does not have a VGA adapter, then one should install sgabios. Most bootloaders (eg, GRUB) require a VGA BIOS in order to function properly &mdash; the sgabios ROM can fill this requirement.<br />
<br />
Place the sgabios ROM file in the '''vgaroms/''' directory of CBFS. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add /path/to/sgabios.bin vgaroms/sgabios.bin raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
When using sgabios, all the characters that SeaBIOS writes to the screen will be seen twice &mdash; once from SeaBIOS sending the character to the serial port and once from sgabios forwarding the character. To prevent the duplicates unset '''CONFIG_SCREEN_AND_DEBUG''' in '''make menuconfig'''.<br />
<br />
== Adding a graphical "bootsplash" image ==<br />
<br />
SeaBIOS can show a custom [http://en.wikipedia.org/wiki/JPEG JPEG] image during bootup. To enable this, add the JPEG file to flash with the name '''bootsplash.jpg'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add /path/to/image.jpg bootsplash.jpg raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
The size of the JPEG image determines the video mode to use for showing the image. Make sure the dimensions of the image exactly correspond to an available video mode (eg, 640x480, or 1024x768), otherwise it will not be displayed.<br />
<br />
SeaBIOS will show the image during the wait for the boot menu (if the boot menu has been disabled, users will not see the image). The image should probably have "Press F12 for boot menu" embedded in it so users know they can enter the normal SeaBIOS boot menu. By default, the boot menu prompt (and thus graphical image) is shown for 2.5 seconds. This can be customized by modifying SeaBIOS' '''CONFIG_BOOTMENU_WAIT''' in '''make menuconfig'''.<br />
<br />
The JPEG viewer in SeaBIOS uses a simplified decoding algorithm. It supports most common JPEGs, but does not support all possible formats. Please see the [[#Trouble reporting]] section if a valid image isn't displayed properly.<br />
<br />
== Adding payloads ==<br />
<br />
Most [[Payloads|payloads]] can also be launched from SeaBIOS. To add a payload, build the corresponding .elf file and then add it to the '''coreboot.rom''' file in the '''img/''' directory. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add-payload /path/to/payload.elf img/MyPayload l<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
During boot, one can press the '''F12''' key to get a boot menu. SeaBIOS will show all files in the '''img/''' directory, and one can instruct SeaBIOS to run them.<br />
<br />
SeaBIOS supports both uncompressed and LZMA compressed payloads.<br />
<br />
== Adding a floppy image ==<br />
<br />
It is possible to embed an image of a floppy in flash. SeaBIOS can then boot from and redirect floppy BIOS calls to the flash image. This is mainly useful for legacy software (such as DOS utilities). To use this feature, place a floppy image into the CBFS directory '''floppyimg/'''. For example:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/myfloppy.img > myfloppy.img.lzma<br />
$ ./build/cbfstool coreboot.rom add myfloppy.img.lzma floppyimg/MyFloppy.lzma raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
Both uncompressed and LZMA compressed images are supported. Several floppy formats are available: 360K, 1.2MB, 720K, 1.44MB, 2.88MB, 160K, 180K, 320K.<br />
<br />
The floppy image will appear as writable to the system, however all writes are discarded on reboot.<br />
<br />
When using this system, SeaBIOS reserves high-memory to store the floppy. The reserved memory is then no longer available for OS use, so this feature should only be used when needed.<br />
<br />
== Configuring boot order ==<br />
<br />
Place a file in CBFS with the name '''bootorder''' to configure the boot up order. The file should be ASCII text and contain one line per boot method. The description of each boot method follows an Open Firmware device path format. SeaBIOS will attempt to boot from each item in the file - first line of the file first.<br />
<br />
The easiest way to find the available boot methods is to look for "Searching bootorder for" in the SeaBIOS serial output. For example, one may see lines similar to:<br />
<br />
Searching bootorder for: /pci@i0cf8/*@f/drive@1/disk@0<br />
Searching bootorder for: /pci@i0cf8/*@f,1/drive@2/disk@1<br />
Searching bootorder for: /pci@i0cf8/usb@10,4/*@2<br />
<br />
The above represents the patterns SeaBIOS will search for in the bootorder file. However, it's safe to just copy and paste the pattern into bootorder. For example, the file:<br />
<br />
/pci@i0cf8/usb@10,4/*@2<br />
/pci@i0cf8/*@f/drive@1/disk@0<br />
<br />
will instruct SeaBIOS to attempt to boot from the given USB drive first and then attempt the given ATA harddrive second.<br />
<br />
Once a file has been created, add it to CBFS with the name '''bootorder'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add mybootlist.txt bootorder raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
= Trouble reporting =<br />
<br />
If you are experiencing problems with SeaBIOS, it's useful to increase the debugging level. This is done by editing the '''src/config.h''' file and setting the debug level to a higher number (for example '''8'''):<br />
<br />
<source lang="C"><br />
#define CONFIG_DEBUG_LEVEL 8<br />
</source><br />
<br />
A debug level of 8 will show a lot of diagnostic information without flooding the serial port (levels above 8 will frequently cause too much data).<br />
<br />
To report an issue, please collect the serial boot log with SeaBIOS set to a debug level of 8 and forward the full log along with a description of the problem to the coreboot [[Mailinglist|mailing list]].</div>KevinOConnorhttps://www.coreboot.org/index.php?title=SeaBIOS&diff=10630SeaBIOS2011-03-01T02:49:46Z<p>KevinOConnor: /* SeaBIOS and CBFS */ Remove references to editing config.h</p>
<hr />
<div>[http://www.seabios.org '''SeaBIOS'''] is an open-source legacy BIOS implementation which can be used as a coreboot [[Payloads|payload]]. It implements the standard BIOS calling interfaces that a typical x86 proprietary BIOS implements.<br />
<br />
This page describes using SeaBIOS with coreboot. SeaBIOS can also run natively in [[QEMU]] and bochs &mdash; see the [http://git.linuxtogo.org/?p=kevin/seabios.git;a=blob;f=README;hb=HEAD SeaBIOS README] file for information on non-coreboot uses.<br />
<br />
= Use cases =<br />
<br />
Any software requiring 16-bit BIOS services benefits from SeaBIOS (eg, Windows and DOS). SeaBIOS also enables booting Linux out of the box (using standard boot-loaders like GRUB and Syslinux).<br />
<br />
SeaBIOS supports booting from ATA hard drives, ATAPI CDROMs, USB hard drives, USB CDROMs, payloads in flash, and from [http://en.wikipedia.org/wiki/Option_ROM Option ROMs] (eg, SCSI or network cards). SeaBIOS can initialize and use a PS/2 keyboard or USB keyboard.<br />
<br />
== Windows ==<br />
<br />
SeaBIOS has been tested with Windows XP, Windows Vista (64/32 bit), and Windows 7 Beta (64 bit).<br />
<br />
However, Windows has a very strict ACPI interpreter, and many coreboot boards do not have a complete [[ACPI in coreboot|ACPI definition]]. As a result, many coreboot boards will fail during Windows boot (eg, it may fail with a '''STOP 0xA5''' code).<br />
<br />
So far [[ASUS M2V-MX SE]] and [[GIGABYTE GA-M57SLI-S4]] have known good working ACPI and are able to boot XP/Vista/Windows 7. Please ask on the [[Mailinglist|mailing list]] for the status of other boards/chipsets.<br />
<br />
== Linux ==<br />
<br />
SeaBIOS has been tested with GRUB, LILO, and Syslinux. Linux booting works well.<br />
<br />
== Other ==<br />
<br />
SeaBIOS has also been tested with FreeDOS, NetBSD, and OpenBSD.<br />
<br />
Because SeaBIOS implements the standard x86 BIOS interfaces, it is expected many other operating systems and boot-loaders will work.<br />
<br />
= Building =<br />
<br />
== Building via coreboot's menuconfig ==<br />
<br />
Probably the easiest way to use SeaBIOS as coreboot payload is to simply use the coreboot build process, which downloads and builds SeaBIOS as payload by default nowadays. You just have to run the following in your coreboot checkout:<br />
<br />
<source lang="bash"><br />
$ make menuconfig<br />
$ make<br />
</source><br />
<br />
Both SeaBIOS and coreboot will be built, and SeaBIOS will be added as payload to the '''coreboot.rom''' image that is being built.<br />
<br />
== Manual build ==<br />
<br />
One can download the latest version of SeaBIOS through a git repository:<br />
<br />
<source lang="bash"><br />
$ git clone git://git.seabios.org/seabios.git seabios<br />
$ cd seabios<br />
</source><br />
<br />
There's also a [http://code.coreboot.org/p/seabios/source/changes/master/ gitweb] facility to browse the latest source code online.<br />
<br />
Run make menuconfig and set the following variables:<br />
<br />
* CONFIG_COREBOOT 1<br />
* CONFIG_DEBUG_SERIAL 1<br />
* CONFIG_VGAHOOKS 1<br />
<br />
Then:<br />
<br />
<source lang="bash"><br />
$ make<br />
</source><br />
<br />
The final SeaBIOS payload file is '''out/bios.bin.elf'''.<br />
<br />
== coreboot ==<br />
<br />
For best results, configure coreboot with CONFIG_WRITE_HIGH_TABLES and CONFIG_VGA_BRIDGE_SETUP both enabled, and CONFIG_VGA_ROM_RUN and CONFIG_PCI_ROM_RUN both disabled.<br />
<br />
Finally, configure the SeaBIOS '''out/bios.bin.elf''' file as the coreboot payload and build coreboot. The resulting '''coreboot.rom''' file will contain both SeaBIOS and coreboot, and it can be flashed to a ROM chip.<br />
<br />
= SeaBIOS and CBFS =<br />
<br />
SeaBIOS can read the coreboot flash filesystem and extract files.<br />
<br />
When SeaBIOS scans the target machine's PCI devices, it will recognize option ROMs in CBFS that have the form '''pciVVVV,DDDD.rom'''. It will also run any file in the directory '''vgaroms/''' as a VGA option ROM not specific to a device and files in '''genroms/''' as a generic option ROM not specific to a device. In the above cases, SeaBIOS will recognize files with a '''.lzma''' suffix, and automatically decompress them (eg, '''pci1106,3344.rom.lzma''' and '''vgaroms/sgabios.bin.lzma''').<br />
<br />
SeaBIOS can also load a graphical bootsplash image from '''bootsplash.jpg''', payloads found in the CBFS directory '''img/''', and floppy images found in the '''floppyimg/''' directory.<br />
<br />
Further, SeaBIOS can obtain configuration information from CBFS. A file '''bootorder''' determines the order of devices and methods to attempt to boot the system from.<br />
<br />
The examples below show some common uses of these features.<br />
<br />
== Adding a VGA option ROM ==<br />
<br />
It is frequently necessary to add a VGA option ROM to CBFS in order to use a VGA adapter that is built-in to a motherboard. Note, VGA adapters on external cards (PCI, AGP, PCIe) do not require this step as SeaBIOS will automatically extract the VGA BIOS directly from the card. For machines without a VGA adapter, please follow the [[#Adding sgabios support|sgabios instructions]] below.<br />
<br />
The first step is to find the vendor and device ID of the built-in VGA adapter. This information can be found from '''lspci''':<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
01:00.0 VGA compatible controller [0300]: VIA Technologies, Inc. UniChrome Pro IGP ['''1106:3344'''] (rev 01) (prog-if 00 [VGA controller])<br />
</source><br />
<br />
In the above example, the VGA vendor/device ID is '''1106:3344'''. [[VGA support#How_to_retrieve_a_good_video_bios|Obtain the VGA ROM]] (eg, '''vgabios.bin''') and add it to the ROM with:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add /path/to/vgabios.bin pci1106,3344.rom raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
Alternatively, SeaBIOS supports LZMA compressed option ROMs. Use the following to add a compressed option ROM instead:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/vgabios.bin > vgabios.bin.lzma<br />
$ ./build/cbfstool coreboot.rom add vgabios.bin.lzma pci1106,3344.rom.lzma raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
After the above is done, one can write the '''coreboot.rom''' file to flash. SeaBIOS will extract the VGA ROM and run it during boot.<br />
<br />
== Adding gpxe support ==<br />
<br />
A [[GPXE|gpxe]] option ROM can nicely complement SeaBIOS and coreboot by adding network boot support. Adding gpxe is similar to [[#Adding a VGA option ROM]]. The first step is to find the Ethernet vendor/device ID. For example:<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
00:09.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet ['''10ec:8167'''] (rev 10)<br />
</source><br />
<br />
Then one can build a gpxe option ROM. For example:<br />
<br />
<source lang="bash"><br />
$ cd /path/to/gpxe/src/<br />
$ make bin/10ec8167.rom<br />
</source><br />
<br />
And add it to the coreboot image. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add /path/to/gpxe/src/bin/10ec8167.rom pci10ec,8167.rom raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
As with VGA option ROMs, the gpxe option ROM may be compressed with LZMA. However, compression won't significantly reduce gpxe's size as it implements its own compression.<br />
<br />
In addition to gpxe, other option ROMs can be added in the same manner.<br />
<br />
== Adding sgabios support ==<br />
<br />
An [http://code.google.com/p/sgabios/ sgabios] option ROM can forward many VGA BIOS requests and keyboard events over a serial port. One can deploy it in addition to the primary VGA BIOS or by itself.<br />
<br />
If the target machine does not have a VGA adapter, then one should install sgabios. Most bootloaders (eg, GRUB) require a VGA BIOS in order to function properly &mdash; the sgabios ROM can fill this requirement.<br />
<br />
Place the sgabios ROM file in the '''vgaroms/''' directory of CBFS. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add /path/to/sgabios.bin vgaroms/sgabios.bin raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
When using sgabios, all the characters that SeaBIOS writes to the screen will be seen twice &mdash; once from SeaBIOS sending the character to the serial port and once from sgabios forwarding the character. To prevent the duplicates unset '''CONFIG_SCREEN_AND_DEBUG''' in '''make menuconfig'''.<br />
<br />
== Adding a graphical "bootsplash" image ==<br />
<br />
SeaBIOS can show a custom [http://en.wikipedia.org/wiki/JPEG JPEG] image during bootup. To enable this, add the JPEG file to flash with the name '''bootsplash.jpg'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add /path/to/image.jpg bootsplash.jpg raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
The size of the JPEG image determines the video mode to use for showing the image. Make sure the dimensions of the image exactly correspond to an available video mode (eg, 640x480, or 1024x768), otherwise it will not be displayed.<br />
<br />
SeaBIOS will show the image during the wait for the boot menu (if the boot menu has been disabled, users will not see the image). The image should probably have "Press F12 for boot menu" embedded in it so users know they can enter the normal SeaBIOS boot menu. By default, the boot menu prompt (and thus graphical image) is shown for 2.5 seconds. This can be customized by modifying SeaBIOS' '''CONFIG_BOOTMENU_WAIT''' in '''make menuconfig'''.<br />
<br />
The JPEG viewer in SeaBIOS uses a simplified decoding algorithm. It supports most common JPEGs, but does not support all possible formats. Please see the [[#Trouble reporting]] section if a valid image isn't displayed properly.<br />
<br />
== Adding payloads ==<br />
<br />
Most [[Payloads|payloads]] can also be launched from SeaBIOS. To add a payload, build the corresponding .elf file and then add it to the '''coreboot.rom''' file in the '''img/''' directory. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add-payload /path/to/payload.elf img/MyPayload l<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
During boot, one can press the '''F12''' key to get a boot menu. SeaBIOS will show all files in the '''img/''' directory, and one can instruct SeaBIOS to run them.<br />
<br />
SeaBIOS supports both uncompressed and LZMA compressed payloads.<br />
<br />
== Adding a floppy image ==<br />
<br />
It is possible to embed an image of a floppy in flash. SeaBIOS can then boot from and redirect floppy BIOS calls to the flash image. This is mainly useful for legacy software (such as DOS utilities). To use this feature, place a floppy image into the CBFS directory '''floppyimg/'''. For example:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/myfloppy.img > myfloppy.img.lzma<br />
$ ./build/cbfstool coreboot.rom add myfloppy.img.lzma floppyimg/MyFloppy.lzma raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
Both uncompressed and LZMA compressed images are supported. Several floppy formats are available: 360K, 1.2MB, 720K, 1.44MB, 2.88MB, 160K, 180K, 320K.<br />
<br />
The floppy image will appear as writable to the system, however all writes are discarded on reboot.<br />
<br />
When using this system, SeaBIOS reserves high-memory to store the floppy. The reserved memory is then no longer available for OS use, so this feature should only be used when needed.<br />
<br />
== Configuring boot order ==<br />
<br />
Place a file in CBFS with the name '''bootorder''' to configure the boot up order. The file should be ASCII text and contain one line per boot method. The description of each boot method follows an Open Firmware device path format. SeaBIOS will attempt to boot from each item in the file - first line of the file first.<br />
<br />
The easiest way to find the available boot methods is to look for "Searching bootorder for" in the SeaBIOS serial output. For example, one may see lines similar to:<br />
<br />
Searching bootorder for: /pci@i0cf8/*@f/drive@1/disk@0<br />
Searching bootorder for: /pci@i0cf8/*@f,1/drive@2/disk@1<br />
Searching bootorder for: /pci@i0cf8/usb@10,4/*@2<br />
<br />
The above represents the patterns SeaBIOS will search for in the bootorder file. However, it's safe to just copy and paste the pattern into bootorder. For example, the file:<br />
<br />
/pci@i0cf8/usb@10,4/*@2<br />
/pci@i0cf8/*@f/drive@1/disk@0<br />
<br />
will instruct SeaBIOS to attempt to boot from the given USB drive first and then attempt the given ATA harddrive second.<br />
<br />
Once a file has been created, add it to CBFS with the name '''bootorder'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add mybootlist.txt bootorder raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
= Trouble reporting =<br />
<br />
If you are experiencing problems with SeaBIOS, it's useful to increase the debugging level. This is done by editing the '''src/config.h''' file and setting the debug level to a higher number (for example '''8'''):<br />
<br />
<source lang="C"><br />
#define CONFIG_DEBUG_LEVEL 8<br />
</source><br />
<br />
A debug level of 8 will show a lot of diagnostic information without flooding the serial port (levels above 8 will frequently cause too much data).<br />
<br />
To report an issue, please collect the serial boot log with SeaBIOS set to a debug level of 8 and forward the full log along with a description of the problem to the coreboot [[Mailinglist|mailing list]].</div>KevinOConnorhttps://www.coreboot.org/index.php?title=SeaBIOS&diff=10629SeaBIOS2011-03-01T02:46:39Z<p>KevinOConnor: /* SeaBIOS and CBFS */ cbfstool now in ./build/</p>
<hr />
<div>[http://www.seabios.org '''SeaBIOS'''] is an open-source legacy BIOS implementation which can be used as a coreboot [[Payloads|payload]]. It implements the standard BIOS calling interfaces that a typical x86 proprietary BIOS implements.<br />
<br />
This page describes using SeaBIOS with coreboot. SeaBIOS can also run natively in [[QEMU]] and bochs &mdash; see the [http://git.linuxtogo.org/?p=kevin/seabios.git;a=blob;f=README;hb=HEAD SeaBIOS README] file for information on non-coreboot uses.<br />
<br />
= Use cases =<br />
<br />
Any software requiring 16-bit BIOS services benefits from SeaBIOS (eg, Windows and DOS). SeaBIOS also enables booting Linux out of the box (using standard boot-loaders like GRUB and Syslinux).<br />
<br />
SeaBIOS supports booting from ATA hard drives, ATAPI CDROMs, USB hard drives, USB CDROMs, payloads in flash, and from [http://en.wikipedia.org/wiki/Option_ROM Option ROMs] (eg, SCSI or network cards). SeaBIOS can initialize and use a PS/2 keyboard or USB keyboard.<br />
<br />
== Windows ==<br />
<br />
SeaBIOS has been tested with Windows XP, Windows Vista (64/32 bit), and Windows 7 Beta (64 bit).<br />
<br />
However, Windows has a very strict ACPI interpreter, and many coreboot boards do not have a complete [[ACPI in coreboot|ACPI definition]]. As a result, many coreboot boards will fail during Windows boot (eg, it may fail with a '''STOP 0xA5''' code).<br />
<br />
So far [[ASUS M2V-MX SE]] and [[GIGABYTE GA-M57SLI-S4]] have known good working ACPI and are able to boot XP/Vista/Windows 7. Please ask on the [[Mailinglist|mailing list]] for the status of other boards/chipsets.<br />
<br />
== Linux ==<br />
<br />
SeaBIOS has been tested with GRUB, LILO, and Syslinux. Linux booting works well.<br />
<br />
== Other ==<br />
<br />
SeaBIOS has also been tested with FreeDOS, NetBSD, and OpenBSD.<br />
<br />
Because SeaBIOS implements the standard x86 BIOS interfaces, it is expected many other operating systems and boot-loaders will work.<br />
<br />
= Building =<br />
<br />
== Building via coreboot's menuconfig ==<br />
<br />
Probably the easiest way to use SeaBIOS as coreboot payload is to simply use the coreboot build process, which downloads and builds SeaBIOS as payload by default nowadays. You just have to run the following in your coreboot checkout:<br />
<br />
<source lang="bash"><br />
$ make menuconfig<br />
$ make<br />
</source><br />
<br />
Both SeaBIOS and coreboot will be built, and SeaBIOS will be added as payload to the '''coreboot.rom''' image that is being built.<br />
<br />
== Manual build ==<br />
<br />
One can download the latest version of SeaBIOS through a git repository:<br />
<br />
<source lang="bash"><br />
$ git clone git://git.seabios.org/seabios.git seabios<br />
$ cd seabios<br />
</source><br />
<br />
There's also a [http://code.coreboot.org/p/seabios/source/changes/master/ gitweb] facility to browse the latest source code online.<br />
<br />
Run make menuconfig and set the following variables:<br />
<br />
* CONFIG_COREBOOT 1<br />
* CONFIG_DEBUG_SERIAL 1<br />
* CONFIG_VGAHOOKS 1<br />
<br />
Then:<br />
<br />
<source lang="bash"><br />
$ make<br />
</source><br />
<br />
The final SeaBIOS payload file is '''out/bios.bin.elf'''.<br />
<br />
== coreboot ==<br />
<br />
For best results, configure coreboot with CONFIG_WRITE_HIGH_TABLES and CONFIG_VGA_BRIDGE_SETUP both enabled, and CONFIG_VGA_ROM_RUN and CONFIG_PCI_ROM_RUN both disabled.<br />
<br />
Finally, configure the SeaBIOS '''out/bios.bin.elf''' file as the coreboot payload and build coreboot. The resulting '''coreboot.rom''' file will contain both SeaBIOS and coreboot, and it can be flashed to a ROM chip.<br />
<br />
= SeaBIOS and CBFS =<br />
<br />
SeaBIOS can read the coreboot flash filesystem and extract files.<br />
<br />
When SeaBIOS scans the target machine's PCI devices, it will recognize option ROMs in CBFS that have the form '''pciVVVV,DDDD.rom'''. It will also run any file in the directory '''vgaroms/''' as a VGA option ROM not specific to a device and files in '''genroms/''' as a generic option ROM not specific to a device. In the above cases, SeaBIOS will recognize files with a '''.lzma''' suffix, and automatically decompress them (eg, '''pci1106,3344.rom.lzma''' and '''vgaroms/sgabios.bin.lzma''').<br />
<br />
SeaBIOS can also load a graphical bootsplash image from '''bootsplash.jpg''', payloads found in the CBFS directory '''img/''', and floppy images found in the '''floppyimg/''' directory.<br />
<br />
Further, SeaBIOS can obtain configuration information from CBFS. A file '''bootorder''' determines the order of devices and methods to attempt to boot the system from.<br />
<br />
The examples below show some common uses of these features.<br />
<br />
== Adding a VGA option ROM ==<br />
<br />
It is frequently necessary to add a VGA option ROM to CBFS in order to use a VGA adapter that is built-in to a motherboard. Note, VGA adapters on external cards (PCI, AGP, PCIe) do not require this step as SeaBIOS will automatically extract the VGA BIOS directly from the card. For machines without a VGA adapter, please follow the [[#Adding sgabios support|sgabios instructions]] below.<br />
<br />
The first step is to find the vendor and device ID of the built-in VGA adapter. This information can be found from '''lspci''':<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
01:00.0 VGA compatible controller [0300]: VIA Technologies, Inc. UniChrome Pro IGP ['''1106:3344'''] (rev 01) (prog-if 00 [VGA controller])<br />
</source><br />
<br />
In the above example, the VGA vendor/device ID is '''1106:3344'''. [[VGA support#How_to_retrieve_a_good_video_bios|Obtain the VGA ROM]] (eg, '''vgabios.bin''') and add it to the ROM with:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add /path/to/vgabios.bin pci1106,3344.rom raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
Alternatively, SeaBIOS supports LZMA compressed option ROMs. Use the following to add a compressed option ROM instead:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/vgabios.bin > vgabios.bin.lzma<br />
$ ./build/cbfstool coreboot.rom add vgabios.bin.lzma pci1106,3344.rom.lzma raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
After the above is done, one can write the '''coreboot.rom''' file to flash. SeaBIOS will extract the VGA ROM and run it during boot.<br />
<br />
== Adding gpxe support ==<br />
<br />
A [[GPXE|gpxe]] option ROM can nicely complement SeaBIOS and coreboot by adding network boot support. Adding gpxe is similar to [[#Adding a VGA option ROM]]. The first step is to find the Ethernet vendor/device ID. For example:<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
00:09.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet ['''10ec:8167'''] (rev 10)<br />
</source><br />
<br />
Then one can build a gpxe option ROM. For example:<br />
<br />
<source lang="bash"><br />
$ cd /path/to/gpxe/src/<br />
$ make bin/10ec8167.rom<br />
</source><br />
<br />
And add it to the coreboot image. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add /path/to/gpxe/src/bin/10ec8167.rom pci10ec,8167.rom raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
As with VGA option ROMs, the gpxe option ROM may be compressed with LZMA. However, compression won't significantly reduce gpxe's size as it implements its own compression.<br />
<br />
In addition to gpxe, other option ROMs can be added in the same manner.<br />
<br />
== Adding sgabios support ==<br />
<br />
An [http://code.google.com/p/sgabios/ sgabios] option ROM can forward many VGA BIOS requests and keyboard events over a serial port. One can deploy it in addition to the primary VGA BIOS or by itself.<br />
<br />
If the target machine does not have a VGA adapter, then one should install sgabios. Most bootloaders (eg, GRUB) require a VGA BIOS in order to function properly &mdash; the sgabios ROM can fill this requirement.<br />
<br />
Place the sgabios ROM file in the '''vgaroms/''' directory of CBFS. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add /path/to/sgabios.bin vgaroms/sgabios.bin raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
When using sgabios, all the characters that SeaBIOS writes to the screen will be seen twice &mdash; once from SeaBIOS sending the character to the serial port and once from sgabios forwarding the character. To prevent the duplicates one can edit the SeaBIOS '''src/config.h''' file and set the following:<br />
<br />
<source lang="C"><br />
#define CONFIG_SCREEN_AND_DEBUG 0<br />
</source><br />
<br />
== Adding a graphical "bootsplash" image ==<br />
<br />
SeaBIOS can show a custom [http://en.wikipedia.org/wiki/JPEG JPEG] image during bootup. To enable this, add the JPEG file to flash with the name '''bootsplash.jpg'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add /path/to/image.jpg bootsplash.jpg raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
The size of the JPEG image determines the video mode to use for showing the image. Make sure the dimensions of the image exactly correspond to an available video mode (eg, 640x480, or 1024x768), otherwise it will not be displayed.<br />
<br />
SeaBIOS will show the image during the wait for the boot menu (if the boot menu has been disabled, users will not see the image). The image should probably have "Press F12 for boot menu" embedded in it so users know they can enter the normal SeaBIOS boot menu. By default, the boot menu prompt (and thus graphical image) is shown for 2.5 seconds. This can be customized by modifying SeaBIOS' '''src/config.h''' file and changing the '''CONFIG_BOOTMENU_WAIT''' setting.<br />
<br />
The JPEG viewer in SeaBIOS uses a simplified decoding algorithm. It supports most common JPEGs, but does not support all possible formats. Please see the [[#Trouble reporting]] section if a valid image isn't displayed properly.<br />
<br />
== Adding payloads ==<br />
<br />
Most [[Payloads|payloads]] can also be launched from SeaBIOS. To add a payload, build the corresponding .elf file and then add it to the '''coreboot.rom''' file in the '''img/''' directory. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add-payload /path/to/payload.elf img/MyPayload l<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
During boot, one can press the '''F12''' key to get a boot menu. SeaBIOS will show all files in the '''img/''' directory, and one can instruct SeaBIOS to run them.<br />
<br />
SeaBIOS supports both uncompressed and LZMA compressed payloads.<br />
<br />
== Adding a floppy image ==<br />
<br />
It is possible to embed an image of a floppy in flash. SeaBIOS can then boot from and redirect floppy BIOS calls to the flash image. This is mainly useful for legacy software (such as DOS utilities). To use this feature, place a floppy image into the CBFS directory '''floppyimg/'''. For example:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/myfloppy.img > myfloppy.img.lzma<br />
$ ./build/cbfstool coreboot.rom add myfloppy.img.lzma floppyimg/MyFloppy.lzma raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
Both uncompressed and LZMA compressed images are supported. Several floppy formats are available: 360K, 1.2MB, 720K, 1.44MB, 2.88MB, 160K, 180K, 320K.<br />
<br />
The floppy image will appear as writable to the system, however all writes are discarded on reboot.<br />
<br />
When using this system, SeaBIOS reserves high-memory to store the floppy. The reserved memory is then no longer available for OS use, so this feature should only be used when needed.<br />
<br />
== Configuring boot order ==<br />
<br />
Place a file in CBFS with the name '''bootorder''' to configure the boot up order. The file should be ASCII text and contain one line per boot method. The description of each boot method follows an Open Firmware device path format. SeaBIOS will attempt to boot from each item in the file - first line of the file first.<br />
<br />
The easiest way to find the available boot methods is to look for "Searching bootorder for" in the SeaBIOS serial output. For example, one may see lines similar to:<br />
<br />
Searching bootorder for: /pci@i0cf8/*@f/drive@1/disk@0<br />
Searching bootorder for: /pci@i0cf8/*@f,1/drive@2/disk@1<br />
Searching bootorder for: /pci@i0cf8/usb@10,4/*@2<br />
<br />
The above represents the patterns SeaBIOS will search for in the bootorder file. However, it's safe to just copy and paste the pattern into bootorder. For example, the file:<br />
<br />
/pci@i0cf8/usb@10,4/*@2<br />
/pci@i0cf8/*@f/drive@1/disk@0<br />
<br />
will instruct SeaBIOS to attempt to boot from the given USB drive first and then attempt the given ATA harddrive second.<br />
<br />
Once a file has been created, add it to CBFS with the name '''bootorder'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/cbfstool coreboot.rom add mybootlist.txt bootorder raw<br />
$ ./build/cbfstool coreboot.rom print<br />
</source><br />
<br />
= Trouble reporting =<br />
<br />
If you are experiencing problems with SeaBIOS, it's useful to increase the debugging level. This is done by editing the '''src/config.h''' file and setting the debug level to a higher number (for example '''8'''):<br />
<br />
<source lang="C"><br />
#define CONFIG_DEBUG_LEVEL 8<br />
</source><br />
<br />
A debug level of 8 will show a lot of diagnostic information without flooding the serial port (levels above 8 will frequently cause too much data).<br />
<br />
To report an issue, please collect the serial boot log with SeaBIOS set to a debug level of 8 and forward the full log along with a description of the problem to the coreboot [[Mailinglist|mailing list]].</div>KevinOConnorhttps://www.coreboot.org/index.php?title=SeaBIOS&diff=10628SeaBIOS2011-03-01T02:44:40Z<p>KevinOConnor: /* Configuring boot order */ No need to warn about new feature - it's now released.</p>
<hr />
<div>[http://www.seabios.org '''SeaBIOS'''] is an open-source legacy BIOS implementation which can be used as a coreboot [[Payloads|payload]]. It implements the standard BIOS calling interfaces that a typical x86 proprietary BIOS implements.<br />
<br />
This page describes using SeaBIOS with coreboot. SeaBIOS can also run natively in [[QEMU]] and bochs &mdash; see the [http://git.linuxtogo.org/?p=kevin/seabios.git;a=blob;f=README;hb=HEAD SeaBIOS README] file for information on non-coreboot uses.<br />
<br />
= Use cases =<br />
<br />
Any software requiring 16-bit BIOS services benefits from SeaBIOS (eg, Windows and DOS). SeaBIOS also enables booting Linux out of the box (using standard boot-loaders like GRUB and Syslinux).<br />
<br />
SeaBIOS supports booting from ATA hard drives, ATAPI CDROMs, USB hard drives, USB CDROMs, payloads in flash, and from [http://en.wikipedia.org/wiki/Option_ROM Option ROMs] (eg, SCSI or network cards). SeaBIOS can initialize and use a PS/2 keyboard or USB keyboard.<br />
<br />
== Windows ==<br />
<br />
SeaBIOS has been tested with Windows XP, Windows Vista (64/32 bit), and Windows 7 Beta (64 bit).<br />
<br />
However, Windows has a very strict ACPI interpreter, and many coreboot boards do not have a complete [[ACPI in coreboot|ACPI definition]]. As a result, many coreboot boards will fail during Windows boot (eg, it may fail with a '''STOP 0xA5''' code).<br />
<br />
So far [[ASUS M2V-MX SE]] and [[GIGABYTE GA-M57SLI-S4]] have known good working ACPI and are able to boot XP/Vista/Windows 7. Please ask on the [[Mailinglist|mailing list]] for the status of other boards/chipsets.<br />
<br />
== Linux ==<br />
<br />
SeaBIOS has been tested with GRUB, LILO, and Syslinux. Linux booting works well.<br />
<br />
== Other ==<br />
<br />
SeaBIOS has also been tested with FreeDOS, NetBSD, and OpenBSD.<br />
<br />
Because SeaBIOS implements the standard x86 BIOS interfaces, it is expected many other operating systems and boot-loaders will work.<br />
<br />
= Building =<br />
<br />
== Building via coreboot's menuconfig ==<br />
<br />
Probably the easiest way to use SeaBIOS as coreboot payload is to simply use the coreboot build process, which downloads and builds SeaBIOS as payload by default nowadays. You just have to run the following in your coreboot checkout:<br />
<br />
<source lang="bash"><br />
$ make menuconfig<br />
$ make<br />
</source><br />
<br />
Both SeaBIOS and coreboot will be built, and SeaBIOS will be added as payload to the '''coreboot.rom''' image that is being built.<br />
<br />
== Manual build ==<br />
<br />
One can download the latest version of SeaBIOS through a git repository:<br />
<br />
<source lang="bash"><br />
$ git clone git://git.seabios.org/seabios.git seabios<br />
$ cd seabios<br />
</source><br />
<br />
There's also a [http://code.coreboot.org/p/seabios/source/changes/master/ gitweb] facility to browse the latest source code online.<br />
<br />
Run make menuconfig and set the following variables:<br />
<br />
* CONFIG_COREBOOT 1<br />
* CONFIG_DEBUG_SERIAL 1<br />
* CONFIG_VGAHOOKS 1<br />
<br />
Then:<br />
<br />
<source lang="bash"><br />
$ make<br />
</source><br />
<br />
The final SeaBIOS payload file is '''out/bios.bin.elf'''.<br />
<br />
== coreboot ==<br />
<br />
For best results, configure coreboot with CONFIG_WRITE_HIGH_TABLES and CONFIG_VGA_BRIDGE_SETUP both enabled, and CONFIG_VGA_ROM_RUN and CONFIG_PCI_ROM_RUN both disabled.<br />
<br />
Finally, configure the SeaBIOS '''out/bios.bin.elf''' file as the coreboot payload and build coreboot. The resulting '''coreboot.rom''' file will contain both SeaBIOS and coreboot, and it can be flashed to a ROM chip.<br />
<br />
= SeaBIOS and CBFS =<br />
<br />
SeaBIOS can read the coreboot flash filesystem and extract files.<br />
<br />
When SeaBIOS scans the target machine's PCI devices, it will recognize option ROMs in CBFS that have the form '''pciVVVV,DDDD.rom'''. It will also run any file in the directory '''vgaroms/''' as a VGA option ROM not specific to a device and files in '''genroms/''' as a generic option ROM not specific to a device. In the above cases, SeaBIOS will recognize files with a '''.lzma''' suffix, and automatically decompress them (eg, '''pci1106,3344.rom.lzma''' and '''vgaroms/sgabios.bin.lzma''').<br />
<br />
SeaBIOS can also load a graphical bootsplash image from '''bootsplash.jpg''', payloads found in the CBFS directory '''img/''', and floppy images found in the '''floppyimg/''' directory.<br />
<br />
Further, SeaBIOS can obtain configuration information from CBFS. A file '''bootorder''' determines the order of devices and methods to attempt to boot the system from.<br />
<br />
The examples below show some common uses of these features.<br />
<br />
== Adding a VGA option ROM ==<br />
<br />
It is frequently necessary to add a VGA option ROM to CBFS in order to use a VGA adapter that is built-in to a motherboard. Note, VGA adapters on external cards (PCI, AGP, PCIe) do not require this step as SeaBIOS will automatically extract the VGA BIOS directly from the card. For machines without a VGA adapter, please follow the [[#Adding sgabios support|sgabios instructions]] below.<br />
<br />
The first step is to find the vendor and device ID of the built-in VGA adapter. This information can be found from '''lspci''':<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
01:00.0 VGA compatible controller [0300]: VIA Technologies, Inc. UniChrome Pro IGP ['''1106:3344'''] (rev 01) (prog-if 00 [VGA controller])<br />
</source><br />
<br />
In the above example, the VGA vendor/device ID is '''1106:3344'''. [[VGA support#How_to_retrieve_a_good_video_bios|Obtain the VGA ROM]] (eg, '''vgabios.bin''') and add it to the ROM with:<br />
<br />
<source lang="bash"><br />
$ ./build/util/cbfstool/cbfstool coreboot.rom add /path/to/vgabios.bin pci1106,3344.rom raw<br />
$ ./build/util/cbfstool/cbfstool coreboot.rom print<br />
</source><br />
<br />
Alternatively, SeaBIOS supports LZMA compressed option ROMs. Use the following to add a compressed option ROM instead:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/vgabios.bin > vgabios.bin.lzma<br />
$ ./build/util/cbfstool/cbfstool coreboot.rom add vgabios.bin.lzma pci1106,3344.rom.lzma raw<br />
$ ./build/util/cbfstool/cbfstool coreboot.rom print<br />
</source><br />
<br />
After the above is done, one can write the '''coreboot.rom''' file to flash. SeaBIOS will extract the VGA ROM and run it during boot.<br />
<br />
== Adding gpxe support ==<br />
<br />
A [[GPXE|gpxe]] option ROM can nicely complement SeaBIOS and coreboot by adding network boot support. Adding gpxe is similar to [[#Adding a VGA option ROM]]. The first step is to find the Ethernet vendor/device ID. For example:<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
00:09.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet ['''10ec:8167'''] (rev 10)<br />
</source><br />
<br />
Then one can build a gpxe option ROM. For example:<br />
<br />
<source lang="bash"><br />
$ cd /path/to/gpxe/src/<br />
$ make bin/10ec8167.rom<br />
</source><br />
<br />
And add it to the coreboot image. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/util/cbfstool/cbfstool coreboot.rom add /path/to/gpxe/src/bin/10ec8167.rom pci10ec,8167.rom raw<br />
$ ./build/util/cbfstool/cbfstool coreboot.rom print<br />
</source><br />
<br />
As with VGA option ROMs, the gpxe option ROM may be compressed with LZMA. However, compression won't significantly reduce gpxe's size as it implements its own compression.<br />
<br />
In addition to gpxe, other option ROMs can be added in the same manner.<br />
<br />
== Adding sgabios support ==<br />
<br />
An [http://code.google.com/p/sgabios/ sgabios] option ROM can forward many VGA BIOS requests and keyboard events over a serial port. One can deploy it in addition to the primary VGA BIOS or by itself.<br />
<br />
If the target machine does not have a VGA adapter, then one should install sgabios. Most bootloaders (eg, GRUB) require a VGA BIOS in order to function properly &mdash; the sgabios ROM can fill this requirement.<br />
<br />
Place the sgabios ROM file in the '''vgaroms/''' directory of CBFS. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/util/cbfstool/cbfstool coreboot.rom add /path/to/sgabios.bin vgaroms/sgabios.bin raw<br />
$ ./build/util/cbfstool/cbfstool coreboot.rom print<br />
</source><br />
<br />
When using sgabios, all the characters that SeaBIOS writes to the screen will be seen twice &mdash; once from SeaBIOS sending the character to the serial port and once from sgabios forwarding the character. To prevent the duplicates one can edit the SeaBIOS '''src/config.h''' file and set the following:<br />
<br />
<source lang="C"><br />
#define CONFIG_SCREEN_AND_DEBUG 0<br />
</source><br />
<br />
== Adding a graphical "bootsplash" image ==<br />
<br />
SeaBIOS can show a custom [http://en.wikipedia.org/wiki/JPEG JPEG] image during bootup. To enable this, add the JPEG file to flash with the name '''bootsplash.jpg'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/util/cbfstool/cbfstool coreboot.rom add /path/to/image.jpg bootsplash.jpg raw<br />
$ ./build/util/cbfstool/cbfstool coreboot.rom print<br />
</source><br />
<br />
The size of the JPEG image determines the video mode to use for showing the image. Make sure the dimensions of the image exactly correspond to an available video mode (eg, 640x480, or 1024x768), otherwise it will not be displayed.<br />
<br />
SeaBIOS will show the image during the wait for the boot menu (if the boot menu has been disabled, users will not see the image). The image should probably have "Press F12 for boot menu" embedded in it so users know they can enter the normal SeaBIOS boot menu. By default, the boot menu prompt (and thus graphical image) is shown for 2.5 seconds. This can be customized by modifying SeaBIOS' '''src/config.h''' file and changing the '''CONFIG_BOOTMENU_WAIT''' setting.<br />
<br />
The JPEG viewer in SeaBIOS uses a simplified decoding algorithm. It supports most common JPEGs, but does not support all possible formats. Please see the [[#Trouble reporting]] section if a valid image isn't displayed properly.<br />
<br />
== Adding payloads ==<br />
<br />
Most [[Payloads|payloads]] can also be launched from SeaBIOS. To add a payload, build the corresponding .elf file and then add it to the '''coreboot.rom''' file in the '''img/''' directory. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/util/cbfstool/cbfstool coreboot.rom add-payload /path/to/payload.elf img/MyPayload l<br />
$ ./build/util/cbfstool/cbfstool coreboot.rom print<br />
</source><br />
<br />
During boot, one can press the '''F12''' key to get a boot menu. SeaBIOS will show all files in the '''img/''' directory, and one can instruct SeaBIOS to run them.<br />
<br />
SeaBIOS supports both uncompressed and LZMA compressed payloads.<br />
<br />
== Adding a floppy image ==<br />
<br />
It is possible to embed an image of a floppy in flash. SeaBIOS can then boot from and redirect floppy BIOS calls to the flash image. This is mainly useful for legacy software (such as DOS utilities). To use this feature, place a floppy image into the CBFS directory '''floppyimg/'''. For example:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/myfloppy.img > myfloppy.img.lzma<br />
$ ./build/util/cbfstool/cbfstool coreboot.rom add myfloppy.img.lzma floppyimg/MyFloppy.lzma raw<br />
$ ./build/util/cbfstool/cbfstool coreboot.rom print<br />
</source><br />
<br />
Both uncompressed and LZMA compressed images are supported. Several floppy formats are available: 360K, 1.2MB, 720K, 1.44MB, 2.88MB, 160K, 180K, 320K.<br />
<br />
The floppy image will appear as writable to the system, however all writes are discarded on reboot.<br />
<br />
When using this system, SeaBIOS reserves high-memory to store the floppy. The reserved memory is then no longer available for OS use, so this feature should only be used when needed.<br />
<br />
== Configuring boot order ==<br />
<br />
Place a file in CBFS with the name '''bootorder''' to configure the boot up order. The file should be ASCII text and contain one line per boot method. The description of each boot method follows an Open Firmware device path format. SeaBIOS will attempt to boot from each item in the file - first line of the file first.<br />
<br />
The easiest way to find the available boot methods is to look for "Searching bootorder for" in the SeaBIOS serial output. For example, one may see lines similar to:<br />
<br />
Searching bootorder for: /pci@i0cf8/*@f/drive@1/disk@0<br />
Searching bootorder for: /pci@i0cf8/*@f,1/drive@2/disk@1<br />
Searching bootorder for: /pci@i0cf8/usb@10,4/*@2<br />
<br />
The above represents the patterns SeaBIOS will search for in the bootorder file. However, it's safe to just copy and paste the pattern into bootorder. For example, the file:<br />
<br />
/pci@i0cf8/usb@10,4/*@2<br />
/pci@i0cf8/*@f/drive@1/disk@0<br />
<br />
will instruct SeaBIOS to attempt to boot from the given USB drive first and then attempt the given ATA harddrive second.<br />
<br />
Once a file has been created, add it to CBFS with the name '''bootorder'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/util/cbfstool/cbfstool coreboot.rom add mybootlist.txt bootorder raw<br />
$ ./build/util/cbfstool/cbfstool coreboot.rom print<br />
</source><br />
<br />
= Trouble reporting =<br />
<br />
If you are experiencing problems with SeaBIOS, it's useful to increase the debugging level. This is done by editing the '''src/config.h''' file and setting the debug level to a higher number (for example '''8'''):<br />
<br />
<source lang="C"><br />
#define CONFIG_DEBUG_LEVEL 8<br />
</source><br />
<br />
A debug level of 8 will show a lot of diagnostic information without flooding the serial port (levels above 8 will frequently cause too much data).<br />
<br />
To report an issue, please collect the serial boot log with SeaBIOS set to a debug level of 8 and forward the full log along with a description of the problem to the coreboot [[Mailinglist|mailing list]].</div>KevinOConnorhttps://www.coreboot.org/index.php?title=SeaBIOS&diff=10452SeaBIOS2011-01-15T17:03:15Z<p>KevinOConnor: /* Adding sgabios support */ Latest sgabios has checksum fix.</p>
<hr />
<div>[http://www.seabios.org '''SeaBIOS'''] is an open-source legacy BIOS implementation which can be used as a coreboot [[Payloads|payload]]. It implements the standard BIOS calling interfaces that a typical x86 proprietary BIOS implements.<br />
<br />
This page describes using SeaBIOS with coreboot. SeaBIOS can also run natively in [[QEMU]] and bochs &mdash; see the [http://git.linuxtogo.org/?p=kevin/seabios.git;a=blob;f=README;hb=HEAD SeaBIOS README] file for information on non-coreboot uses.<br />
<br />
= Use cases =<br />
<br />
Any software requiring 16-bit BIOS services benefits from SeaBIOS (eg, Windows and DOS). SeaBIOS also enables booting Linux out of the box (using standard boot-loaders like GRUB and Syslinux).<br />
<br />
SeaBIOS supports booting from ATA hard drives, ATAPI CDROMs, USB hard drives, USB CDROMs, payloads in flash, and from [http://en.wikipedia.org/wiki/Option_ROM Option ROMs] (eg, SCSI or network cards). SeaBIOS can initialize and use a PS/2 keyboard or USB keyboard.<br />
<br />
== Windows ==<br />
<br />
SeaBIOS has been tested with Windows XP, Windows Vista (64/32 bit), and Windows 7 Beta (64 bit).<br />
<br />
However, Windows has a very strict ACPI interpreter, and many coreboot boards do not have a complete [[ACPI in coreboot|ACPI definition]]. As a result, many coreboot boards will fail during Windows boot (eg, it may fail with a '''STOP 0xA5''' code).<br />
<br />
So far [[ASUS M2V-MX SE]] and [[GIGABYTE GA-M57SLI-S4]] have known good working ACPI and are able to boot XP/Vista/Windows 7. Please ask on the [[Mailinglist|mailing list]] for the status of other boards/chipsets.<br />
<br />
== Linux ==<br />
<br />
SeaBIOS has been tested with GRUB, LILO, and Syslinux. Linux booting works well.<br />
<br />
== Other ==<br />
<br />
SeaBIOS has also been tested with FreeDOS, NetBSD, and OpenBSD.<br />
<br />
Because SeaBIOS implements the standard x86 BIOS interfaces, it is expected many other operating systems and boot-loaders will work.<br />
<br />
= Building =<br />
<br />
== Building via coreboot's menuconfig ==<br />
<br />
Probably the easiest way to use SeaBIOS as coreboot payload is to simply use the coreboot build process, which downloads and builds SeaBIOS as payload by default nowadays. You just have to run the following in your coreboot checkout:<br />
<br />
<source lang="bash"><br />
$ make menuconfig<br />
$ make<br />
</source><br />
<br />
Both SeaBIOS and coreboot will be built, and SeaBIOS will be added as payload to the '''coreboot.rom''' image that is being built.<br />
<br />
== Manual build ==<br />
<br />
One can download the latest version of SeaBIOS through a git repository:<br />
<br />
<source lang="bash"><br />
$ git clone git://git.linuxtogo.org/home/kevin/seabios.git seabios<br />
$ cd seabios<br />
</source><br />
<br />
There's also a [http://git.linuxtogo.org/?p=kevin/seabios.git;a=summary gitweb] facility to browse the latest source code online.<br />
<br />
Edit '''src/config.h''' and set the following values:<br />
<br />
<source lang="C"><br />
#define CONFIG_COREBOOT 1<br />
#define CONFIG_DEBUG_SERIAL 1<br />
#define CONFIG_VGAHOOKS 1<br />
</source><br />
<br />
Then:<br />
<br />
<source lang="bash"><br />
$ make<br />
</source><br />
<br />
The final SeaBIOS payload file is '''out/bios.bin.elf'''.<br />
<br />
=== Compiled SeaBIOS images ===<br />
<br />
It is also possible to download a compiled SeaBIOS image. The latest released version compiled for coreboot is: http://www.linuxtogo.org/~kevin/SeaBIOS/bios.bin.elf-0.6.1<br />
<br />
Other versions are also available at: http://www.linuxtogo.org/~kevin/SeaBIOS/<br />
<br />
== coreboot ==<br />
<br />
For best results, configure coreboot with CONFIG_WRITE_HIGH_TABLES and CONFIG_VGA_BRIDGE_SETUP both enabled, and CONFIG_VGA_ROM_RUN and CONFIG_PCI_ROM_RUN both disabled.<br />
<br />
Finally, configure the SeaBIOS '''out/bios.bin.elf''' file as the coreboot payload and build coreboot. The resulting '''coreboot.rom''' file will contain both SeaBIOS and coreboot, and it can be flashed to a ROM chip.<br />
<br />
= SeaBIOS and CBFS =<br />
<br />
SeaBIOS can read the coreboot flash filesystem and extract files.<br />
<br />
When SeaBIOS scans the target machine's PCI devices, it will recognize option ROMs in CBFS that have the form '''pciVVVV,DDDD.rom'''. It will also run any file in the directory '''vgaroms/''' as a VGA option ROM not specific to a device and files in '''genroms/''' as a generic option ROM not specific to a device. In the above cases, SeaBIOS will recognize files with a '''.lzma''' suffix, and automatically decompress them (eg, '''pci1106,3344.rom.lzma''' and '''vgaroms/sgabios.bin.lzma''').<br />
<br />
SeaBIOS can also load a graphical bootsplash image from '''bootsplash.jpg''', payloads found in the CBFS directory '''img/''', and floppy images found in the '''floppyimg/''' directory.<br />
<br />
Further, SeaBIOS can obtain configuration information from CBFS. A file '''bootorder''' determines the order of devices and methods to attempt to boot the system from.<br />
<br />
The examples below show some common uses of these features.<br />
<br />
== Adding a VGA option ROM ==<br />
<br />
It is frequently necessary to add a VGA option ROM to CBFS in order to use a VGA adapter that is built-in to a motherboard. Note, VGA adapters on external cards (PCI, AGP, PCIe) do not require this step as SeaBIOS will automatically extract the VGA BIOS directly from the card. For machines without a VGA adapter, please follow the [[#Adding sgabios support|sgabios instructions]] below.<br />
<br />
The first step is to find the vendor and device ID of the built-in VGA adapter. This information can be found from '''lspci''':<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
01:00.0 VGA compatible controller [0300]: VIA Technologies, Inc. UniChrome Pro IGP ['''1106:3344'''] (rev 01) (prog-if 00 [VGA controller])<br />
</source><br />
<br />
In the above example, the VGA vendor/device ID is '''1106:3344'''. [[VGA support#How_to_retrieve_a_good_video_bios|Obtain the VGA ROM]] (eg, '''vgabios.bin''') and add it to the ROM with:<br />
<br />
<source lang="bash"><br />
$ ./build/util/cbfstool/cbfstool coreboot.rom add /path/to/vgabios.bin pci1106,3344.rom raw<br />
$ ./build/util/cbfstool/cbfstool coreboot.rom print<br />
</source><br />
<br />
Alternatively, SeaBIOS supports LZMA compressed option ROMs. Use the following to add a compressed option ROM instead:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/vgabios.bin > vgabios.bin.lzma<br />
$ ./build/util/cbfstool/cbfstool coreboot.rom add vgabios.bin.lzma pci1106,3344.rom.lzma raw<br />
$ ./build/util/cbfstool/cbfstool coreboot.rom print<br />
</source><br />
<br />
After the above is done, one can write the '''coreboot.rom''' file to flash. SeaBIOS will extract the VGA ROM and run it during boot.<br />
<br />
== Adding gpxe support ==<br />
<br />
A [[GPXE|gpxe]] option ROM can nicely complement SeaBIOS and coreboot by adding network boot support. Adding gpxe is similar to [[#Adding a VGA option ROM]]. The first step is to find the Ethernet vendor/device ID. For example:<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
00:09.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet ['''10ec:8167'''] (rev 10)<br />
</source><br />
<br />
Then one can build a gpxe option ROM. For example:<br />
<br />
<source lang="bash"><br />
$ cd /path/to/gpxe/src/<br />
$ make bin/10ec8167.rom<br />
</source><br />
<br />
And add it to the coreboot image. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/util/cbfstool/cbfstool coreboot.rom add /path/to/gpxe/src/bin/10ec8167.rom pci10ec,8167.rom raw<br />
$ ./build/util/cbfstool/cbfstool coreboot.rom print<br />
</source><br />
<br />
As with VGA option ROMs, the gpxe option ROM may be compressed with LZMA. However, compression won't significantly reduce gpxe's size as it implements its own compression.<br />
<br />
In addition to gpxe, other option ROMs can be added in the same manner.<br />
<br />
== Adding sgabios support ==<br />
<br />
An [http://code.google.com/p/sgabios/ sgabios] option ROM can forward many VGA BIOS requests and keyboard events over a serial port. One can deploy it in addition to the primary VGA BIOS or by itself.<br />
<br />
If the target machine does not have a VGA adapter, then one should install sgabios. Most bootloaders (eg, GRUB) require a VGA BIOS in order to function properly &mdash; the sgabios ROM can fill this requirement.<br />
<br />
Place the sgabios ROM file in the '''vgaroms/''' directory of CBFS. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/util/cbfstool/cbfstool coreboot.rom add /path/to/sgabios.bin vgaroms/sgabios.bin raw<br />
$ ./build/util/cbfstool/cbfstool coreboot.rom print<br />
</source><br />
<br />
When using sgabios, all the characters that SeaBIOS writes to the screen will be seen twice &mdash; once from SeaBIOS sending the character to the serial port and once from sgabios forwarding the character. To prevent the duplicates one can edit the SeaBIOS '''src/config.h''' file and set the following:<br />
<br />
<source lang="C"><br />
#define CONFIG_SCREEN_AND_DEBUG 0<br />
</source><br />
<br />
== Adding a graphical "bootsplash" image ==<br />
<br />
SeaBIOS can show a custom [http://en.wikipedia.org/wiki/JPEG JPEG] image during bootup. To enable this, add the JPEG file to flash with the name '''bootsplash.jpg'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/util/cbfstool/cbfstool coreboot.rom add /path/to/image.jpg bootsplash.jpg raw<br />
$ ./build/util/cbfstool/cbfstool coreboot.rom print<br />
</source><br />
<br />
The size of the JPEG image determines the video mode to use for showing the image. Make sure the dimensions of the image exactly correspond to an available video mode (eg, 640x480, or 1024x768), otherwise it will not be displayed.<br />
<br />
SeaBIOS will show the image during the wait for the boot menu (if the boot menu has been disabled, users will not see the image). The image should probably have "Press F12 for boot menu" embedded in it so users know they can enter the normal SeaBIOS boot menu. By default, the boot menu prompt (and thus graphical image) is shown for 2.5 seconds. This can be customized by modifying SeaBIOS' '''src/config.h''' file and changing the '''CONFIG_BOOTMENU_WAIT''' setting.<br />
<br />
The JPEG viewer in SeaBIOS uses a simplified decoding algorithm. It supports most common JPEGs, but does not support all possible formats. Please see the [[#Trouble reporting]] section if a valid image isn't displayed properly.<br />
<br />
== Adding payloads ==<br />
<br />
Most [[Payloads|payloads]] can also be launched from SeaBIOS. To add a payload, build the corresponding .elf file and then add it to the '''coreboot.rom''' file in the '''img/''' directory. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/util/cbfstool/cbfstool coreboot.rom add-payload /path/to/payload.elf img/MyPayload l<br />
$ ./build/util/cbfstool/cbfstool coreboot.rom print<br />
</source><br />
<br />
During boot, one can press the '''F12''' key to get a boot menu. SeaBIOS will show all files in the '''img/''' directory, and one can instruct SeaBIOS to run them.<br />
<br />
SeaBIOS supports both uncompressed and LZMA compressed payloads.<br />
<br />
== Adding a floppy image ==<br />
<br />
It is possible to embed an image of a floppy in flash. SeaBIOS can then boot from and redirect floppy BIOS calls to the flash image. This is mainly useful for legacy software (such as DOS utilities). To use this feature, place a floppy image into the CBFS directory '''floppyimg/'''. For example:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/myfloppy.img > myfloppy.img.lzma<br />
$ ./build/util/cbfstool/cbfstool coreboot.rom add myfloppy.img.lzma floppyimg/MyFloppy.lzma raw<br />
$ ./build/util/cbfstool/cbfstool coreboot.rom print<br />
</source><br />
<br />
Both uncompressed and LZMA compressed images are supported. Several floppy formats are available: 360K, 1.2MB, 720K, 1.44MB, 2.88MB, 160K, 180K, 320K.<br />
<br />
The floppy image will appear as writable to the system, however all writes are discarded on reboot.<br />
<br />
When using this system, SeaBIOS reserves high-memory to store the floppy. The reserved memory is then no longer available for OS use, so this feature should only be used when needed.<br />
<br />
== Configuring boot order ==<br />
<br />
'''This feature is only available in SeaBIOS git versions after 20110104.'''<br />
<br />
Place a file in CBFS with the name '''bootorder''' to configure the boot up order. The file should be ASCII text and contain one line per boot method. The description of each boot method follows an Open Firmware device path format. SeaBIOS will attempt to boot from each item in the file - first line of the file first.<br />
<br />
The easiest way to find the available boot methods is to look for "Searching bootorder for" in the SeaBIOS serial output. For example, one may see lines similar to:<br />
<br />
Searching bootorder for: /pci@i0cf8/*@f/drive@1/disk@0<br />
Searching bootorder for: /pci@i0cf8/*@f,1/drive@2/disk@1<br />
Searching bootorder for: /pci@i0cf8/usb@10,4/*@2<br />
<br />
The above represents the patterns SeaBIOS will search for in the bootorder file. However, it's safe to just copy and paste the pattern into bootorder. For example, the file:<br />
<br />
/pci@i0cf8/usb@10,4/*@2<br />
/pci@i0cf8/*@f/drive@1/disk@0<br />
<br />
will instruct SeaBIOS to attempt to boot from the given USB drive first and then attempt the given ATA harddrive second.<br />
<br />
Once a file has been created, add it to CBFS with the name '''bootorder'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/util/cbfstool/cbfstool coreboot.rom add mybootlist.txt bootorder raw<br />
$ ./build/util/cbfstool/cbfstool coreboot.rom print<br />
</source><br />
<br />
= Trouble reporting =<br />
<br />
If you are experiencing problems with SeaBIOS, it's useful to increase the debugging level. This is done by editing the '''src/config.h''' file and setting the debug level to a higher number (for example '''8'''):<br />
<br />
<source lang="C"><br />
#define CONFIG_DEBUG_LEVEL 8<br />
</source><br />
<br />
A debug level of 8 will show a lot of diagnostic information without flooding the serial port (levels above 8 will frequently cause too much data).<br />
<br />
To report an issue, please collect the serial boot log with SeaBIOS set to a debug level of 8 and forward the full log along with a description of the problem to the coreboot [[Mailinglist|mailing list]].</div>KevinOConnorhttps://www.coreboot.org/index.php?title=SeaBIOS&diff=10434SeaBIOS2011-01-14T00:44:03Z<p>KevinOConnor: /* Configuring boot order */ Remove caveats (now fixed in git); note only available in git.</p>
<hr />
<div>[http://www.seabios.org '''SeaBIOS'''] is an open-source legacy BIOS implementation which can be used as a coreboot [[Payloads|payload]]. It implements the standard BIOS calling interfaces that a typical x86 proprietary BIOS implements.<br />
<br />
This page describes using SeaBIOS with coreboot. SeaBIOS can also run natively in [[QEMU]] and bochs &mdash; see the [http://git.linuxtogo.org/?p=kevin/seabios.git;a=blob;f=README;hb=HEAD SeaBIOS README] file for information on non-coreboot uses.<br />
<br />
= Use cases =<br />
<br />
Any software requiring 16-bit BIOS services benefits from SeaBIOS (eg, Windows and DOS). SeaBIOS also enables booting Linux out of the box (using standard boot-loaders like GRUB and Syslinux).<br />
<br />
SeaBIOS supports booting from ATA hard drives, ATAPI CDROMs, USB hard drives, USB CDROMs, payloads in flash, and from [http://en.wikipedia.org/wiki/Option_ROM Option ROMs] (eg, SCSI or network cards). SeaBIOS can initialize and use a PS/2 keyboard or USB keyboard.<br />
<br />
== Windows ==<br />
<br />
SeaBIOS has been tested with Windows XP, Windows Vista (64/32 bit), and Windows 7 Beta (64 bit).<br />
<br />
However, Windows has a very strict ACPI interpreter, and many coreboot boards do not have a complete [[ACPI in coreboot|ACPI definition]]. As a result, many coreboot boards will fail during Windows boot (eg, it may fail with a '''STOP 0xA5''' code).<br />
<br />
So far [[ASUS M2V-MX SE]] and [[GIGABYTE GA-M57SLI-S4]] have known good working ACPI and are able to boot XP/Vista/Windows 7. Please ask on the [[Mailinglist|mailing list]] for the status of other boards/chipsets.<br />
<br />
== Linux ==<br />
<br />
SeaBIOS has been tested with GRUB, LILO, and Syslinux. Linux booting works well.<br />
<br />
== Other ==<br />
<br />
SeaBIOS has also been tested with FreeDOS, NetBSD, and OpenBSD.<br />
<br />
Because SeaBIOS implements the standard x86 BIOS interfaces, it is expected many other operating systems and boot-loaders will work.<br />
<br />
= Building =<br />
<br />
== Building via coreboot's menuconfig ==<br />
<br />
Probably the easiest way to use SeaBIOS as coreboot payload is to simply use the coreboot build process, which downloads and builds SeaBIOS as payload by default nowadays. You just have to run the following in your coreboot checkout:<br />
<br />
<source lang="bash"><br />
$ make menuconfig<br />
$ make<br />
</source><br />
<br />
Both SeaBIOS and coreboot will be built, and SeaBIOS will be added as payload to the '''coreboot.rom''' image that is being built.<br />
<br />
== Manual build ==<br />
<br />
One can download the latest version of SeaBIOS through a git repository:<br />
<br />
<source lang="bash"><br />
$ git clone git://git.linuxtogo.org/home/kevin/seabios.git seabios<br />
$ cd seabios<br />
</source><br />
<br />
There's also a [http://git.linuxtogo.org/?p=kevin/seabios.git;a=summary gitweb] facility to browse the latest source code online.<br />
<br />
Edit '''src/config.h''' and set the following values:<br />
<br />
<source lang="C"><br />
#define CONFIG_COREBOOT 1<br />
#define CONFIG_DEBUG_SERIAL 1<br />
#define CONFIG_VGAHOOKS 1<br />
</source><br />
<br />
Then:<br />
<br />
<source lang="bash"><br />
$ make<br />
</source><br />
<br />
The final SeaBIOS payload file is '''out/bios.bin.elf'''.<br />
<br />
=== Compiled SeaBIOS images ===<br />
<br />
It is also possible to download a compiled SeaBIOS image. The latest released version compiled for coreboot is: http://www.linuxtogo.org/~kevin/SeaBIOS/bios.bin.elf-0.6.1<br />
<br />
Other versions are also available at: http://www.linuxtogo.org/~kevin/SeaBIOS/<br />
<br />
== coreboot ==<br />
<br />
For best results, configure coreboot with CONFIG_WRITE_HIGH_TABLES and CONFIG_VGA_BRIDGE_SETUP both enabled, and CONFIG_VGA_ROM_RUN and CONFIG_PCI_ROM_RUN both disabled.<br />
<br />
Finally, configure the SeaBIOS '''out/bios.bin.elf''' file as the coreboot payload and build coreboot. The resulting '''coreboot.rom''' file will contain both SeaBIOS and coreboot, and it can be flashed to a ROM chip.<br />
<br />
= SeaBIOS and CBFS =<br />
<br />
SeaBIOS can read the coreboot flash filesystem and extract files.<br />
<br />
When SeaBIOS scans the target machine's PCI devices, it will recognize option ROMs in CBFS that have the form '''pciVVVV,DDDD.rom'''. It will also run any file in the directory '''vgaroms/''' as a VGA option ROM not specific to a device and files in '''genroms/''' as a generic option ROM not specific to a device. In the above cases, SeaBIOS will recognize files with a '''.lzma''' suffix, and automatically decompress them (eg, '''pci1106,3344.rom.lzma''' and '''vgaroms/sgabios.bin.lzma''').<br />
<br />
SeaBIOS can also load a graphical bootsplash image from '''bootsplash.jpg''', payloads found in the CBFS directory '''img/''', and floppy images found in the '''floppyimg/''' directory.<br />
<br />
Further, SeaBIOS can obtain configuration information from CBFS. A file '''bootorder''' determines the order of devices and methods to attempt to boot the system from.<br />
<br />
The examples below show some common uses of these features.<br />
<br />
== Adding a VGA option ROM ==<br />
<br />
It is frequently necessary to add a VGA option ROM to CBFS in order to use a VGA adapter that is built-in to a motherboard. Note, VGA adapters on external cards (PCI, AGP, PCIe) do not require this step as SeaBIOS will automatically extract the VGA BIOS directly from the card. For machines without a VGA adapter, please follow the [[#Adding sgabios support|sgabios instructions]] below.<br />
<br />
The first step is to find the vendor and device ID of the built-in VGA adapter. This information can be found from '''lspci''':<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
01:00.0 VGA compatible controller [0300]: VIA Technologies, Inc. UniChrome Pro IGP ['''1106:3344'''] (rev 01) (prog-if 00 [VGA controller])<br />
</source><br />
<br />
In the above example, the VGA vendor/device ID is '''1106:3344'''. [[VGA support#How_to_retrieve_a_good_video_bios|Obtain the VGA ROM]] (eg, '''vgabios.bin''') and add it to the ROM with:<br />
<br />
<source lang="bash"><br />
$ ./build/util/cbfstool/cbfstool coreboot.rom add /path/to/vgabios.bin pci1106,3344.rom raw<br />
$ ./build/util/cbfstool/cbfstool coreboot.rom print<br />
</source><br />
<br />
Alternatively, SeaBIOS supports LZMA compressed option ROMs. Use the following to add a compressed option ROM instead:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/vgabios.bin > vgabios.bin.lzma<br />
$ ./build/util/cbfstool/cbfstool coreboot.rom add vgabios.bin.lzma pci1106,3344.rom.lzma raw<br />
$ ./build/util/cbfstool/cbfstool coreboot.rom print<br />
</source><br />
<br />
After the above is done, one can write the '''coreboot.rom''' file to flash. SeaBIOS will extract the VGA ROM and run it during boot.<br />
<br />
== Adding gpxe support ==<br />
<br />
A [[GPXE|gpxe]] option ROM can nicely complement SeaBIOS and coreboot by adding network boot support. Adding gpxe is similar to [[#Adding a VGA option ROM]]. The first step is to find the Ethernet vendor/device ID. For example:<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
00:09.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet ['''10ec:8167'''] (rev 10)<br />
</source><br />
<br />
Then one can build a gpxe option ROM. For example:<br />
<br />
<source lang="bash"><br />
$ cd /path/to/gpxe/src/<br />
$ make bin/10ec8167.rom<br />
</source><br />
<br />
And add it to the coreboot image. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/util/cbfstool/cbfstool coreboot.rom add /path/to/gpxe/src/bin/10ec8167.rom pci10ec,8167.rom raw<br />
$ ./build/util/cbfstool/cbfstool coreboot.rom print<br />
</source><br />
<br />
As with VGA option ROMs, the gpxe option ROM may be compressed with LZMA. However, compression won't significantly reduce gpxe's size as it implements its own compression.<br />
<br />
In addition to gpxe, other option ROMs can be added in the same manner.<br />
<br />
== Adding sgabios support ==<br />
<br />
An [http://code.google.com/p/sgabios/ sgabios] option ROM can forward many VGA BIOS requests and keyboard events over a serial port. One can deploy it in addition to the primary VGA BIOS or by itself.<br />
<br />
If the target machine does not have a VGA adapter, then one should install sgabios. Most bootloaders (eg, GRUB) require a VGA BIOS in order to function properly &mdash; the sgabios ROM can fill this requirement.<br />
<br />
The current version of sgabios (as of 20090617) does not implement a proper checksum. As a work around, a tool from the SeaBIOS source repo can fix the checksum:<br />
<source lang="bash"><br />
$ /path/to/seabios/tools/buildrom.py /path/to/sgabios.bin sgabios-fixed.bin<br />
</source><br />
<br />
Once the above is done, place the ROM file in the '''vgaroms/''' directory of CBFS. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/util/cbfstool/cbfstool coreboot.rom add sgabios-fixed.bin vgaroms/sgabios.bin raw<br />
$ ./build/util/cbfstool/cbfstool coreboot.rom print<br />
</source><br />
<br />
When using sgabios, all the characters that SeaBIOS writes to the screen will be seen twice &mdash; once from SeaBIOS sending the character to the serial port and once from sgabios forwarding the character. To prevent the duplicates one can edit the SeaBIOS '''src/config.h''' file and set the following:<br />
<br />
<source lang="C"><br />
#define CONFIG_SCREEN_AND_DEBUG 0<br />
</source><br />
<br />
== Adding a graphical "bootsplash" image ==<br />
<br />
SeaBIOS can show a custom [http://en.wikipedia.org/wiki/JPEG JPEG] image during bootup. To enable this, add the JPEG file to flash with the name '''bootsplash.jpg'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/util/cbfstool/cbfstool coreboot.rom add /path/to/image.jpg bootsplash.jpg raw<br />
$ ./build/util/cbfstool/cbfstool coreboot.rom print<br />
</source><br />
<br />
The size of the JPEG image determines the video mode to use for showing the image. Make sure the dimensions of the image exactly correspond to an available video mode (eg, 640x480, or 1024x768), otherwise it will not be displayed.<br />
<br />
SeaBIOS will show the image during the wait for the boot menu (if the boot menu has been disabled, users will not see the image). The image should probably have "Press F12 for boot menu" embedded in it so users know they can enter the normal SeaBIOS boot menu. By default, the boot menu prompt (and thus graphical image) is shown for 2.5 seconds. This can be customized by modifying SeaBIOS' '''src/config.h''' file and changing the '''CONFIG_BOOTMENU_WAIT''' setting.<br />
<br />
The JPEG viewer in SeaBIOS uses a simplified decoding algorithm. It supports most common JPEGs, but does not support all possible formats. Please see the [[#Trouble reporting]] section if a valid image isn't displayed properly.<br />
<br />
== Adding payloads ==<br />
<br />
Most [[Payloads|payloads]] can also be launched from SeaBIOS. To add a payload, build the corresponding .elf file and then add it to the '''coreboot.rom''' file in the '''img/''' directory. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/util/cbfstool/cbfstool coreboot.rom add-payload /path/to/payload.elf img/MyPayload l<br />
$ ./build/util/cbfstool/cbfstool coreboot.rom print<br />
</source><br />
<br />
During boot, one can press the '''F12''' key to get a boot menu. SeaBIOS will show all files in the '''img/''' directory, and one can instruct SeaBIOS to run them.<br />
<br />
SeaBIOS supports both uncompressed and LZMA compressed payloads.<br />
<br />
== Adding a floppy image ==<br />
<br />
It is possible to embed an image of a floppy in flash. SeaBIOS can then boot from and redirect floppy BIOS calls to the flash image. This is mainly useful for legacy software (such as DOS utilities). To use this feature, place a floppy image into the CBFS directory '''floppyimg/'''. For example:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/myfloppy.img > myfloppy.img.lzma<br />
$ ./build/util/cbfstool/cbfstool coreboot.rom add myfloppy.img.lzma floppyimg/MyFloppy.lzma raw<br />
$ ./build/util/cbfstool/cbfstool coreboot.rom print<br />
</source><br />
<br />
Both uncompressed and LZMA compressed images are supported. Several floppy formats are available: 360K, 1.2MB, 720K, 1.44MB, 2.88MB, 160K, 180K, 320K.<br />
<br />
The floppy image will appear as writable to the system, however all writes are discarded on reboot.<br />
<br />
When using this system, SeaBIOS reserves high-memory to store the floppy. The reserved memory is then no longer available for OS use, so this feature should only be used when needed.<br />
<br />
== Configuring boot order ==<br />
<br />
'''This feature is only available in SeaBIOS git versions after 20110104.'''<br />
<br />
Place a file in CBFS with the name '''bootorder''' to configure the boot up order. The file should be ASCII text and contain one line per boot method. The description of each boot method follows an Open Firmware device path format. SeaBIOS will attempt to boot from each item in the file - first line of the file first.<br />
<br />
The easiest way to find the available boot methods is to look for "Searching bootorder for" in the SeaBIOS serial output. For example, one may see lines similar to:<br />
<br />
Searching bootorder for: /pci@i0cf8/*@f/drive@1/disk@0<br />
Searching bootorder for: /pci@i0cf8/*@f,1/drive@2/disk@1<br />
Searching bootorder for: /pci@i0cf8/usb@10,4/*@2<br />
<br />
The above represents the patterns SeaBIOS will search for in the bootorder file. However, it's safe to just copy and paste the pattern into bootorder. For example, the file:<br />
<br />
/pci@i0cf8/usb@10,4/*@2<br />
/pci@i0cf8/*@f/drive@1/disk@0<br />
<br />
will instruct SeaBIOS to attempt to boot from the given USB drive first and then attempt the given ATA harddrive second.<br />
<br />
Once a file has been created, add it to CBFS with the name '''bootorder'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/util/cbfstool/cbfstool coreboot.rom add mybootlist.txt bootorder raw<br />
$ ./build/util/cbfstool/cbfstool coreboot.rom print<br />
</source><br />
<br />
= Trouble reporting =<br />
<br />
If you are experiencing problems with SeaBIOS, it's useful to increase the debugging level. This is done by editing the '''src/config.h''' file and setting the debug level to a higher number (for example '''8'''):<br />
<br />
<source lang="C"><br />
#define CONFIG_DEBUG_LEVEL 8<br />
</source><br />
<br />
A debug level of 8 will show a lot of diagnostic information without flooding the serial port (levels above 8 will frequently cause too much data).<br />
<br />
To report an issue, please collect the serial boot log with SeaBIOS set to a debug level of 8 and forward the full log along with a description of the problem to the coreboot [[Mailinglist|mailing list]].</div>KevinOConnorhttps://www.coreboot.org/index.php?title=SeaBIOS&diff=10397SeaBIOS2011-01-08T16:21:13Z<p>KevinOConnor: /* SeaBIOS and CBFS */ Add info on bootorder</p>
<hr />
<div>[http://www.seabios.org '''SeaBIOS'''] is an open-source legacy BIOS implementation which can be used as a coreboot [[Payloads|payload]]. It implements the standard BIOS calling interfaces that a typical x86 proprietary BIOS implements.<br />
<br />
This page describes using SeaBIOS with coreboot. SeaBIOS can also run natively in [[QEMU]] and bochs &mdash; see the [http://git.linuxtogo.org/?p=kevin/seabios.git;a=blob;f=README;hb=HEAD SeaBIOS README] file for information on non-coreboot uses.<br />
<br />
= Use cases =<br />
<br />
Any software requiring 16-bit BIOS services benefits from SeaBIOS (eg, Windows and DOS). SeaBIOS also enables booting Linux out of the box (using standard boot-loaders like GRUB and Syslinux).<br />
<br />
SeaBIOS supports booting from ATA hard drives, ATAPI CDROMs, USB hard drives, USB CDROMs, payloads in flash, and from [http://en.wikipedia.org/wiki/Option_ROM Option ROMs] (eg, SCSI or network cards). SeaBIOS can initialize and use a PS/2 keyboard or USB keyboard.<br />
<br />
== Windows ==<br />
<br />
SeaBIOS has been tested with Windows XP, Windows Vista (64/32 bit), and Windows 7 Beta (64 bit).<br />
<br />
However, Windows has a very strict ACPI interpreter, and many coreboot boards do not have a complete [[ACPI in coreboot|ACPI definition]]. As a result, many coreboot boards will fail during Windows boot (eg, it may fail with a '''STOP 0xA5''' code).<br />
<br />
So far [[ASUS M2V-MX SE]] and [[GIGABYTE GA-M57SLI-S4]] have known good working ACPI and are able to boot XP/Vista/Windows 7. Please ask on the [[Mailinglist|mailing list]] for the status of other boards/chipsets.<br />
<br />
== Linux ==<br />
<br />
SeaBIOS has been tested with GRUB, LILO, and Syslinux. Linux booting works well.<br />
<br />
== Other ==<br />
<br />
SeaBIOS has also been tested with FreeDOS, NetBSD, and OpenBSD.<br />
<br />
Because SeaBIOS implements the standard x86 BIOS interfaces, it is expected many other operating systems and boot-loaders will work.<br />
<br />
= Building =<br />
<br />
== Building via coreboot's menuconfig ==<br />
<br />
Probably the easiest way to use SeaBIOS as coreboot payload is to simply use the coreboot build process, which downloads and builds SeaBIOS as payload by default nowadays. You just have to run the following in your coreboot checkout:<br />
<br />
<source lang="bash"><br />
$ make menuconfig<br />
$ make<br />
</source><br />
<br />
Both SeaBIOS and coreboot will be built, and SeaBIOS will be added as payload to the '''coreboot.rom''' image that is being built.<br />
<br />
== Manual build ==<br />
<br />
One can download the latest version of SeaBIOS through a git repository:<br />
<br />
<source lang="bash"><br />
$ git clone git://git.linuxtogo.org/home/kevin/seabios.git seabios<br />
$ cd seabios<br />
</source><br />
<br />
There's also a [http://git.linuxtogo.org/?p=kevin/seabios.git;a=summary gitweb] facility to browse the latest source code online.<br />
<br />
Edit '''src/config.h''' and set the following values:<br />
<br />
<source lang="C"><br />
#define CONFIG_COREBOOT 1<br />
#define CONFIG_DEBUG_SERIAL 1<br />
#define CONFIG_VGAHOOKS 1<br />
</source><br />
<br />
Then:<br />
<br />
<source lang="bash"><br />
$ make<br />
</source><br />
<br />
The final SeaBIOS payload file is '''out/bios.bin.elf'''.<br />
<br />
=== Compiled SeaBIOS images ===<br />
<br />
It is also possible to download a compiled SeaBIOS image. The latest released version compiled for coreboot is: http://www.linuxtogo.org/~kevin/SeaBIOS/bios.bin.elf-0.6.1<br />
<br />
Other versions are also available at: http://www.linuxtogo.org/~kevin/SeaBIOS/<br />
<br />
== coreboot ==<br />
<br />
For best results, configure coreboot with CONFIG_WRITE_HIGH_TABLES and CONFIG_VGA_BRIDGE_SETUP both enabled, and CONFIG_VGA_ROM_RUN and CONFIG_PCI_ROM_RUN both disabled.<br />
<br />
Finally, configure the SeaBIOS '''out/bios.bin.elf''' file as the coreboot payload and build coreboot. The resulting '''coreboot.rom''' file will contain both SeaBIOS and coreboot, and it can be flashed to a ROM chip.<br />
<br />
= SeaBIOS and CBFS =<br />
<br />
SeaBIOS can read the coreboot flash filesystem and extract files.<br />
<br />
When SeaBIOS scans the target machine's PCI devices, it will recognize option ROMs in CBFS that have the form '''pciVVVV,DDDD.rom'''. It will also run any file in the directory '''vgaroms/''' as a VGA option ROM not specific to a device and files in '''genroms/''' as a generic option ROM not specific to a device. In the above cases, SeaBIOS will recognize files with a '''.lzma''' suffix, and automatically decompress them (eg, '''pci1106,3344.rom.lzma''' and '''vgaroms/sgabios.bin.lzma''').<br />
<br />
SeaBIOS can also load a graphical bootsplash image from '''bootsplash.jpg''', payloads found in the CBFS directory '''img/''', and floppy images found in the '''floppyimg/''' directory.<br />
<br />
Further, SeaBIOS can obtain configuration information from CBFS. A file '''bootorder''' determines the order of devices and methods to attempt to boot the system from.<br />
<br />
The examples below show some common uses of these features.<br />
<br />
== Adding a VGA option ROM ==<br />
<br />
It is frequently necessary to add a VGA option ROM to CBFS in order to use a VGA adapter that is built-in to a motherboard. Note, VGA adapters on external cards (PCI, AGP, PCIe) do not require this step as SeaBIOS will automatically extract the VGA BIOS directly from the card. For machines without a VGA adapter, please follow the [[#Adding sgabios support|sgabios instructions]] below.<br />
<br />
The first step is to find the vendor and device ID of the built-in VGA adapter. This information can be found from '''lspci''':<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
01:00.0 VGA compatible controller [0300]: VIA Technologies, Inc. UniChrome Pro IGP ['''1106:3344'''] (rev 01) (prog-if 00 [VGA controller])<br />
</source><br />
<br />
In the above example, the VGA vendor/device ID is '''1106:3344'''. [[VGA support#How_to_retrieve_a_good_video_bios|Obtain the VGA ROM]] (eg, '''vgabios.bin''') and add it to the ROM with:<br />
<br />
<source lang="bash"><br />
$ ./build/util/cbfstool/cbfstool coreboot.rom add /path/to/vgabios.bin pci1106,3344.rom raw<br />
$ ./build/util/cbfstool/cbfstool coreboot.rom print<br />
</source><br />
<br />
Alternatively, SeaBIOS supports LZMA compressed option ROMs. Use the following to add a compressed option ROM instead:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/vgabios.bin > vgabios.bin.lzma<br />
$ ./build/util/cbfstool/cbfstool coreboot.rom add vgabios.bin.lzma pci1106,3344.rom.lzma raw<br />
$ ./build/util/cbfstool/cbfstool coreboot.rom print<br />
</source><br />
<br />
After the above is done, one can write the '''coreboot.rom''' file to flash. SeaBIOS will extract the VGA ROM and run it during boot.<br />
<br />
== Adding gpxe support ==<br />
<br />
A [[GPXE|gpxe]] option ROM can nicely complement SeaBIOS and coreboot by adding network boot support. Adding gpxe is similar to [[#Adding a VGA option ROM]]. The first step is to find the Ethernet vendor/device ID. For example:<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
00:09.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet ['''10ec:8167'''] (rev 10)<br />
</source><br />
<br />
Then one can build a gpxe option ROM. For example:<br />
<br />
<source lang="bash"><br />
$ cd /path/to/gpxe/src/<br />
$ make bin/10ec8167.rom<br />
</source><br />
<br />
And add it to the coreboot image. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/util/cbfstool/cbfstool coreboot.rom add /path/to/gpxe/src/bin/10ec8167.rom pci10ec,8167.rom raw<br />
$ ./build/util/cbfstool/cbfstool coreboot.rom print<br />
</source><br />
<br />
As with VGA option ROMs, the gpxe option ROM may be compressed with LZMA. However, compression won't significantly reduce gpxe's size as it implements its own compression.<br />
<br />
In addition to gpxe, other option ROMs can be added in the same manner.<br />
<br />
== Adding sgabios support ==<br />
<br />
An [http://code.google.com/p/sgabios/ sgabios] option ROM can forward many VGA BIOS requests and keyboard events over a serial port. One can deploy it in addition to the primary VGA BIOS or by itself.<br />
<br />
If the target machine does not have a VGA adapter, then one should install sgabios. Most bootloaders (eg, GRUB) require a VGA BIOS in order to function properly &mdash; the sgabios ROM can fill this requirement.<br />
<br />
The current version of sgabios (as of 20090617) does not implement a proper checksum. As a work around, a tool from the SeaBIOS source repo can fix the checksum:<br />
<source lang="bash"><br />
$ /path/to/seabios/tools/buildrom.py /path/to/sgabios.bin sgabios-fixed.bin<br />
</source><br />
<br />
Once the above is done, place the ROM file in the '''vgaroms/''' directory of CBFS. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/util/cbfstool/cbfstool coreboot.rom add sgabios-fixed.bin vgaroms/sgabios.bin raw<br />
$ ./build/util/cbfstool/cbfstool coreboot.rom print<br />
</source><br />
<br />
When using sgabios, all the characters that SeaBIOS writes to the screen will be seen twice &mdash; once from SeaBIOS sending the character to the serial port and once from sgabios forwarding the character. To prevent the duplicates one can edit the SeaBIOS '''src/config.h''' file and set the following:<br />
<br />
<source lang="C"><br />
#define CONFIG_SCREEN_AND_DEBUG 0<br />
</source><br />
<br />
== Adding a graphical "bootsplash" image ==<br />
<br />
SeaBIOS can show a custom [http://en.wikipedia.org/wiki/JPEG JPEG] image during bootup. To enable this, add the JPEG file to flash with the name '''bootsplash.jpg'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/util/cbfstool/cbfstool coreboot.rom add /path/to/image.jpg bootsplash.jpg raw<br />
$ ./build/util/cbfstool/cbfstool coreboot.rom print<br />
</source><br />
<br />
The size of the JPEG image determines the video mode to use for showing the image. Make sure the dimensions of the image exactly correspond to an available video mode (eg, 640x480, or 1024x768), otherwise it will not be displayed.<br />
<br />
SeaBIOS will show the image during the wait for the boot menu (if the boot menu has been disabled, users will not see the image). The image should probably have "Press F12 for boot menu" embedded in it so users know they can enter the normal SeaBIOS boot menu. By default, the boot menu prompt (and thus graphical image) is shown for 2.5 seconds. This can be customized by modifying SeaBIOS' '''src/config.h''' file and changing the '''CONFIG_BOOTMENU_WAIT''' setting.<br />
<br />
The JPEG viewer in SeaBIOS uses a simplified decoding algorithm. It supports most common JPEGs, but does not support all possible formats. Please see the [[#Trouble reporting]] section if a valid image isn't displayed properly.<br />
<br />
== Adding payloads ==<br />
<br />
Most [[Payloads|payloads]] can also be launched from SeaBIOS. To add a payload, build the corresponding .elf file and then add it to the '''coreboot.rom''' file in the '''img/''' directory. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/util/cbfstool/cbfstool coreboot.rom add-payload /path/to/payload.elf img/MyPayload l<br />
$ ./build/util/cbfstool/cbfstool coreboot.rom print<br />
</source><br />
<br />
During boot, one can press the '''F12''' key to get a boot menu. SeaBIOS will show all files in the '''img/''' directory, and one can instruct SeaBIOS to run them.<br />
<br />
SeaBIOS supports both uncompressed and LZMA compressed payloads.<br />
<br />
== Adding a floppy image ==<br />
<br />
It is possible to embed an image of a floppy in flash. SeaBIOS can then boot from and redirect floppy BIOS calls to the flash image. This is mainly useful for legacy software (such as DOS utilities). To use this feature, place a floppy image into the CBFS directory '''floppyimg/'''. For example:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/myfloppy.img > myfloppy.img.lzma<br />
$ ./build/util/cbfstool/cbfstool coreboot.rom add myfloppy.img.lzma floppyimg/MyFloppy.lzma raw<br />
$ ./build/util/cbfstool/cbfstool coreboot.rom print<br />
</source><br />
<br />
Both uncompressed and LZMA compressed images are supported. Several floppy formats are available: 360K, 1.2MB, 720K, 1.44MB, 2.88MB, 160K, 180K, 320K.<br />
<br />
The floppy image will appear as writable to the system, however all writes are discarded on reboot.<br />
<br />
When using this system, SeaBIOS reserves high-memory to store the floppy. The reserved memory is then no longer available for OS use, so this feature should only be used when needed.<br />
<br />
== Configuring boot order ==<br />
<br />
Place a file in CBFS with the name '''bootorder''' to configure the boot up order. The file should be ASCII text and contain one line per boot method. The description of each boot method follows an Open Firmware device path format. SeaBIOS will attempt to boot from each item in the file - first line of the file first.<br />
<br />
The easiest way to find the available boot methods is to look for "Searching bootorder for" in the SeaBIOS serial output. For example, one may see lines similar to:<br />
<br />
Searching bootorder for: /pci@i0cf8/*@f/drive@1/disk@0<br />
Searching bootorder for: /pci@i0cf8/*@f,1/drive@2/disk@1<br />
Searching bootorder for: /pci@i0cf8/usb@10,4/*@2<br />
<br />
The above represents the patterns SeaBIOS will search for in the bootorder file. However, it's safe to just copy and paste the pattern into bootorder. For example, the file:<br />
<br />
/pci@i0cf8/usb@10,4/*@2<br />
/pci@i0cf8/*@f/drive@1/disk@0<br />
<br />
will instruct SeaBIOS to attempt to boot from the given USB drive first and then attempt the given ATA harddrive second.<br />
<br />
Once a file has been created, add it to CBFS with the name '''bootorder'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./build/util/cbfstool/cbfstool coreboot.rom add mybootlist.txt bootorder raw<br />
$ ./build/util/cbfstool/cbfstool coreboot.rom print<br />
</source><br />
<br />
Note, the device path description for non-bus-zero PCI devices is currently not stable - a future SeaBIOS release will change the syntax of these devices. Also, the SeaBIOS parser can be picky - avoid trailing spaces and use a single newline character to separate lines.<br />
<br />
= Trouble reporting =<br />
<br />
If you are experiencing problems with SeaBIOS, it's useful to increase the debugging level. This is done by editing the '''src/config.h''' file and setting the debug level to a higher number (for example '''8'''):<br />
<br />
<source lang="C"><br />
#define CONFIG_DEBUG_LEVEL 8<br />
</source><br />
<br />
A debug level of 8 will show a lot of diagnostic information without flooding the serial port (levels above 8 will frequently cause too much data).<br />
<br />
To report an issue, please collect the serial boot log with SeaBIOS set to a debug level of 8 and forward the full log along with a description of the problem to the coreboot [[Mailinglist|mailing list]].</div>KevinOConnorhttps://www.coreboot.org/index.php?title=SeaBIOS&diff=10174SeaBIOS2010-11-24T01:36:03Z<p>KevinOConnor: /* Compiled SeaBIOS images */ Fix links (need www)</p>
<hr />
<div>[http://www.seabios.org '''SeaBIOS'''] is an open-source legacy BIOS implementation which can be used as a coreboot [[Payloads|payload]]. It implements the standard BIOS calling interfaces that a typical x86 proprietary BIOS implements.<br />
<br />
This page describes using SeaBIOS with coreboot. SeaBIOS can also run natively in [[QEMU]] and bochs &mdash; see the [http://git.linuxtogo.org/?p=kevin/seabios.git;a=blob;f=README;hb=HEAD SeaBIOS README] file for information on non-coreboot uses.<br />
<br />
= Use cases =<br />
<br />
Any software requiring 16-bit BIOS services benefits from SeaBIOS (eg, Windows and DOS). SeaBIOS also enables booting Linux out of the box (using standard boot-loaders like GRUB and Syslinux).<br />
<br />
SeaBIOS supports booting from ATA hard drives, ATAPI CDROMs, USB hard drives, USB CDROMs, payloads in flash, and from [http://en.wikipedia.org/wiki/Option_ROM Option ROMs] (eg, SCSI or network cards). SeaBIOS can initialize and use a PS/2 keyboard or USB keyboard.<br />
<br />
== Windows ==<br />
<br />
SeaBIOS has been tested with Windows XP, Windows Vista (64/32 bit), and Windows 7 Beta (64 bit).<br />
<br />
However, Windows has a very strict ACPI interpreter, and many coreboot boards do not have a complete [[ACPI in coreboot|ACPI definition]]. As a result, many coreboot boards will fail during Windows boot (eg, it may fail with a '''STOP 0xA5''' code).<br />
<br />
So far [[ASUS M2V-MX SE]] and [[GIGABYTE GA-M57SLI-S4]] have known good working ACPI and are able to boot XP/Vista/Windows 7. Please ask on the [[Mailinglist|mailing list]] for the status of other boards/chipsets.<br />
<br />
== Linux ==<br />
<br />
SeaBIOS has been tested with GRUB, LILO, and Syslinux. Linux booting works well.<br />
<br />
== Other ==<br />
<br />
SeaBIOS has also been tested with FreeDOS, NetBSD, and OpenBSD.<br />
<br />
Because SeaBIOS implements the standard x86 BIOS interfaces, it is expected many other operating systems and boot-loaders will work.<br />
<br />
= Building =<br />
<br />
== SeaBIOS ==<br />
<br />
One can download the latest version of SeaBIOS through a git repository:<br />
<br />
<source lang="bash"><br />
$ git clone git://git.linuxtogo.org/home/kevin/seabios.git seabios<br />
$ cd seabios<br />
</source><br />
<br />
There's also a [http://git.linuxtogo.org/?p=kevin/seabios.git;a=summary gitweb] facility to browse the latest source code online.<br />
<br />
Edit '''src/config.h''' and set the following values:<br />
<br />
<source lang="C"><br />
#define CONFIG_COREBOOT 1<br />
#define CONFIG_DEBUG_SERIAL 1<br />
#define CONFIG_VGAHOOKS 1<br />
</source><br />
<br />
Then:<br />
<br />
<source lang="bash"><br />
$ make<br />
</source><br />
<br />
The final SeaBIOS payload file is '''out/bios.bin.elf'''.<br />
<br />
=== Compiled SeaBIOS images ===<br />
<br />
It is also possible to download a compiled SeaBIOS image. The latest released version compiled for coreboot is: http://www.linuxtogo.org/~kevin/SeaBIOS/bios.bin.elf-0.6.1<br />
<br />
Other versions are also available at: http://www.linuxtogo.org/~kevin/SeaBIOS/<br />
<br />
== coreboot ==<br />
<br />
For best results, configure coreboot with CONFIG_WRITE_HIGH_TABLES and CONFIG_VGA_BRIDGE_SETUP both enabled, and CONFIG_VGA_ROM_RUN and CONFIG_PCI_ROM_RUN both disabled.<br />
<br />
Finally, configure the SeaBIOS '''/out/bios.bin.elf''' file as the coreboot payload and build coreboot. The resulting '''coreboot.rom''' file will contain both SeaBIOS and coreboot, and it can be flashed to a ROM chip.<br />
<br />
= SeaBIOS and CBFS =<br />
<br />
SeaBIOS can read the coreboot flash filesystem and extract files.<br />
<br />
When SeaBIOS scans the target machine's PCI devices, it will recognize option ROMs in CBFS that have the form '''pciVVVV,DDDD.rom'''. It will also run any file in the directory '''vgaroms/''' as a VGA option ROM not specific to a device and files in '''genroms/''' as a generic option ROM not specific to a device. In the above cases, SeaBIOS will recognize files with a '''.lzma''' suffix, and automatically decompress them (eg, '''pci1106,3344.rom.lzma''' and '''vgaroms/sgabios.bin.lzma''').<br />
<br />
SeaBIOS can also load a graphical bootsplash image from '''bootsplash.jpg''', payloads found in the CBFS directory '''img/''', and floppy images found in the '''floppyimg/''' directory.<br />
<br />
The examples below show some common uses of this feature.<br />
<br />
== Adding a VGA option ROM ==<br />
<br />
It is frequently necessary to add a VGA option ROM to CBFS in order to use a VGA adapter that is built-in to a motherboard. Note, VGA adapters on external cards (PCI, AGP, PCIe) do not require this step as SeaBIOS will automatically extract the VGA BIOS directly from the card. For machines without a VGA adapter, please follow the [[#Adding sgabios support|sgabios instructions]] below.<br />
<br />
The first step is to find the vendor and device ID of the built-in VGA adapter. This information can be found from '''lspci''':<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
01:00.0 VGA compatible controller [0300]: VIA Technologies, Inc. UniChrome Pro IGP ['''1106:3344'''] (rev 01) (prog-if 00 [VGA controller])<br />
</source><br />
<br />
In the above example, the VGA vendor/device ID is '''1106:3344'''. [[VGA support#How_to_retrieve_a_good_video_bios|Obtain the VGA ROM]] (eg, '''vgabios.bin''') and add it to the ROM with:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add /path/to/vgabios.bin pci1106,3344.rom raw<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
Alternatively, SeaBIOS supports LZMA compressed option ROMs. Use the following to add a compressed option ROM instead:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/vgabios.bin > vgabios.bin.lzma<br />
$ ./cbfs/cbfstool coreboot.rom add vgabios.bin.lzma pci1106,3344.rom.lzma raw<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
After the above is done, one can write the coreboot.rom file to flash. SeaBIOS will extract the VGA ROM and run it during boot.<br />
<br />
== Adding gpxe support ==<br />
<br />
A [[GPXE|gpxe]] option ROM can nicely complement SeaBIOS and coreboot by adding network boot support. Adding gpxe is similar to [[#Adding a VGA option ROM]]. The first step is to find the Ethernet vendor/device ID. For example:<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
00:09.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet ['''10ec:8167'''] (rev 10)<br />
</source><br />
<br />
Then one can build a gpxe option ROM. For example:<br />
<br />
<source lang="bash"><br />
$ cd /path/to/gpxe/src/<br />
$ make bin/10ec8167.rom<br />
</source><br />
<br />
And add it to the coreboot image. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add /path/to/gpxe/src/bin/10ec8167.rom pci10ec,8167.rom raw<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
As with VGA option ROMs, the gpxe option ROM may be compressed with LZMA. However, compression won't significantly reduce gpxe's size as it implements its own compression.<br />
<br />
In addition to gpxe, other option ROMs can be added in the same manner.<br />
<br />
== Adding sgabios support ==<br />
<br />
An [http://code.google.com/p/sgabios/ sgabios] option ROM can forward many VGA BIOS requests and keyboard events over a serial port. One can deploy it in addition to the primary VGA BIOS or by itself.<br />
<br />
If the target machine does not have a VGA adapter, then one should install sgabios. Most bootloaders (eg, GRUB) require a VGA BIOS in order to function properly &mdash; the sgabios ROM can fill this requirement.<br />
<br />
The current version of sgabios (as of 20090617) does not implement a proper checksum. As a work around, a tool from the SeaBIOS source repo can fix the checksum:<br />
<source lang="bash"><br />
$ /path/to/seabios/tools/buildrom.py /path/to/sgabios.bin sgabios-fixed.bin<br />
</source><br />
<br />
Once the above is done, place the ROM file in the '''vgaroms/''' directory of CBFS. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add sgabios-fixed.bin vgaroms/sgabios.bin raw<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
When using sgabios, all the characters that SeaBIOS writes to the screen will be seen twice &mdash; once from SeaBIOS sending the character to the serial port and once from sgabios forwarding the character. To prevent the duplicates one can edit the SeaBIOS '''src/config.h''' file and set the following:<br />
<br />
<source lang="C"><br />
#define CONFIG_SCREEN_AND_DEBUG 0<br />
</source><br />
<br />
== Adding a graphical "bootsplash" image ==<br />
<br />
SeaBIOS can show a custom [http://en.wikipedia.org/wiki/JPEG JPEG] image during bootup. To enable this, add the JPEG file to flash with the name '''bootsplash.jpg'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add /path/to/image.jpg bootsplash.jpg raw<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
The size of the JPEG image determines the video mode to use for showing the image. Make sure the dimensions of the image exactly correspond to an available video mode (eg, 640x480, or 1024x768).<br />
<br />
SeaBIOS will show the image during the wait for the boot menu (if the boot menu has been disabled, users will not see the image). The image should probably have "Press F12 for boot menu" embedded in it so users know they can enter the normal SeaBIOS boot menu. By default, the boot menu prompt (and thus graphical image) is shown for 2.5 seconds. This can be customized by modifying SeaBIOS' '''src/config.h''' file and changing the '''CONFIG_BOOTMENU_WAIT''' setting.<br />
<br />
The jpeg viewer in SeaBIOS uses a simplified decoding algorithm. It supports most common jpegs, but does not support all possible formats. Please see the [[#Trouble reporting]] section if a valid image isn't displayed properly.<br />
<br />
== Adding payloads ==<br />
<br />
Most [[Payloads|payloads]] can also be launched from SeaBIOS. To add a payload, build the corresponding .elf file and then add it to the '''coreboot.rom''' file in the '''img/''' directory. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add-payload /path/to/payload.elf img/MyPayload l<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
During boot, one can press the '''F12''' key to get a boot menu. SeaBIOS will show all files in the '''img/''' directory, and one can instruct SeaBIOS to run them.<br />
<br />
SeaBIOS supports both uncompressed and LZMA compressed payloads.<br />
<br />
== Adding a floppy image ==<br />
<br />
It is possible to embed an image of a floppy in flash. SeaBIOS can then boot from and redirect floppy BIOS calls to the flash image. This is mainly useful for legacy software (such as DOS utilities). To use this feature, place a floppy image into the CBFS directory '''floppyimg/'''. For example:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/myfloppy.img > myfloppy.img.lzma<br />
$ ./cbfs/cbfstool coreboot.rom add myfloppy.img.lzma floppyimg/MyFloppy.lzma raw<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
Both uncompressed and LZMA compressed images are supported. Several floppy formats are available: 360K, 1.2MB, 720K, 1.44MB, 2.88MB, 160K, 180K, 320K.<br />
<br />
The floppy image will appear as writable to the system, however all writes are discarded on reboot.<br />
<br />
When using this system, SeaBIOS reserves high-memory to store the floppy. The reserved memory is then no longer available for OS use, so this feature should only be used when needed.<br />
<br />
= Trouble reporting =<br />
<br />
If you are experiencing problems with SeaBIOS, it's useful to increase the debugging level. This is done by editing the '''src/config.h''' file and setting the debug level to a higher number (for example '''8'''):<br />
<br />
<source lang="C"><br />
#define CONFIG_DEBUG_LEVEL 8<br />
</source><br />
<br />
A debug level of 8 will show a lot of diagnostic information without flooding the serial port (levels above 8 will frequently cause too much data).<br />
<br />
To report an issue, please collect the serial boot log with SeaBIOS set to a debug level of 8 and forward the full log along with a description of the problem to the coreboot [[Mailinglist|mailing list]].</div>KevinOConnorhttps://www.coreboot.org/index.php?title=SeaBIOS&diff=9923SeaBIOS2010-09-18T14:26:43Z<p>KevinOConnor: /* Compiled SeaBIOS images */ Latest version is 0.6.1</p>
<hr />
<div>[http://www.seabios.org '''SeaBIOS'''] is an open-source legacy BIOS implementation which can be used as a coreboot [[Payloads|payload]]. It implements the standard BIOS calling interfaces that a typical x86 proprietary BIOS implements.<br />
<br />
This page describes using SeaBIOS with coreboot. SeaBIOS can also run natively in qemu and bochs - see the SeaBIOS README file for information on non-coreboot uses.<br />
<br />
= Use cases =<br />
<br />
Any software requiring 16-bit BIOS services benefits from SeaBIOS (eg, Windows and DOS). SeaBIOS also enables booting Linux out of the box (using standard boot-loaders like GRUB and Syslinux).<br />
<br />
SeaBIOS supports booting from ATA hard drives, ATAPI cdroms, USB hard drives, USB cdroms, payloads in flash, and from [http://en.wikipedia.org/wiki/Option_ROM Option ROMs] (eg, SCSI or network cards). SeaBIOS can initialize and use a ps2 keyboard or USB keyboard.<br />
<br />
== Windows ==<br />
<br />
SeaBIOS has been tested with Windows XP, Windows Vista (64/32 bit), and Windows 7 Beta (64 bit).<br />
<br />
However, Windows has a very strict ACPI interpreter, and many coreboot boards do not have a complete [[ACPI in coreboot|ACPI definition]]. As a result, many coreboot boards will fail during Windows boot (eg, it may fail with a STOP 0xA5 code).<br />
<br />
So far [[ASUS M2V-MX SE]] and [[GIGABYTE GA-M57SLI-S4]] have known good working ACPI and are able to boot XP/Vista/Windows 7. Please ask on the [[Mailinglist|mailing list]] for the status of other boards/chipsets.<br />
<br />
== Linux ==<br />
<br />
SeaBIOS has been tested with GRUB, LILO, and Syslinux. Linux booting works well.<br />
<br />
== Other ==<br />
<br />
SeaBIOS has also been tested with FreeDOS and NetBSD.<br />
<br />
Because SeaBIOS implements the standard x86 BIOS interfaces, it is expected many other operating systems and boot-loaders will work.<br />
<br />
= Building =<br />
<br />
== SeaBIOS ==<br />
<br />
One can download the latest version of SeaBIOS through a git repository:<br />
<br />
<source lang="bash"><br />
$ git clone git://git.linuxtogo.org/home/kevin/seabios.git seabios<br />
$ cd seabios<br />
</source><br />
<br />
There's also a [http://git.linuxtogo.org/?p=kevin/seabios.git;a=summary gitweb] facility to browse the latest source code online.<br />
<br />
Edit '''src/config.h''' and set the following values:<br />
<br />
<source lang="C"><br />
#define CONFIG_COREBOOT 1<br />
#define CONFIG_DEBUG_SERIAL 1<br />
#define CONFIG_VGAHOOKS 1<br />
</source><br />
<br />
Then:<br />
<br />
<source lang="bash"><br />
$ make<br />
</source><br />
<br />
The final SeaBIOS payload file is '''out/bios.bin.elf'''.<br />
<br />
=== Compiled SeaBIOS images ===<br />
<br />
It is also possible to download a compiled SeaBIOS image. The latest released version compiled for coreboot is: http://linuxtogo.org/~kevin/SeaBIOS/bios.bin.elf-0.6.1<br />
<br />
Other versions are also available at: http://linuxtogo.org/~kevin/SeaBIOS/<br />
<br />
== coreboot ==<br />
<br />
For best results, configure coreboot with CONFIG_WRITE_HIGH_TABLES and CONFIG_VGA_BRIDGE_SETUP both enabled, and CONFIG_VGA_ROM_RUN and CONFIG_PCI_ROM_RUN both disabled.<br />
<br />
Finally, configure the SeaBIOS '''/out/bios.bin.elf''' file as the coreboot payload and build coreboot. The resulting '''coreboot.rom''' file will contain both SeaBIOS and coreboot, and it can be flashed to a rom.<br />
<br />
= SeaBIOS and CBFS =<br />
<br />
SeaBIOS can read the coreboot flash filesystem and extract files.<br />
<br />
When SeaBIOS scans the target machine's PCI devices, it will recognize option ROMs in CBFS that have the form '''pciVVVV,DDDD.rom'''. It will also run any file in the directory '''vgaroms/''' as a vga option ROM not specific to a device and files in '''genroms/''' as a generic option ROM not specific to a device. In the above cases, SeaBIOS will recognize files with a '''.lzma''' suffix, and automatically decompress them (eg, '''pci1106,3344.rom.lzma''' and '''vgaroms/sgabios.bin.lzma''').<br />
<br />
SeaBIOS can also load a graphical bootsplash image from '''bootsplash.jpg''', payloads found in the CBFS directory '''img/''', and floppy images found in the '''floppyimg/''' directory.<br />
<br />
The examples below show some common uses of this feature.<br />
<br />
== Adding a VGA option ROM ==<br />
<br />
It is frequently necessary to add a VGA option ROM to CBFS in order to use a VGA adapter that is built-in to a motherboard. Note, VGA adapters on external cards do not require this step as SeaBIOS will automatically extract the VGA bios directly from the card. For machines without a VGA adapter, please follow the [[#Adding sgabios support|sgabios instructions]] below.<br />
<br />
The first step is to find the vendor and device ID of the built-in VGA adapter. This information can be found from '''lspci''':<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
01:00.0 VGA compatible controller [0300]: VIA Technologies, Inc. UniChrome Pro IGP [1106:3344] (rev 01) (prog-if 00 [VGA controller])<br />
</source><br />
<br />
In the above example, the VGA vendor/device ID is '''1106:3344'''. [[VGA support#How_to_retrieve_a_good_video_bios|Obtain the VGA ROM]] (eg, '''vgabios.bin''') and add it to the ROM with:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add /path/to/vgabios.bin pci1106,3344.rom raw<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
Alternatively, SeaBIOS supports LZMA compressed option ROMs. Use the following to add a compressed option ROM instead:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/vgabios.bin > vgabios.bin.lzma<br />
$ ./cbfs/cbfstool coreboot.rom add vgabios.bin.lzma pci1106,3344.rom.lzma raw<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
After the above is done, one can write the coreboot.rom file to flash. SeaBIOS will extract the VGA ROM and run it during boot.<br />
<br />
== Adding gpxe support ==<br />
<br />
A [[GPXE|gpxe]] option ROM can nicely complement SeaBIOS and coreboot by adding network boot support. Adding gpxe is similar to [[#Adding a VGA option ROM]]. The first step is to find the Ethernet vendor/device ID. For example:<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
00:09.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet [10ec:8167] (rev 10)<br />
</source><br />
<br />
Then one can build a gpxe option ROM. For example:<br />
<br />
<source lang="bash"><br />
$ cd /path/to/gpxe/src/<br />
$ make bin/10ec8167.rom<br />
</source><br />
<br />
And add it to the coreboot image. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add /path/to/gpxe/src/bin/10ec8167.rom pci10ec,8167.rom raw<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
As with VGA option ROMs, the gpxe option ROM may be compressed with LZMA. However, compression won't significantly reduce gpxe's size as it implements its own compression.<br />
<br />
In addition to gpxe, other option ROMs can be added in the same manner.<br />
<br />
== Adding sgabios support ==<br />
<br />
An [http://code.google.com/p/sgabios/ sgabios] option ROM can forward many VGA BIOS requests and keyboard events over a serial port. One can deploy it in addition to the primary VGA BIOS or by itself.<br />
<br />
If the target machine does not have a VGA adapter, then one should install sgabios. Most bootloaders (eg, grub) require a VGA BIOS in order to function properly - the sgabios rom can fill this requirement.<br />
<br />
The current version of sgabios (as of 20090617) does not implement a proper checksum. As a work around, a tool from the seabios source repo can fix the checksum:<br />
<source lang="bash"><br />
$ /path/to/seabios/tools/buildrom.py /path/to/sgabios.bin sgabios-fixed.bin<br />
</source><br />
<br />
Once the above is done, place the ROM file in the '''vgaroms/''' directory of CBFS. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add sgabios-fixed.bin vgaroms/sgabios.bin raw<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
When using sgabios, all the characters that SeaBIOS writes to the screen will be seen twice - once from SeaBIOS sending the character to the serial port and once from sgabios forwarding the character. To prevent the duplicates one can edit the SeaBIOS '''src/config.h''' file and set the following:<br />
<br />
<source lang="C"><br />
#define CONFIG_SCREEN_AND_DEBUG 0<br />
</source><br />
<br />
== Adding a graphical "bootsplash" image ==<br />
<br />
SeaBIOS can show a custom [http://en.wikipedia.org/wiki/JPEG JPEG] image during bootup. To enable this, add the jpeg file to flash with the name '''bootsplash.jpg'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add /path/to/image.jpg bootsplash.jpg raw<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
The size of the jpeg image determines the video mode to use for showing the image. Make sure the dimensions of the image exactly correspond to an available video mode (eg, 640x480, 1024x768).<br />
<br />
SeaBIOS will show the image during the wait for the boot menu. (If the boot menu has been disabled, users will not see the image.) The image should probably have "Press F12 for boot menu" embedded in it so users know they can enter the normal SeaBIOS boot menu. By default, the boot menu prompt (and thus graphical image) is shown for 2.5 seconds. This can be customized by modifying SeaBIOS' '''src/config.h''' file and changing the '''CONFIG_BOOTMENU_WAIT''' setting.<br />
<br />
The jpeg viewer in SeaBIOS uses a simplified decoding algorithm. It supports most common jpegs, but does not support all possible formats. Please see the [[#Trouble reporting]] section if a valid image isn't displayed properly.<br />
<br />
== Adding payloads ==<br />
<br />
Most [[Payloads|payloads]] can also be launched from SeaBIOS. To add a payload, build the corresponding .elf file and then add it to the '''coreboot.rom''' file in the '''img/''' directory. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add-payload /path/to/payload.elf img/MyPayload l<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
During boot, one can press the '''F12''' key to get a boot menu. SeaBIOS will show all files in the '''img/''' directory, and one can instruct SeaBIOS to run them.<br />
<br />
SeaBIOS supports both uncompressed and LZMA compressed payloads.<br />
<br />
== Adding a floppy image ==<br />
<br />
It is possible to embed an image of a floppy in flash. SeaBIOS can then boot from and redirect floppy BIOS calls to the flash image. This is mainly useful for legacy software (such as DOS utilities). To use this feature, place a floppy image into the CBFS directory '''floppyimg/'''. For example:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/myfloppy.img > myfloppy.img.lzma<br />
$ ./cbfs/cbfstool coreboot.rom add myfloppy.img.lzma floppyimg/MyFloppy.lzma raw<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
Both uncompressed and lzma compressed images are supported. Several floppy formats are available: 360K, 1.2MB, 720K, 1.44MB, 2.88MB, 160K, 180K, 320K.<br />
<br />
The floppy image will appear as writable to the system, however all writes are discarded on reboot.<br />
<br />
When using this system, SeaBIOS reserves high-memory to store the floppy. The reserved memory is then no longer available for OS use, so this feature should only be used when needed.<br />
<br />
= Trouble reporting =<br />
<br />
If you are experiencing problems with SeaBIOS, it's useful to increase the debugging level. This is done by editing the '''src/config.h''' file and setting the debug level to a higher number (for example 8):<br />
<br />
<source lang="C"><br />
#define CONFIG_DEBUG_LEVEL 8<br />
</source><br />
<br />
A debug level of 8 will show a lot of diagnostic information without flooding the serial port (levels above 8 will frequently cause too much data).<br />
<br />
To report an issue, please collect the serial boot log with SeaBIOS set to a debug level of 8 and forward the full log along with a description of the problem to the coreboot [[Mailinglist|mailing list]].</div>KevinOConnorhttps://www.coreboot.org/index.php?title=SeaBIOS&diff=9899SeaBIOS2010-09-05T16:34:57Z<p>KevinOConnor: /* SeaBIOS and CBFS */ Use "raw" instead of "99" for cbfs type.</p>
<hr />
<div>'''SeaBIOS''' is an open-source legacy BIOS implementation which can be used as a coreboot [[Payloads|payload]]. It implements the standard BIOS calling interfaces that a typical x86 proprietary BIOS implements.<br />
<br />
This page describes using SeaBIOS with coreboot. SeaBIOS can also run natively in qemu and bochs - see the SeaBIOS README file for information on non-coreboot uses.<br />
<br />
= Use cases =<br />
<br />
Any software requiring 16-bit BIOS services benefits from SeaBIOS (eg, Windows and DOS). SeaBIOS also enables booting Linux out of the box (using standard boot-loaders like GRUB and Syslinux).<br />
<br />
SeaBIOS supports booting from ATA hard drives, ATAPI cdroms, USB hard drives, USB cdroms, payloads in flash, and from [http://en.wikipedia.org/wiki/Option_ROM Option ROMs] (eg, SCSI or network cards). SeaBIOS can initialize and use a ps2 keyboard or USB keyboard.<br />
<br />
== Windows ==<br />
<br />
SeaBIOS has been tested with Windows XP, Windows Vista (64/32 bit), and Windows 7 Beta (64 bit).<br />
<br />
However, Windows has a very strict ACPI interpreter, and many coreboot boards do not have a complete [[ACPI in coreboot|ACPI definition]]. As a result, many coreboot boards will fail during Windows boot (eg, it may fail with a STOP 0xA5 code).<br />
<br />
So far [[ASUS M2V-MX SE]] and [[GIGABYTE GA-M57SLI-S4]] have known good working ACPI and are able to boot XP/Vista/Windows 7. Please ask on the [[Mailinglist|mailing list]] for the status of other boards/chipsets.<br />
<br />
== Linux ==<br />
<br />
SeaBIOS has been tested with GRUB, LILO, and Syslinux. Linux booting works well.<br />
<br />
== Other ==<br />
<br />
SeaBIOS has also been tested with FreeDOS and NetBSD.<br />
<br />
Because SeaBIOS implements the standard x86 BIOS interfaces, it is expected many other operating systems and boot-loaders will work.<br />
<br />
= Building =<br />
<br />
== SeaBIOS ==<br />
<br />
One can download the latest version of SeaBIOS through a git repository:<br />
<br />
<source lang="bash"><br />
$ git clone git://git.linuxtogo.org/home/kevin/seabios.git seabios<br />
$ cd seabios<br />
</source><br />
<br />
There's also a [http://git.linuxtogo.org/?p=kevin/seabios.git;a=summary gitweb] facility to browse the latest source code online.<br />
<br />
Edit '''src/config.h''' and set the following values:<br />
<br />
<source lang="C"><br />
#define CONFIG_COREBOOT 1<br />
#define CONFIG_DEBUG_SERIAL 1<br />
#define CONFIG_VGAHOOKS 1<br />
</source><br />
<br />
Then:<br />
<br />
<source lang="bash"><br />
$ make<br />
</source><br />
<br />
The final SeaBIOS payload file is '''out/bios.bin.elf'''.<br />
<br />
=== Compiled SeaBIOS images ===<br />
<br />
It is also possible to download a compiled SeaBIOS image. The latest released version compiled for coreboot is: http://linuxtogo.org/~kevin/SeaBIOS/bios.bin.elf-0.6.0<br />
<br />
Other versions are also available at: http://linuxtogo.org/~kevin/SeaBIOS/<br />
<br />
== coreboot ==<br />
<br />
For best results, configure coreboot with CONFIG_WRITE_HIGH_TABLES and CONFIG_VGA_BRIDGE_SETUP both enabled, and CONFIG_VGA_ROM_RUN and CONFIG_PCI_ROM_RUN both disabled.<br />
<br />
Finally, configure the SeaBIOS '''/out/bios.bin.elf''' file as the coreboot payload and build coreboot. The resulting '''coreboot.rom''' file will contain both SeaBIOS and coreboot, and it can be flashed to a rom.<br />
<br />
= SeaBIOS and CBFS =<br />
<br />
SeaBIOS can read the coreboot flash filesystem and extract files.<br />
<br />
When SeaBIOS scans the target machine's PCI devices, it will recognize option ROMs in CBFS that have the form '''pciVVVV,DDDD.rom'''. It will also run any file in the directory '''vgaroms/''' as a vga option ROM not specific to a device and files in '''genroms/''' as a generic option ROM not specific to a device. In the above cases, SeaBIOS will recognize files with a '''.lzma''' suffix, and automatically decompress them (eg, '''pci1106,3344.rom.lzma''' and '''vgaroms/sgabios.bin.lzma''').<br />
<br />
SeaBIOS can also load a graphical bootsplash image from '''bootsplash.jpg''', payloads found in the CBFS directory '''img/''', and floppy images found in the '''floppyimg/''' directory.<br />
<br />
The examples below show some common uses of this feature.<br />
<br />
== Adding a VGA option ROM ==<br />
<br />
It is frequently necessary to add a VGA option ROM to CBFS in order to use a VGA adapter that is built-in to a motherboard. Note, VGA adapters on external cards do not require this step as SeaBIOS will automatically extract the VGA bios directly from the card. For machines without a VGA adapter, please follow the [[#Adding sgabios support|sgabios instructions]] below.<br />
<br />
The first step is to find the vendor and device ID of the built-in VGA adapter. This information can be found from '''lspci''':<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
01:00.0 VGA compatible controller [0300]: VIA Technologies, Inc. UniChrome Pro IGP [1106:3344] (rev 01) (prog-if 00 [VGA controller])<br />
</source><br />
<br />
In the above example, the VGA vendor/device ID is '''1106:3344'''. [[VGA support#How_to_retrieve_a_good_video_bios|Obtain the VGA ROM]] (eg, '''vgabios.bin''') and add it to the ROM with:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add /path/to/vgabios.bin pci1106,3344.rom raw<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
Alternatively, SeaBIOS supports LZMA compressed option ROMs. Use the following to add a compressed option ROM instead:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/vgabios.bin > vgabios.bin.lzma<br />
$ ./cbfs/cbfstool coreboot.rom add vgabios.bin.lzma pci1106,3344.rom.lzma raw<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
After the above is done, one can write the coreboot.rom file to flash. SeaBIOS will extract the VGA ROM and run it during boot.<br />
<br />
== Adding gpxe support ==<br />
<br />
A [[GPXE|gpxe]] option ROM can nicely complement SeaBIOS and coreboot by adding network boot support. Adding gpxe is similar to [[#Adding a VGA option ROM]]. The first step is to find the Ethernet vendor/device ID. For example:<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
00:09.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet [10ec:8167] (rev 10)<br />
</source><br />
<br />
Then one can build a gpxe option ROM. For example:<br />
<br />
<source lang="bash"><br />
$ cd /path/to/gpxe/src/<br />
$ make bin/10ec8167.rom<br />
</source><br />
<br />
And add it to the coreboot image. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add /path/to/gpxe/src/bin/10ec8167.rom pci10ec,8167.rom raw<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
As with VGA option ROMs, the gpxe option ROM may be compressed with LZMA. However, compression won't significantly reduce gpxe's size as it implements its own compression.<br />
<br />
In addition to gpxe, other option ROMs can be added in the same manner.<br />
<br />
== Adding sgabios support ==<br />
<br />
An [http://code.google.com/p/sgabios/ sgabios] option ROM can forward many VGA BIOS requests and keyboard events over a serial port. One can deploy it in addition to the primary VGA BIOS or by itself.<br />
<br />
If the target machine does not have a VGA adapter, then one should install sgabios. Most bootloaders (eg, grub) require a VGA BIOS in order to function properly - the sgabios rom can fill this requirement.<br />
<br />
The current version of sgabios (as of 20090617) does not implement a proper checksum. As a work around, a tool from the seabios source repo can fix the checksum:<br />
<source lang="bash"><br />
$ /path/to/seabios/tools/buildrom.py /path/to/sgabios.bin sgabios-fixed.bin<br />
</source><br />
<br />
Once the above is done, place the ROM file in the '''vgaroms/''' directory of CBFS. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add sgabios-fixed.bin vgaroms/sgabios.bin raw<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
When using sgabios, all the characters that SeaBIOS writes to the screen will be seen twice - once from SeaBIOS sending the character to the serial port and once from sgabios forwarding the character. To prevent the duplicates one can edit the SeaBIOS '''src/config.h''' file and set the following:<br />
<br />
<source lang="C"><br />
#define CONFIG_SCREEN_AND_DEBUG 0<br />
</source><br />
<br />
== Adding a graphical "bootsplash" image ==<br />
<br />
SeaBIOS can show a custom [http://en.wikipedia.org/wiki/JPEG JPEG] image during bootup. To enable this, add the jpeg file to flash with the name '''bootsplash.jpg'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add /path/to/image.jpg bootsplash.jpg raw<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
The size of the jpeg image determines the video mode to use for showing the image. Make sure the dimensions of the image exactly correspond to an available video mode (eg, 640x480, 1024x768).<br />
<br />
SeaBIOS will show the image during the wait for the boot menu. (If the boot menu has been disabled, users will not see the image.) The image should probably have "Press F12 for boot menu" embedded in it so users know they can enter the normal SeaBIOS boot menu. By default, the boot menu prompt (and thus graphical image) is shown for 2.5 seconds. This can be customized by modifying SeaBIOS' '''src/config.h''' file and changing the '''CONFIG_BOOTMENU_WAIT''' setting.<br />
<br />
The jpeg viewer in SeaBIOS uses a simplified decoding algorithm. It supports most common jpegs, but does not support all possible formats. Please see the [[#Trouble reporting]] section if a valid image isn't displayed properly.<br />
<br />
== Adding payloads ==<br />
<br />
Most [[Payloads|payloads]] can also be launched from SeaBIOS. To add a payload, build the corresponding .elf file and then add it to the '''coreboot.rom''' file in the '''img/''' directory. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add-payload /path/to/payload.elf img/MyPayload l<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
During boot, one can press the '''F12''' key to get a boot menu. SeaBIOS will show all files in the '''img/''' directory, and one can instruct SeaBIOS to run them.<br />
<br />
SeaBIOS supports both uncompressed and LZMA compressed payloads.<br />
<br />
== Adding a floppy image ==<br />
<br />
It is possible to embed an image of a floppy in flash. SeaBIOS can then boot from and redirect floppy BIOS calls to the flash image. This is mainly useful for legacy software (such as DOS utilities). To use this feature, place a floppy image into the CBFS directory '''floppyimg/'''. For example:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/myfloppy.img > myfloppy.img.lzma<br />
$ ./cbfs/cbfstool coreboot.rom add myfloppy.img.lzma floppyimg/MyFloppy.lzma raw<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
Both uncompressed and lzma compressed images are supported. Several floppy formats are available: 360K, 1.2MB, 720K, 1.44MB, 2.88MB, 160K, 180K, 320K.<br />
<br />
The floppy image will appear as writable to the system, however all writes are discarded on reboot.<br />
<br />
When using this system, SeaBIOS reserves high-memory to store the floppy. The reserved memory is then no longer available for OS use, so this feature should only be used when needed.<br />
<br />
= Trouble reporting =<br />
<br />
If you are experiencing problems with SeaBIOS, it's useful to increase the debugging level. This is done by editing the '''src/config.h''' file and setting the debug level to a higher number (for example 8):<br />
<br />
<source lang="C"><br />
#define CONFIG_DEBUG_LEVEL 8<br />
</source><br />
<br />
A debug level of 8 will show a lot of diagnostic information without flooding the serial port (levels above 8 will frequently cause too much data).<br />
<br />
To report an issue, please collect the serial boot log with SeaBIOS set to a debug level of 8 and forward the full log along with a description of the problem to the coreboot [[Mailinglist|mailing list]].</div>KevinOConnorhttps://www.coreboot.org/index.php?title=SeaBIOS&diff=9895SeaBIOS2010-09-04T15:30:19Z<p>KevinOConnor: /* Adding payloads */ nrvb isn't used anymore</p>
<hr />
<div>'''SeaBIOS''' is an open-source legacy BIOS implementation which can be used as a coreboot [[Payloads|payload]]. It implements the standard BIOS calling interfaces that a typical x86 proprietary BIOS implements.<br />
<br />
This page describes using SeaBIOS with coreboot. SeaBIOS can also run natively in qemu and bochs - see the SeaBIOS README file for information on non-coreboot uses.<br />
<br />
= Use cases =<br />
<br />
Any software requiring 16-bit BIOS services benefits from SeaBIOS (eg, Windows and DOS). SeaBIOS also enables booting Linux out of the box (using standard boot-loaders like GRUB and Syslinux).<br />
<br />
SeaBIOS supports booting from ATA hard drives, ATAPI cdroms, USB hard drives, USB cdroms, payloads in flash, and from [http://en.wikipedia.org/wiki/Option_ROM Option ROMs] (eg, SCSI or network cards). SeaBIOS can initialize and use a ps2 keyboard or USB keyboard.<br />
<br />
== Windows ==<br />
<br />
SeaBIOS has been tested with Windows XP, Windows Vista (64/32 bit), and Windows 7 Beta (64 bit).<br />
<br />
However, Windows has a very strict ACPI interpreter, and many coreboot boards do not have a complete [[ACPI in coreboot|ACPI definition]]. As a result, many coreboot boards will fail during Windows boot (eg, it may fail with a STOP 0xA5 code).<br />
<br />
So far [[ASUS M2V-MX SE]] and [[GIGABYTE GA-M57SLI-S4]] have known good working ACPI and are able to boot XP/Vista/Windows 7. Please ask on the [[Mailinglist|mailing list]] for the status of other boards/chipsets.<br />
<br />
== Linux ==<br />
<br />
SeaBIOS has been tested with GRUB, LILO, and Syslinux. Linux booting works well.<br />
<br />
== Other ==<br />
<br />
SeaBIOS has also been tested with FreeDOS and NetBSD.<br />
<br />
Because SeaBIOS implements the standard x86 BIOS interfaces, it is expected many other operating systems and boot-loaders will work.<br />
<br />
= Building =<br />
<br />
== SeaBIOS ==<br />
<br />
One can download the latest version of SeaBIOS through a git repository:<br />
<br />
<source lang="bash"><br />
$ git clone git://git.linuxtogo.org/home/kevin/seabios.git seabios<br />
$ cd seabios<br />
</source><br />
<br />
There's also a [http://git.linuxtogo.org/?p=kevin/seabios.git;a=summary gitweb] facility to browse the latest source code online.<br />
<br />
Edit '''src/config.h''' and set the following values:<br />
<br />
<source lang="C"><br />
#define CONFIG_COREBOOT 1<br />
#define CONFIG_DEBUG_SERIAL 1<br />
#define CONFIG_VGAHOOKS 1<br />
</source><br />
<br />
Then:<br />
<br />
<source lang="bash"><br />
$ make<br />
</source><br />
<br />
The final SeaBIOS payload file is '''out/bios.bin.elf'''.<br />
<br />
=== Compiled SeaBIOS images ===<br />
<br />
It is also possible to download a compiled SeaBIOS image. The latest released version compiled for coreboot is: http://linuxtogo.org/~kevin/SeaBIOS/bios.bin.elf-0.6.0<br />
<br />
Other versions are also available at: http://linuxtogo.org/~kevin/SeaBIOS/<br />
<br />
== coreboot ==<br />
<br />
For best results, configure coreboot with CONFIG_WRITE_HIGH_TABLES and CONFIG_VGA_BRIDGE_SETUP both enabled, and CONFIG_VGA_ROM_RUN and CONFIG_PCI_ROM_RUN both disabled.<br />
<br />
Finally, configure the SeaBIOS '''/out/bios.bin.elf''' file as the coreboot payload and build coreboot. The resulting '''coreboot.rom''' file will contain both SeaBIOS and coreboot, and it can be flashed to a rom.<br />
<br />
= SeaBIOS and CBFS =<br />
<br />
SeaBIOS can read the coreboot flash filesystem and extract files.<br />
<br />
When SeaBIOS scans the target machine's PCI devices, it will recognize option ROMs in CBFS that have the form '''pciVVVV,DDDD.rom'''. It will also run any file in the directory '''vgaroms/''' as a vga option ROM not specific to a device and files in '''genroms/''' as a generic option ROM not specific to a device. In the above cases, SeaBIOS will recognize files with a '''.lzma''' suffix, and automatically decompress them (eg, '''pci1106,3344.rom.lzma''' and '''vgaroms/sgabios.bin.lzma''').<br />
<br />
SeaBIOS can also load a graphical bootsplash image from '''bootsplash.jpg''', payloads found in the CBFS directory '''img/''', and floppy images found in the '''floppyimg/''' directory.<br />
<br />
The examples below show some common uses of this feature.<br />
<br />
== Adding a VGA option ROM ==<br />
<br />
It is frequently necessary to add a VGA option ROM to CBFS in order to use a VGA adapter that is built-in to a motherboard. Note, VGA adapters on external cards do not require this step as SeaBIOS will automatically extract the VGA bios directly from the card. For machines without a VGA adapter, please follow the [[#Adding sgabios support|sgabios instructions]] below.<br />
<br />
The first step is to find the vendor and device ID of the built-in VGA adapter. This information can be found from '''lspci''':<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
01:00.0 VGA compatible controller [0300]: VIA Technologies, Inc. UniChrome Pro IGP [1106:3344] (rev 01) (prog-if 00 [VGA controller])<br />
</source><br />
<br />
In the above example, the VGA vendor/device ID is '''1106:3344'''. [[VGA support#How_to_retrieve_a_good_video_bios|Obtain the VGA ROM]] (eg, '''vgabios.bin''') and add it to the ROM with:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add /path/to/vgabios.bin pci1106,3344.rom 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
Alternatively, SeaBIOS supports LZMA compressed option ROMs. Use the following to add a compressed option ROM instead:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/vgabios.bin > vgabios.bin.lzma<br />
$ ./cbfs/cbfstool coreboot.rom add vgabios.bin.lzma pci1106,3344.rom.lzma 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
After the above is done, one can write the coreboot.rom file to flash. SeaBIOS will extract the VGA ROM and run it during boot.<br />
<br />
== Adding gpxe support ==<br />
<br />
A [[GPXE|gpxe]] option ROM can nicely complement SeaBIOS and coreboot by adding network boot support. Adding gpxe is similar to [[#Adding a VGA option ROM]]. The first step is to find the Ethernet vendor/device ID. For example:<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
00:09.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet [10ec:8167] (rev 10)<br />
</source><br />
<br />
Then one can build a gpxe option ROM. For example:<br />
<br />
<source lang="bash"><br />
$ cd /path/to/gpxe/src/<br />
$ make bin/10ec8167.rom<br />
</source><br />
<br />
And add it to the coreboot image. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add /path/to/gpxe/src/bin/10ec8167.rom pci10ec,8167.rom 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
As with VGA option ROMs, the gpxe option ROM may be compressed with LZMA. However, compression won't significantly reduce gpxe's size as it implements its own compression.<br />
<br />
In addition to gpxe, other option ROMs can be added in the same manner.<br />
<br />
== Adding sgabios support ==<br />
<br />
An [http://code.google.com/p/sgabios/ sgabios] option ROM can forward many VGA BIOS requests and keyboard events over a serial port. One can deploy it in addition to the primary VGA BIOS or by itself.<br />
<br />
If the target machine does not have a VGA adapter, then one should install sgabios. Most bootloaders (eg, grub) require a VGA BIOS in order to function properly - the sgabios rom can fill this requirement.<br />
<br />
The current version of sgabios (as of 20090617) does not implement a proper checksum. As a work around, a tool from the seabios source repo can fix the checksum:<br />
<source lang="bash"><br />
$ /path/to/seabios/tools/buildrom.py /path/to/sgabios.bin sgabios-fixed.bin<br />
</source><br />
<br />
Once the above is done, place the ROM file in the '''vgaroms/''' directory of CBFS. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add sgabios-fixed.bin vgaroms/sgabios.bin 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
When using sgabios, all the characters that SeaBIOS writes to the screen will be seen twice - once from SeaBIOS sending the character to the serial port and once from sgabios forwarding the character. To prevent the duplicates one can edit the SeaBIOS '''src/config.h''' file and set the following:<br />
<br />
<source lang="C"><br />
#define CONFIG_SCREEN_AND_DEBUG 0<br />
</source><br />
<br />
== Adding a graphical "bootsplash" image ==<br />
<br />
SeaBIOS can show a custom [http://en.wikipedia.org/wiki/JPEG JPEG] image during bootup. To enable this, add the jpeg file to flash with the name '''bootsplash.jpg'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add /path/to/image.jpg bootsplash.jpg 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
The size of the jpeg image determines the video mode to use for showing the image. Make sure the dimensions of the image exactly correspond to an available video mode (eg, 640x480, 1024x768).<br />
<br />
SeaBIOS will show the image during the wait for the boot menu. (If the boot menu has been disabled, users will not see the image.) The image should probably have "Press F12 for boot menu" embedded in it so users know they can enter the normal SeaBIOS boot menu. By default, the boot menu prompt (and thus graphical image) is shown for 2.5 seconds. This can be customized by modifying SeaBIOS' '''src/config.h''' file and changing the '''CONFIG_BOOTMENU_WAIT''' setting.<br />
<br />
The jpeg viewer in SeaBIOS uses a simplified decoding algorithm. It supports most common jpegs, but does not support all possible formats. Please see the [[#Trouble reporting]] section if a valid image isn't displayed properly.<br />
<br />
== Adding payloads ==<br />
<br />
Most [[Payloads|payloads]] can also be launched from SeaBIOS. To add a payload, build the corresponding .elf file and then add it to the '''coreboot.rom''' file in the '''img/''' directory. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add-payload /path/to/payload.elf img/MyPayload l<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
During boot, one can press the '''F12''' key to get a boot menu. SeaBIOS will show all files in the '''img/''' directory, and one can instruct SeaBIOS to run them.<br />
<br />
SeaBIOS supports both uncompressed and LZMA compressed payloads.<br />
<br />
== Adding a floppy image ==<br />
<br />
It is possible to embed an image of a floppy in flash. SeaBIOS can then boot from and redirect floppy BIOS calls to the flash image. This is mainly useful for legacy software (such as DOS utilities). To use this feature, place a floppy image into the CBFS directory '''floppyimg/'''. For example:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/myfloppy.img > myfloppy.img.lzma<br />
$ ./cbfs/cbfstool coreboot.rom add myfloppy.img.lzma floppyimg/MyFloppy.lzma 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
Both uncompressed and lzma compressed images are supported. Several floppy formats are available: 360K, 1.2MB, 720K, 1.44MB, 2.88MB, 160K, 180K, 320K.<br />
<br />
The floppy image will appear as writable to the system, however all writes are discarded on reboot.<br />
<br />
When using this system, SeaBIOS reserves high-memory to store the floppy. The reserved memory is then no longer available for OS use, so this feature should only be used when needed.<br />
<br />
= Trouble reporting =<br />
<br />
If you are experiencing problems with SeaBIOS, it's useful to increase the debugging level. This is done by editing the '''src/config.h''' file and setting the debug level to a higher number (for example 8):<br />
<br />
<source lang="C"><br />
#define CONFIG_DEBUG_LEVEL 8<br />
</source><br />
<br />
A debug level of 8 will show a lot of diagnostic information without flooding the serial port (levels above 8 will frequently cause too much data).<br />
<br />
To report an issue, please collect the serial boot log with SeaBIOS set to a debug level of 8 and forward the full log along with a description of the problem to the coreboot [[Mailinglist|mailing list]].</div>KevinOConnorhttps://www.coreboot.org/index.php?title=SeaBIOS&diff=9894SeaBIOS2010-09-04T15:28:23Z<p>KevinOConnor: /* Adding a graphical "bootsplash" image */ Note dimensions matter</p>
<hr />
<div>'''SeaBIOS''' is an open-source legacy BIOS implementation which can be used as a coreboot [[Payloads|payload]]. It implements the standard BIOS calling interfaces that a typical x86 proprietary BIOS implements.<br />
<br />
This page describes using SeaBIOS with coreboot. SeaBIOS can also run natively in qemu and bochs - see the SeaBIOS README file for information on non-coreboot uses.<br />
<br />
= Use cases =<br />
<br />
Any software requiring 16-bit BIOS services benefits from SeaBIOS (eg, Windows and DOS). SeaBIOS also enables booting Linux out of the box (using standard boot-loaders like GRUB and Syslinux).<br />
<br />
SeaBIOS supports booting from ATA hard drives, ATAPI cdroms, USB hard drives, USB cdroms, payloads in flash, and from [http://en.wikipedia.org/wiki/Option_ROM Option ROMs] (eg, SCSI or network cards). SeaBIOS can initialize and use a ps2 keyboard or USB keyboard.<br />
<br />
== Windows ==<br />
<br />
SeaBIOS has been tested with Windows XP, Windows Vista (64/32 bit), and Windows 7 Beta (64 bit).<br />
<br />
However, Windows has a very strict ACPI interpreter, and many coreboot boards do not have a complete [[ACPI in coreboot|ACPI definition]]. As a result, many coreboot boards will fail during Windows boot (eg, it may fail with a STOP 0xA5 code).<br />
<br />
So far [[ASUS M2V-MX SE]] and [[GIGABYTE GA-M57SLI-S4]] have known good working ACPI and are able to boot XP/Vista/Windows 7. Please ask on the [[Mailinglist|mailing list]] for the status of other boards/chipsets.<br />
<br />
== Linux ==<br />
<br />
SeaBIOS has been tested with GRUB, LILO, and Syslinux. Linux booting works well.<br />
<br />
== Other ==<br />
<br />
SeaBIOS has also been tested with FreeDOS and NetBSD.<br />
<br />
Because SeaBIOS implements the standard x86 BIOS interfaces, it is expected many other operating systems and boot-loaders will work.<br />
<br />
= Building =<br />
<br />
== SeaBIOS ==<br />
<br />
One can download the latest version of SeaBIOS through a git repository:<br />
<br />
<source lang="bash"><br />
$ git clone git://git.linuxtogo.org/home/kevin/seabios.git seabios<br />
$ cd seabios<br />
</source><br />
<br />
There's also a [http://git.linuxtogo.org/?p=kevin/seabios.git;a=summary gitweb] facility to browse the latest source code online.<br />
<br />
Edit '''src/config.h''' and set the following values:<br />
<br />
<source lang="C"><br />
#define CONFIG_COREBOOT 1<br />
#define CONFIG_DEBUG_SERIAL 1<br />
#define CONFIG_VGAHOOKS 1<br />
</source><br />
<br />
Then:<br />
<br />
<source lang="bash"><br />
$ make<br />
</source><br />
<br />
The final SeaBIOS payload file is '''out/bios.bin.elf'''.<br />
<br />
=== Compiled SeaBIOS images ===<br />
<br />
It is also possible to download a compiled SeaBIOS image. The latest released version compiled for coreboot is: http://linuxtogo.org/~kevin/SeaBIOS/bios.bin.elf-0.6.0<br />
<br />
Other versions are also available at: http://linuxtogo.org/~kevin/SeaBIOS/<br />
<br />
== coreboot ==<br />
<br />
For best results, configure coreboot with CONFIG_WRITE_HIGH_TABLES and CONFIG_VGA_BRIDGE_SETUP both enabled, and CONFIG_VGA_ROM_RUN and CONFIG_PCI_ROM_RUN both disabled.<br />
<br />
Finally, configure the SeaBIOS '''/out/bios.bin.elf''' file as the coreboot payload and build coreboot. The resulting '''coreboot.rom''' file will contain both SeaBIOS and coreboot, and it can be flashed to a rom.<br />
<br />
= SeaBIOS and CBFS =<br />
<br />
SeaBIOS can read the coreboot flash filesystem and extract files.<br />
<br />
When SeaBIOS scans the target machine's PCI devices, it will recognize option ROMs in CBFS that have the form '''pciVVVV,DDDD.rom'''. It will also run any file in the directory '''vgaroms/''' as a vga option ROM not specific to a device and files in '''genroms/''' as a generic option ROM not specific to a device. In the above cases, SeaBIOS will recognize files with a '''.lzma''' suffix, and automatically decompress them (eg, '''pci1106,3344.rom.lzma''' and '''vgaroms/sgabios.bin.lzma''').<br />
<br />
SeaBIOS can also load a graphical bootsplash image from '''bootsplash.jpg''', payloads found in the CBFS directory '''img/''', and floppy images found in the '''floppyimg/''' directory.<br />
<br />
The examples below show some common uses of this feature.<br />
<br />
== Adding a VGA option ROM ==<br />
<br />
It is frequently necessary to add a VGA option ROM to CBFS in order to use a VGA adapter that is built-in to a motherboard. Note, VGA adapters on external cards do not require this step as SeaBIOS will automatically extract the VGA bios directly from the card. For machines without a VGA adapter, please follow the [[#Adding sgabios support|sgabios instructions]] below.<br />
<br />
The first step is to find the vendor and device ID of the built-in VGA adapter. This information can be found from '''lspci''':<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
01:00.0 VGA compatible controller [0300]: VIA Technologies, Inc. UniChrome Pro IGP [1106:3344] (rev 01) (prog-if 00 [VGA controller])<br />
</source><br />
<br />
In the above example, the VGA vendor/device ID is '''1106:3344'''. [[VGA support#How_to_retrieve_a_good_video_bios|Obtain the VGA ROM]] (eg, '''vgabios.bin''') and add it to the ROM with:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add /path/to/vgabios.bin pci1106,3344.rom 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
Alternatively, SeaBIOS supports LZMA compressed option ROMs. Use the following to add a compressed option ROM instead:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/vgabios.bin > vgabios.bin.lzma<br />
$ ./cbfs/cbfstool coreboot.rom add vgabios.bin.lzma pci1106,3344.rom.lzma 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
After the above is done, one can write the coreboot.rom file to flash. SeaBIOS will extract the VGA ROM and run it during boot.<br />
<br />
== Adding gpxe support ==<br />
<br />
A [[GPXE|gpxe]] option ROM can nicely complement SeaBIOS and coreboot by adding network boot support. Adding gpxe is similar to [[#Adding a VGA option ROM]]. The first step is to find the Ethernet vendor/device ID. For example:<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
00:09.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet [10ec:8167] (rev 10)<br />
</source><br />
<br />
Then one can build a gpxe option ROM. For example:<br />
<br />
<source lang="bash"><br />
$ cd /path/to/gpxe/src/<br />
$ make bin/10ec8167.rom<br />
</source><br />
<br />
And add it to the coreboot image. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add /path/to/gpxe/src/bin/10ec8167.rom pci10ec,8167.rom 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
As with VGA option ROMs, the gpxe option ROM may be compressed with LZMA. However, compression won't significantly reduce gpxe's size as it implements its own compression.<br />
<br />
In addition to gpxe, other option ROMs can be added in the same manner.<br />
<br />
== Adding sgabios support ==<br />
<br />
An [http://code.google.com/p/sgabios/ sgabios] option ROM can forward many VGA BIOS requests and keyboard events over a serial port. One can deploy it in addition to the primary VGA BIOS or by itself.<br />
<br />
If the target machine does not have a VGA adapter, then one should install sgabios. Most bootloaders (eg, grub) require a VGA BIOS in order to function properly - the sgabios rom can fill this requirement.<br />
<br />
The current version of sgabios (as of 20090617) does not implement a proper checksum. As a work around, a tool from the seabios source repo can fix the checksum:<br />
<source lang="bash"><br />
$ /path/to/seabios/tools/buildrom.py /path/to/sgabios.bin sgabios-fixed.bin<br />
</source><br />
<br />
Once the above is done, place the ROM file in the '''vgaroms/''' directory of CBFS. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add sgabios-fixed.bin vgaroms/sgabios.bin 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
When using sgabios, all the characters that SeaBIOS writes to the screen will be seen twice - once from SeaBIOS sending the character to the serial port and once from sgabios forwarding the character. To prevent the duplicates one can edit the SeaBIOS '''src/config.h''' file and set the following:<br />
<br />
<source lang="C"><br />
#define CONFIG_SCREEN_AND_DEBUG 0<br />
</source><br />
<br />
== Adding a graphical "bootsplash" image ==<br />
<br />
SeaBIOS can show a custom [http://en.wikipedia.org/wiki/JPEG JPEG] image during bootup. To enable this, add the jpeg file to flash with the name '''bootsplash.jpg'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add /path/to/image.jpg bootsplash.jpg 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
The size of the jpeg image determines the video mode to use for showing the image. Make sure the dimensions of the image exactly correspond to an available video mode (eg, 640x480, 1024x768).<br />
<br />
SeaBIOS will show the image during the wait for the boot menu. (If the boot menu has been disabled, users will not see the image.) The image should probably have "Press F12 for boot menu" embedded in it so users know they can enter the normal SeaBIOS boot menu. By default, the boot menu prompt (and thus graphical image) is shown for 2.5 seconds. This can be customized by modifying SeaBIOS' '''src/config.h''' file and changing the '''CONFIG_BOOTMENU_WAIT''' setting.<br />
<br />
The jpeg viewer in SeaBIOS uses a simplified decoding algorithm. It supports most common jpegs, but does not support all possible formats. Please see the [[#Trouble reporting]] section if a valid image isn't displayed properly.<br />
<br />
== Adding payloads ==<br />
<br />
Most [[Payloads|payloads]] can also be launched from SeaBIOS. To add a payload, build the corresponding .elf file and then add it to the '''coreboot.rom''' file in the '''img/''' directory. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add-payload /path/to/payload.elf img/MyPayload l<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
During boot, one can press the '''F12''' key to get a boot menu. SeaBIOS will show all files in the '''img/''' directory, and one can instruct SeaBIOS to run them.<br />
<br />
Note, SeaBIOS currently supports uncompressed and LZMA compressed payloads. The nrv2b compression algorithm is not supported.<br />
<br />
== Adding a floppy image ==<br />
<br />
It is possible to embed an image of a floppy in flash. SeaBIOS can then boot from and redirect floppy BIOS calls to the flash image. This is mainly useful for legacy software (such as DOS utilities). To use this feature, place a floppy image into the CBFS directory '''floppyimg/'''. For example:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/myfloppy.img > myfloppy.img.lzma<br />
$ ./cbfs/cbfstool coreboot.rom add myfloppy.img.lzma floppyimg/MyFloppy.lzma 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
Both uncompressed and lzma compressed images are supported. Several floppy formats are available: 360K, 1.2MB, 720K, 1.44MB, 2.88MB, 160K, 180K, 320K.<br />
<br />
The floppy image will appear as writable to the system, however all writes are discarded on reboot.<br />
<br />
When using this system, SeaBIOS reserves high-memory to store the floppy. The reserved memory is then no longer available for OS use, so this feature should only be used when needed.<br />
<br />
= Trouble reporting =<br />
<br />
If you are experiencing problems with SeaBIOS, it's useful to increase the debugging level. This is done by editing the '''src/config.h''' file and setting the debug level to a higher number (for example 8):<br />
<br />
<source lang="C"><br />
#define CONFIG_DEBUG_LEVEL 8<br />
</source><br />
<br />
A debug level of 8 will show a lot of diagnostic information without flooding the serial port (levels above 8 will frequently cause too much data).<br />
<br />
To report an issue, please collect the serial boot log with SeaBIOS set to a debug level of 8 and forward the full log along with a description of the problem to the coreboot [[Mailinglist|mailing list]].</div>KevinOConnorhttps://www.coreboot.org/index.php?title=SeaBIOS&diff=9893SeaBIOS2010-09-04T14:39:49Z<p>KevinOConnor: /* SeaBIOS and CBFS */ Add info on bootsplash images</p>
<hr />
<div>'''SeaBIOS''' is an open-source legacy BIOS implementation which can be used as a coreboot [[Payloads|payload]]. It implements the standard BIOS calling interfaces that a typical x86 proprietary BIOS implements.<br />
<br />
This page describes using SeaBIOS with coreboot. SeaBIOS can also run natively in qemu and bochs - see the SeaBIOS README file for information on non-coreboot uses.<br />
<br />
= Use cases =<br />
<br />
Any software requiring 16-bit BIOS services benefits from SeaBIOS (eg, Windows and DOS). SeaBIOS also enables booting Linux out of the box (using standard boot-loaders like GRUB and Syslinux).<br />
<br />
SeaBIOS supports booting from ATA hard drives, ATAPI cdroms, USB hard drives, USB cdroms, payloads in flash, and from [http://en.wikipedia.org/wiki/Option_ROM Option ROMs] (eg, SCSI or network cards). SeaBIOS can initialize and use a ps2 keyboard or USB keyboard.<br />
<br />
== Windows ==<br />
<br />
SeaBIOS has been tested with Windows XP, Windows Vista (64/32 bit), and Windows 7 Beta (64 bit).<br />
<br />
However, Windows has a very strict ACPI interpreter, and many coreboot boards do not have a complete [[ACPI in coreboot|ACPI definition]]. As a result, many coreboot boards will fail during Windows boot (eg, it may fail with a STOP 0xA5 code).<br />
<br />
So far [[ASUS M2V-MX SE]] and [[GIGABYTE GA-M57SLI-S4]] have known good working ACPI and are able to boot XP/Vista/Windows 7. Please ask on the [[Mailinglist|mailing list]] for the status of other boards/chipsets.<br />
<br />
== Linux ==<br />
<br />
SeaBIOS has been tested with GRUB, LILO, and Syslinux. Linux booting works well.<br />
<br />
== Other ==<br />
<br />
SeaBIOS has also been tested with FreeDOS and NetBSD.<br />
<br />
Because SeaBIOS implements the standard x86 BIOS interfaces, it is expected many other operating systems and boot-loaders will work.<br />
<br />
= Building =<br />
<br />
== SeaBIOS ==<br />
<br />
One can download the latest version of SeaBIOS through a git repository:<br />
<br />
<source lang="bash"><br />
$ git clone git://git.linuxtogo.org/home/kevin/seabios.git seabios<br />
$ cd seabios<br />
</source><br />
<br />
There's also a [http://git.linuxtogo.org/?p=kevin/seabios.git;a=summary gitweb] facility to browse the latest source code online.<br />
<br />
Edit '''src/config.h''' and set the following values:<br />
<br />
<source lang="C"><br />
#define CONFIG_COREBOOT 1<br />
#define CONFIG_DEBUG_SERIAL 1<br />
#define CONFIG_VGAHOOKS 1<br />
</source><br />
<br />
Then:<br />
<br />
<source lang="bash"><br />
$ make<br />
</source><br />
<br />
The final SeaBIOS payload file is '''out/bios.bin.elf'''.<br />
<br />
=== Compiled SeaBIOS images ===<br />
<br />
It is also possible to download a compiled SeaBIOS image. The latest released version compiled for coreboot is: http://linuxtogo.org/~kevin/SeaBIOS/bios.bin.elf-0.6.0<br />
<br />
Other versions are also available at: http://linuxtogo.org/~kevin/SeaBIOS/<br />
<br />
== coreboot ==<br />
<br />
For best results, configure coreboot with CONFIG_WRITE_HIGH_TABLES and CONFIG_VGA_BRIDGE_SETUP both enabled, and CONFIG_VGA_ROM_RUN and CONFIG_PCI_ROM_RUN both disabled.<br />
<br />
Finally, configure the SeaBIOS '''/out/bios.bin.elf''' file as the coreboot payload and build coreboot. The resulting '''coreboot.rom''' file will contain both SeaBIOS and coreboot, and it can be flashed to a rom.<br />
<br />
= SeaBIOS and CBFS =<br />
<br />
SeaBIOS can read the coreboot flash filesystem and extract files.<br />
<br />
When SeaBIOS scans the target machine's PCI devices, it will recognize option ROMs in CBFS that have the form '''pciVVVV,DDDD.rom'''. It will also run any file in the directory '''vgaroms/''' as a vga option ROM not specific to a device and files in '''genroms/''' as a generic option ROM not specific to a device. In the above cases, SeaBIOS will recognize files with a '''.lzma''' suffix, and automatically decompress them (eg, '''pci1106,3344.rom.lzma''' and '''vgaroms/sgabios.bin.lzma''').<br />
<br />
SeaBIOS can also load a graphical bootsplash image from '''bootsplash.jpg''', payloads found in the CBFS directory '''img/''', and floppy images found in the '''floppyimg/''' directory.<br />
<br />
The examples below show some common uses of this feature.<br />
<br />
== Adding a VGA option ROM ==<br />
<br />
It is frequently necessary to add a VGA option ROM to CBFS in order to use a VGA adapter that is built-in to a motherboard. Note, VGA adapters on external cards do not require this step as SeaBIOS will automatically extract the VGA bios directly from the card. For machines without a VGA adapter, please follow the [[#Adding sgabios support|sgabios instructions]] below.<br />
<br />
The first step is to find the vendor and device ID of the built-in VGA adapter. This information can be found from '''lspci''':<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
01:00.0 VGA compatible controller [0300]: VIA Technologies, Inc. UniChrome Pro IGP [1106:3344] (rev 01) (prog-if 00 [VGA controller])<br />
</source><br />
<br />
In the above example, the VGA vendor/device ID is '''1106:3344'''. [[VGA support#How_to_retrieve_a_good_video_bios|Obtain the VGA ROM]] (eg, '''vgabios.bin''') and add it to the ROM with:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add /path/to/vgabios.bin pci1106,3344.rom 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
Alternatively, SeaBIOS supports LZMA compressed option ROMs. Use the following to add a compressed option ROM instead:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/vgabios.bin > vgabios.bin.lzma<br />
$ ./cbfs/cbfstool coreboot.rom add vgabios.bin.lzma pci1106,3344.rom.lzma 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
After the above is done, one can write the coreboot.rom file to flash. SeaBIOS will extract the VGA ROM and run it during boot.<br />
<br />
== Adding gpxe support ==<br />
<br />
A [[GPXE|gpxe]] option ROM can nicely complement SeaBIOS and coreboot by adding network boot support. Adding gpxe is similar to [[#Adding a VGA option ROM]]. The first step is to find the Ethernet vendor/device ID. For example:<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
00:09.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet [10ec:8167] (rev 10)<br />
</source><br />
<br />
Then one can build a gpxe option ROM. For example:<br />
<br />
<source lang="bash"><br />
$ cd /path/to/gpxe/src/<br />
$ make bin/10ec8167.rom<br />
</source><br />
<br />
And add it to the coreboot image. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add /path/to/gpxe/src/bin/10ec8167.rom pci10ec,8167.rom 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
As with VGA option ROMs, the gpxe option ROM may be compressed with LZMA. However, compression won't significantly reduce gpxe's size as it implements its own compression.<br />
<br />
In addition to gpxe, other option ROMs can be added in the same manner.<br />
<br />
== Adding sgabios support ==<br />
<br />
An [http://code.google.com/p/sgabios/ sgabios] option ROM can forward many VGA BIOS requests and keyboard events over a serial port. One can deploy it in addition to the primary VGA BIOS or by itself.<br />
<br />
If the target machine does not have a VGA adapter, then one should install sgabios. Most bootloaders (eg, grub) require a VGA BIOS in order to function properly - the sgabios rom can fill this requirement.<br />
<br />
The current version of sgabios (as of 20090617) does not implement a proper checksum. As a work around, a tool from the seabios source repo can fix the checksum:<br />
<source lang="bash"><br />
$ /path/to/seabios/tools/buildrom.py /path/to/sgabios.bin sgabios-fixed.bin<br />
</source><br />
<br />
Once the above is done, place the ROM file in the '''vgaroms/''' directory of CBFS. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add sgabios-fixed.bin vgaroms/sgabios.bin 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
When using sgabios, all the characters that SeaBIOS writes to the screen will be seen twice - once from SeaBIOS sending the character to the serial port and once from sgabios forwarding the character. To prevent the duplicates one can edit the SeaBIOS '''src/config.h''' file and set the following:<br />
<br />
<source lang="C"><br />
#define CONFIG_SCREEN_AND_DEBUG 0<br />
</source><br />
<br />
== Adding a graphical "bootsplash" image ==<br />
<br />
SeaBIOS can show a custom [http://en.wikipedia.org/wiki/JPEG JPEG] image during bootup. To enable this, add the jpeg file to flash with the name '''bootsplash.jpg'''. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add /path/to/image.jpg bootsplash.jpg 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
SeaBIOS will show the image during the wait for the boot menu. (If the boot menu has been disabled, users will not see the image.) The image should probably have "Press F12 for boot menu" embedded in it so users know they can enter the normal SeaBIOS boot menu. By default, the boot menu prompt (and thus graphical image) is shown for 2.5 seconds. This can be customized by modifying SeaBIOS' '''src/config.h''' file and changing the '''CONFIG_BOOTMENU_WAIT''' setting.<br />
<br />
The jpeg viewer in SeaBIOS uses a simplified decoding algorithm. It supports most common jpegs, but does not support all possible formats. Please see the [[#Trouble reporting]] section if a valid image isn't displayed properly.<br />
<br />
== Adding payloads ==<br />
<br />
Most [[Payloads|payloads]] can also be launched from SeaBIOS. To add a payload, build the corresponding .elf file and then add it to the '''coreboot.rom''' file in the '''img/''' directory. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add-payload /path/to/payload.elf img/MyPayload l<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
During boot, one can press the '''F12''' key to get a boot menu. SeaBIOS will show all files in the '''img/''' directory, and one can instruct SeaBIOS to run them.<br />
<br />
Note, SeaBIOS currently supports uncompressed and LZMA compressed payloads. The nrv2b compression algorithm is not supported.<br />
<br />
== Adding a floppy image ==<br />
<br />
It is possible to embed an image of a floppy in flash. SeaBIOS can then boot from and redirect floppy BIOS calls to the flash image. This is mainly useful for legacy software (such as DOS utilities). To use this feature, place a floppy image into the CBFS directory '''floppyimg/'''. For example:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/myfloppy.img > myfloppy.img.lzma<br />
$ ./cbfs/cbfstool coreboot.rom add myfloppy.img.lzma floppyimg/MyFloppy.lzma 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
Both uncompressed and lzma compressed images are supported. Several floppy formats are available: 360K, 1.2MB, 720K, 1.44MB, 2.88MB, 160K, 180K, 320K.<br />
<br />
The floppy image will appear as writable to the system, however all writes are discarded on reboot.<br />
<br />
When using this system, SeaBIOS reserves high-memory to store the floppy. The reserved memory is then no longer available for OS use, so this feature should only be used when needed.<br />
<br />
= Trouble reporting =<br />
<br />
If you are experiencing problems with SeaBIOS, it's useful to increase the debugging level. This is done by editing the '''src/config.h''' file and setting the debug level to a higher number (for example 8):<br />
<br />
<source lang="C"><br />
#define CONFIG_DEBUG_LEVEL 8<br />
</source><br />
<br />
A debug level of 8 will show a lot of diagnostic information without flooding the serial port (levels above 8 will frequently cause too much data).<br />
<br />
To report an issue, please collect the serial boot log with SeaBIOS set to a debug level of 8 and forward the full log along with a description of the problem to the coreboot [[Mailinglist|mailing list]].</div>KevinOConnorhttps://www.coreboot.org/index.php?title=SeaBIOS&diff=9600SeaBIOS2010-05-01T17:57:58Z<p>KevinOConnor: /* SeaBIOS and CBFS */ Note use of sgabios for machines without vga.</p>
<hr />
<div>'''SeaBIOS''' is an open-source legacy BIOS implementation which can be used as a coreboot [[Payloads|payload]]. It implements the standard BIOS calling interfaces that a typical x86 proprietary BIOS implements.<br />
<br />
This page describes using SeaBIOS with coreboot. SeaBIOS can also run natively in qemu and bochs - see the SeaBIOS README file for information on non-coreboot uses.<br />
<br />
= Use cases =<br />
<br />
Any software requiring 16-bit BIOS services benefits from SeaBIOS (eg, Windows and DOS). SeaBIOS also enables booting Linux out of the box (using standard boot-loaders like GRUB and Syslinux).<br />
<br />
SeaBIOS supports booting from ATA hard drives, ATAPI cdroms, USB hard drives, USB cdroms, payloads in flash, and from [http://en.wikipedia.org/wiki/Option_ROM Option ROMs] (eg, SCSI or network cards). SeaBIOS can initialize and use a ps2 keyboard or USB keyboard.<br />
<br />
== Windows ==<br />
<br />
SeaBIOS has been tested with Windows XP, Windows Vista (64/32 bit), and Windows 7 Beta (64 bit).<br />
<br />
However, Windows has a very strict ACPI interpreter, and many coreboot boards do not have a complete [[ACPI in coreboot|ACPI definition]]. As a result, many coreboot boards will fail during Windows boot (eg, it may fail with a STOP 0xA5 code).<br />
<br />
So far [[ASUS M2V-MX SE]] and [[GIGABYTE GA-M57SLI-S4]] have known good working ACPI and are able to boot XP/Vista/Windows 7. Please ask on the [[Mailinglist|mailing list]] for the status of other boards/chipsets.<br />
<br />
== Linux ==<br />
<br />
SeaBIOS has been tested with GRUB, LILO, and Syslinux. Linux booting works well.<br />
<br />
== Other ==<br />
<br />
SeaBIOS has also been tested with FreeDOS and NetBSD.<br />
<br />
Because SeaBIOS implements the standard x86 BIOS interfaces, it is expected many other operating systems and boot-loaders will work.<br />
<br />
= Building =<br />
<br />
== SeaBIOS ==<br />
<br />
One can download the latest version of SeaBIOS through a git repository:<br />
<br />
<source lang="bash"><br />
$ git clone git://git.linuxtogo.org/home/kevin/seabios.git seabios<br />
$ cd seabios<br />
</source><br />
<br />
There's also a [http://git.linuxtogo.org/?p=kevin/seabios.git;a=summary gitweb] facility to browse the latest source code online.<br />
<br />
Edit '''src/config.h''' and set the following values:<br />
<br />
<source lang="C"><br />
#define CONFIG_COREBOOT 1<br />
#define CONFIG_DEBUG_SERIAL 1<br />
#define CONFIG_VGAHOOKS 1<br />
</source><br />
<br />
Then:<br />
<br />
<source lang="bash"><br />
$ make<br />
</source><br />
<br />
The final SeaBIOS payload file is '''out/bios.bin.elf'''.<br />
<br />
=== Compiled SeaBIOS images ===<br />
<br />
It is also possible to download a compiled SeaBIOS image. The latest released version compiled for coreboot is: http://linuxtogo.org/~kevin/SeaBIOS/bios.bin.elf-0.6.0<br />
<br />
Other versions are also available at: http://linuxtogo.org/~kevin/SeaBIOS/<br />
<br />
== coreboot ==<br />
<br />
For best results, configure coreboot with CONFIG_WRITE_HIGH_TABLES and CONFIG_VGA_BRIDGE_SETUP both enabled, and CONFIG_VGA_ROM_RUN and CONFIG_PCI_ROM_RUN both disabled.<br />
<br />
Finally, configure the SeaBIOS '''/out/bios.bin.elf''' file as the coreboot payload and build coreboot. The resulting '''coreboot.rom''' file will contain both SeaBIOS and coreboot, and it can be flashed to a rom.<br />
<br />
= SeaBIOS and CBFS =<br />
<br />
SeaBIOS can read the coreboot flash filesystem and extract option ROMs and payloads.<br />
<br />
When SeaBIOS scans the target machine's PCI devices, it will recognize option ROMs in CBFS that have the form '''pciVVVV,DDDD.rom'''. It will also run any file in the directory '''vgaroms/''' as a vga option ROM not specific to a device and files in '''genroms/''' as a generic option ROM not specific to a device. In the above cases, SeaBIOS will recognize files with a '''.lzma''' suffix, and automatically decompress them (eg, '''pci1106,3344.rom.lzma''' and '''vgaroms/sgabios.bin.lzma''').<br />
<br />
SeaBIOS will also load payloads found in the CBFS directory '''img/''' and floppy images found in the '''floppyimg/''' directory.<br />
<br />
The examples below show some common uses of this feature.<br />
<br />
== Adding a VGA option ROM ==<br />
<br />
It is frequently necessary to add a VGA option ROM to CBFS in order to use a VGA adapter that is built-in to a motherboard. Note, VGA adapters on external cards do not require this step as SeaBIOS will automatically extract the VGA bios directly from the card. For machines without a VGA adapter, please follow the [[#Adding sgabios support|sgabios instructions]] below.<br />
<br />
The first step is to find the vendor and device ID of the built-in VGA adapter. This information can be found from '''lspci''':<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
01:00.0 VGA compatible controller [0300]: VIA Technologies, Inc. UniChrome Pro IGP [1106:3344] (rev 01) (prog-if 00 [VGA controller])<br />
</source><br />
<br />
In the above example, the VGA vendor/device ID is '''1106:3344'''. [[VGA support#How_to_retrieve_a_good_video_bios|Obtain the VGA ROM]] (eg, '''vgabios.bin''') and add it to the ROM with:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add /path/to/vgabios.bin pci1106,3344.rom 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
Alternatively, SeaBIOS supports LZMA compressed option ROMs. Use the following to add a compressed option ROM instead:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/vgabios.bin > vgabios.bin.lzma<br />
$ ./cbfs/cbfstool coreboot.rom add vgabios.bin.lzma pci1106,3344.rom.lzma 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
After the above is done, one can write the coreboot.rom file to flash. SeaBIOS will extract the VGA ROM and run it during boot.<br />
<br />
== Adding gpxe support ==<br />
<br />
A [[GPXE|gpxe]] option ROM can nicely complement SeaBIOS and coreboot by adding network boot support. Adding gpxe is similar to [[#Adding a VGA option ROM]]. The first step is to find the Ethernet vendor/device ID. For example:<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
00:09.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet [10ec:8167] (rev 10)<br />
</source><br />
<br />
Then one can build a gpxe option ROM. For example:<br />
<br />
<source lang="bash"><br />
$ cd /path/to/gpxe/src/<br />
$ make bin/10ec8167.rom<br />
</source><br />
<br />
And add it to the coreboot image. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add /path/to/gpxe/src/bin/10ec8167.rom pci10ec,8167.rom 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
As with VGA option ROMs, the gpxe option ROM may be compressed with LZMA. However, compression won't significantly reduce gpxe's size as it implements its own compression.<br />
<br />
In addition to gpxe, other option ROMs can be added in the same manner.<br />
<br />
== Adding sgabios support ==<br />
<br />
An [http://code.google.com/p/sgabios/ sgabios] option ROM can forward many VGA BIOS requests and keyboard events over a serial port. One can deploy it in addition to the primary VGA BIOS or by itself.<br />
<br />
If the target machine does not have a VGA adapter, then one should install sgabios. Most bootloaders (eg, grub) require a VGA BIOS in order to function properly - the sgabios rom can fill this requirement.<br />
<br />
The current version of sgabios (as of 20090617) does not implement a proper checksum. As a work around, a tool from the seabios source repo can fix the checksum:<br />
<source lang="bash"><br />
$ /path/to/seabios/tools/buildrom.py /path/to/sgabios.bin sgabios-fixed.bin<br />
</source><br />
<br />
Once the above is done, place the ROM file in the '''vgaroms/''' directory of CBFS. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add sgabios-fixed.bin vgaroms/sgabios.bin 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
When using sgabios, all the characters that SeaBIOS writes to the screen will be seen twice - once from SeaBIOS sending the character to the serial port and once from sgabios forwarding the character. To prevent the duplicates one can edit the SeaBIOS '''src/config.h''' file and set the following:<br />
<br />
<source lang="C"><br />
#define CONFIG_SCREEN_AND_DEBUG 0<br />
</source><br />
<br />
== Adding payloads ==<br />
<br />
Most [[Payloads|payloads]] can also be launched from SeaBIOS. To add a payload, build the corresponding .elf file and then add it to the '''coreboot.rom''' file in the '''img/''' directory. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add-payload /path/to/payload.elf img/MyPayload l<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
During boot, one can press the '''F12''' key to get a boot menu. SeaBIOS will show all files in the '''img/''' directory, and one can instruct SeaBIOS to run them.<br />
<br />
Note, SeaBIOS currently supports uncompressed and LZMA compressed payloads. The nrv2b compression algorithm is not supported.<br />
<br />
== Adding a floppy image ==<br />
<br />
It is possible to embed an image of a floppy in flash. SeaBIOS can then boot from and redirect floppy BIOS calls to the flash image. This is mainly useful for legacy software (such as DOS utilities). To use this feature, place a floppy image into the CBFS directory '''floppyimg/'''. For example:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/myfloppy.img > myfloppy.img.lzma<br />
$ ./cbfs/cbfstool coreboot.rom add myfloppy.img.lzma floppyimg/MyFloppy.lzma 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
Both uncompressed and lzma compressed images are supported. Several floppy formats are available: 360K, 1.2MB, 720K, 1.44MB, 2.88MB, 160K, 180K, 320K.<br />
<br />
The floppy image will appear as writable to the system, however all writes are discarded on reboot.<br />
<br />
When using this system, SeaBIOS reserves high-memory to store the floppy. The reserved memory is then no longer available for OS use, so this feature should only be used when needed.<br />
<br />
= Trouble reporting =<br />
<br />
If you are experiencing problems with SeaBIOS, it's useful to increase the debugging level. This is done by editing the '''src/config.h''' file and setting the debug level to a higher number (for example 8):<br />
<br />
<source lang="C"><br />
#define CONFIG_DEBUG_LEVEL 8<br />
</source><br />
<br />
A debug level of 8 will show a lot of diagnostic information without flooding the serial port (levels above 8 will frequently cause too much data).<br />
<br />
To report an issue, please collect the serial boot log with SeaBIOS set to a debug level of 8 and forward the full log along with a description of the problem to the coreboot [[Mailinglist|mailing list]].</div>KevinOConnorhttps://www.coreboot.org/index.php?title=SeaBIOS&diff=9599SeaBIOS2010-05-01T17:38:06Z<p>KevinOConnor: /* Building */ Update coreboot instructions to reflect coreboot build changes.</p>
<hr />
<div>'''SeaBIOS''' is an open-source legacy BIOS implementation which can be used as a coreboot [[Payloads|payload]]. It implements the standard BIOS calling interfaces that a typical x86 proprietary BIOS implements.<br />
<br />
This page describes using SeaBIOS with coreboot. SeaBIOS can also run natively in qemu and bochs - see the SeaBIOS README file for information on non-coreboot uses.<br />
<br />
= Use cases =<br />
<br />
Any software requiring 16-bit BIOS services benefits from SeaBIOS (eg, Windows and DOS). SeaBIOS also enables booting Linux out of the box (using standard boot-loaders like GRUB and Syslinux).<br />
<br />
SeaBIOS supports booting from ATA hard drives, ATAPI cdroms, USB hard drives, USB cdroms, payloads in flash, and from [http://en.wikipedia.org/wiki/Option_ROM Option ROMs] (eg, SCSI or network cards). SeaBIOS can initialize and use a ps2 keyboard or USB keyboard.<br />
<br />
== Windows ==<br />
<br />
SeaBIOS has been tested with Windows XP, Windows Vista (64/32 bit), and Windows 7 Beta (64 bit).<br />
<br />
However, Windows has a very strict ACPI interpreter, and many coreboot boards do not have a complete [[ACPI in coreboot|ACPI definition]]. As a result, many coreboot boards will fail during Windows boot (eg, it may fail with a STOP 0xA5 code).<br />
<br />
So far [[ASUS M2V-MX SE]] and [[GIGABYTE GA-M57SLI-S4]] have known good working ACPI and are able to boot XP/Vista/Windows 7. Please ask on the [[Mailinglist|mailing list]] for the status of other boards/chipsets.<br />
<br />
== Linux ==<br />
<br />
SeaBIOS has been tested with GRUB, LILO, and Syslinux. Linux booting works well.<br />
<br />
== Other ==<br />
<br />
SeaBIOS has also been tested with FreeDOS and NetBSD.<br />
<br />
Because SeaBIOS implements the standard x86 BIOS interfaces, it is expected many other operating systems and boot-loaders will work.<br />
<br />
= Building =<br />
<br />
== SeaBIOS ==<br />
<br />
One can download the latest version of SeaBIOS through a git repository:<br />
<br />
<source lang="bash"><br />
$ git clone git://git.linuxtogo.org/home/kevin/seabios.git seabios<br />
$ cd seabios<br />
</source><br />
<br />
There's also a [http://git.linuxtogo.org/?p=kevin/seabios.git;a=summary gitweb] facility to browse the latest source code online.<br />
<br />
Edit '''src/config.h''' and set the following values:<br />
<br />
<source lang="C"><br />
#define CONFIG_COREBOOT 1<br />
#define CONFIG_DEBUG_SERIAL 1<br />
#define CONFIG_VGAHOOKS 1<br />
</source><br />
<br />
Then:<br />
<br />
<source lang="bash"><br />
$ make<br />
</source><br />
<br />
The final SeaBIOS payload file is '''out/bios.bin.elf'''.<br />
<br />
=== Compiled SeaBIOS images ===<br />
<br />
It is also possible to download a compiled SeaBIOS image. The latest released version compiled for coreboot is: http://linuxtogo.org/~kevin/SeaBIOS/bios.bin.elf-0.6.0<br />
<br />
Other versions are also available at: http://linuxtogo.org/~kevin/SeaBIOS/<br />
<br />
== coreboot ==<br />
<br />
For best results, configure coreboot with CONFIG_WRITE_HIGH_TABLES and CONFIG_VGA_BRIDGE_SETUP both enabled, and CONFIG_VGA_ROM_RUN and CONFIG_PCI_ROM_RUN both disabled.<br />
<br />
Finally, configure the SeaBIOS '''/out/bios.bin.elf''' file as the coreboot payload and build coreboot. The resulting '''coreboot.rom''' file will contain both SeaBIOS and coreboot, and it can be flashed to a rom.<br />
<br />
= SeaBIOS and CBFS =<br />
<br />
SeaBIOS can read the coreboot flash filesystem and extract option ROMs and payloads.<br />
<br />
When SeaBIOS scans the target machine's PCI devices, it will recognize option ROMs in CBFS that have the form '''pciVVVV,DDDD.rom'''. It will also run any file in the directory '''vgaroms/''' as a vga option ROM not specific to a device and files in '''genroms/''' as a generic option ROM not specific to a device. In the above cases, SeaBIOS will recognize files with a '''.lzma''' suffix, and automatically decompress them (eg, '''pci1106,3344.rom.lzma''' and '''vgaroms/sgabios.bin.lzma''').<br />
<br />
SeaBIOS will also load payloads found in the CBFS directory '''img/''' and floppy images found in the '''floppyimg/''' directory.<br />
<br />
The examples below show some common uses of this feature.<br />
<br />
== Adding a VGA option ROM ==<br />
<br />
It is frequently necessary to add a VGA option ROM to CBFS in order to use a VGA adapter that is built-in to a motherboard. Note, VGA adapters on external cards do not require this step as SeaBIOS will automatically extract the VGA bios directly from the card.<br />
<br />
The first step is to find the vendor and device ID of the built-in VGA adapter. This information can be found from '''lspci''':<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
01:00.0 VGA compatible controller [0300]: VIA Technologies, Inc. UniChrome Pro IGP [1106:3344] (rev 01) (prog-if 00 [VGA controller])<br />
</source><br />
<br />
In the above example, the VGA vendor/device ID is '''1106:3344'''. [[VGA support#How_to_retrieve_a_good_video_bios|Obtain the VGA ROM]] (eg, '''vgabios.bin''') and add it to the ROM with:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add /path/to/vgabios.bin pci1106,3344.rom 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
Alternatively, SeaBIOS supports LZMA compressed option ROMs. Use the following to add a compressed option ROM instead:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/vgabios.bin > vgabios.bin.lzma<br />
$ ./cbfs/cbfstool coreboot.rom add vgabios.bin.lzma pci1106,3344.rom.lzma 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
After the above is done, one can write the coreboot.rom file to flash. SeaBIOS will extract the VGA ROM and run it during boot.<br />
<br />
== Adding gpxe support ==<br />
<br />
A [[GPXE|gpxe]] option ROM can nicely complement SeaBIOS and coreboot by adding network boot support. Adding gpxe is similar to [[#Adding a VGA option ROM]]. The first step is to find the Ethernet vendor/device ID. For example:<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
00:09.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet [10ec:8167] (rev 10)<br />
</source><br />
<br />
Then one can build a gpxe option ROM. For example:<br />
<br />
<source lang="bash"><br />
$ cd /path/to/gpxe/src/<br />
$ make bin/10ec8167.rom<br />
</source><br />
<br />
And add it to the coreboot image. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add /path/to/gpxe/src/bin/10ec8167.rom pci10ec,8167.rom 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
As with VGA option ROMs, the gpxe option ROM may be compressed with LZMA. However, compression won't significantly reduce gpxe's size as it implements its own compression.<br />
<br />
In addition to gpxe, other option ROMs can be added in the same manor.<br />
<br />
== Adding sgabios support ==<br />
<br />
An [http://code.google.com/p/sgabios/ sgabios] option ROM can forward some VGA BIOS requests over a serial port.<br />
<br />
Unfortunately, the current version of sgabios (as of 20090617) does not implement a proper checksum. As a work around, a tool from the seabios source repo can fix the checksum:<br />
<source lang="bash"><br />
$ /path/to/seabios/tools/buildrom.py /path/to/sgabios.bin sgabios-fixed.bin<br />
</source><br />
<br />
Once the above is done, place the ROM file in the '''vgaroms/''' directory of CBFS. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add sgabios-fixed.bin vgaroms/sgabios.bin 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
When using sgabios, all the characters that SeaBIOS writes to the screen will be seen twice - once from SeaBIOS sending the character to the serial port and once from sgabios forwarding the character. To prevent the duplicates one can edit the SeaBIOS '''src/config.h''' file and set the following:<br />
<br />
<source lang="C"><br />
#define CONFIG_SCREEN_AND_DEBUG 0<br />
</source><br />
<br />
== Adding payloads ==<br />
<br />
Most [[Payloads|payloads]] can also be launched from SeaBIOS. To add a payload, build the corresponding .elf file and then add it to the '''coreboot.rom''' file in the '''img/''' directory. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add-payload /path/to/payload.elf img/MyPayload l<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
During boot, one can press the '''F12''' key to get a boot menu. SeaBIOS will show all files in the '''img/''' directory, and one can instruct SeaBIOS to run them.<br />
<br />
Note, SeaBIOS currently supports uncompressed and LZMA compressed payloads. The nrv2b compression algorithm is not supported.<br />
<br />
== Adding a floppy image ==<br />
<br />
It is possible to embed an image of a floppy in flash. SeaBIOS can then boot from and redirect floppy BIOS calls to the flash image. This is mainly useful for legacy software (such as DOS utilities). To use this feature, place a floppy image into the CBFS directory '''floppyimg/'''. For example:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/myfloppy.img > myfloppy.img.lzma<br />
$ ./cbfs/cbfstool coreboot.rom add myfloppy.img.lzma floppyimg/MyFloppy.lzma 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
Both uncompressed and lzma compressed images are supported. Several floppy formats are available: 360K, 1.2MB, 720K, 1.44MB, 2.88MB, 160K, 180K, 320K.<br />
<br />
The floppy image will appear as writable to the system, however all writes are discarded on reboot.<br />
<br />
When using this system, SeaBIOS reserves high-memory to store the floppy. The reserved memory is then no longer available for OS use, so this feature should only be used when needed.<br />
<br />
= Trouble reporting =<br />
<br />
If you are experiencing problems with SeaBIOS, it's useful to increase the debugging level. This is done by editing the '''src/config.h''' file and setting the debug level to a higher number (for example 8):<br />
<br />
<source lang="C"><br />
#define CONFIG_DEBUG_LEVEL 8<br />
</source><br />
<br />
A debug level of 8 will show a lot of diagnostic information without flooding the serial port (levels above 8 will frequently cause too much data).<br />
<br />
To report an issue, please collect the serial boot log with SeaBIOS set to a debug level of 8 and forward the full log along with a description of the problem to the coreboot [[Mailinglist|mailing list]].</div>KevinOConnorhttps://www.coreboot.org/index.php?title=SeaBIOS&diff=9468SeaBIOS2010-03-27T02:12:47Z<p>KevinOConnor: Update for SeaBIOS 0.6.0 release</p>
<hr />
<div>'''SeaBIOS''' is an open-source legacy BIOS implementation which can be used as a coreboot [[Payloads|payload]]. It implements the standard BIOS calling interfaces that a typical x86 proprietary BIOS implements.<br />
<br />
This page describes using SeaBIOS with coreboot. SeaBIOS can also run natively in qemu and bochs - see the SeaBIOS README file for information on non-coreboot uses.<br />
<br />
= Use cases =<br />
<br />
Any software requiring 16-bit BIOS services benefits from SeaBIOS (eg, Windows and DOS). SeaBIOS also enables booting Linux out of the box (using standard boot-loaders like GRUB and Syslinux).<br />
<br />
SeaBIOS supports booting from ATA hard drives, ATAPI cdroms, USB hard drives, USB cdroms, payloads in flash, and from [http://en.wikipedia.org/wiki/Option_ROM Option ROMs] (eg, SCSI or network cards). SeaBIOS can initialize and use a ps2 keyboard or USB keyboard.<br />
<br />
== Windows ==<br />
<br />
SeaBIOS has been tested with Windows XP, Windows Vista (64/32 bit), and Windows 7 Beta (64 bit).<br />
<br />
However, Windows has a very strict ACPI interpreter, and many coreboot boards do not have a complete [[ACPI in coreboot|ACPI definition]]. As a result, many coreboot boards will fail during Windows boot (eg, it may fail with a STOP 0xA5 code).<br />
<br />
So far [[ASUS M2V-MX SE]] and [[GIGABYTE GA-M57SLI-S4]] have known good working ACPI and are able to boot XP/Vista/Windows 7. Please ask on the [[Mailinglist|mailing list]] for the status of other boards/chipsets.<br />
<br />
== Linux ==<br />
<br />
SeaBIOS has been tested with GRUB, LILO, and Syslinux. Linux booting works well.<br />
<br />
== Other ==<br />
<br />
SeaBIOS has also been tested with FreeDOS and NetBSD.<br />
<br />
Because SeaBIOS implements the standard x86 BIOS interfaces, it is expected many other operating systems and boot-loaders will work.<br />
<br />
= Building =<br />
<br />
== SeaBIOS ==<br />
<br />
One can download the latest version of SeaBIOS through a git repository:<br />
<br />
<source lang="bash"><br />
$ git clone git://git.linuxtogo.org/home/kevin/seabios.git seabios<br />
$ cd seabios<br />
</source><br />
<br />
There's also a [http://git.linuxtogo.org/?p=kevin/seabios.git;a=summary gitweb] facility to browse the latest source code online.<br />
<br />
Edit '''src/config.h''' and set the following values:<br />
<br />
<source lang="C"><br />
#define CONFIG_COREBOOT 1<br />
#define CONFIG_DEBUG_SERIAL 1<br />
#define CONFIG_VGAHOOKS 1<br />
</source><br />
<br />
Then:<br />
<br />
<source lang="bash"><br />
$ make<br />
</source><br />
<br />
The final SeaBIOS payload file is '''out/bios.bin.elf''', which can be used with coreboot v2 or v3.<br />
<br />
=== Compiled SeaBIOS images ===<br />
<br />
It is also possible to download a compiled SeaBIOS image. The latest released version compiled for coreboot is: http://linuxtogo.org/~kevin/SeaBIOS/bios.bin.elf-0.6.0<br />
<br />
Other versions are also available at: http://linuxtogo.org/~kevin/SeaBIOS/<br />
<br />
== coreboot ==<br />
<br />
For best results, use coreboot-v2 and edit the '''targets/..../Config.lb''' with the following:<br />
<br />
option CONFIG_CBFS = 1<br />
option HAVE_HIGH_TABLES = 1<br />
...<br />
romimage "fallback"<br />
...<br />
payload /path/to/seabios/out/bios.bin.elf<br />
end<br />
<br />
Unfortunately, many boards don't have HAVE_HIGH_TABLES support, yet. If the build fails complaining about this option, one can edit the '''src/mainboard/<vendor>/<board>/Options.lb''' file and add a "uses HAVE_HIGH_TABLES" line. Then one can edit '''src/arch/i386/boot/tables.c''' and change the lines:<br />
<br />
<source lang="C"><br />
uint64_t high_tables_base = 0;<br />
uint64_t high_tables_size;<br />
</source><br />
<br />
to:<br />
<br />
<source lang="C"><br />
uint64_t high_tables_base = ( <memorysize> ) * 1024 * 1024 - (64 * 1024);<br />
uint64_t high_tables_size = 64 * 1024;<br />
</source><br />
<br />
where <memorysize> is the amount of memory (in MiB) available on the target machine, but '''not more than 3072'''. So, if there is more than 3GiB of RAM installed, put 3072. Otherwise, put the number of MiB of RAM installed in the machine.<br />
<br />
Alternatively, one can add proper support for HAVE_HIGH_TABLES.<br />
<br />
Once the above is done, the final image will be in '''coreboot.rom'''.<br />
<br />
= SeaBIOS and CBFS =<br />
<br />
SeaBIOS can read the coreboot flash filesystem and extract option ROMs and payloads.<br />
<br />
When SeaBIOS scans the target machine's PCI devices, it will recognize option ROMs in CBFS that have the form '''pciVVVV,DDDD.rom'''. It will also run any file in the directory '''vgaroms/''' as a vga option ROM not specific to a device and files in '''genroms/''' as a generic option ROM not specific to a device. In the above cases, SeaBIOS will recognize files with a '''.lzma''' suffix, and automatically decompress them (eg, '''pci1106,3344.rom.lzma''' and '''vgaroms/sgabios.bin.lzma''').<br />
<br />
SeaBIOS will also load payloads found in the CBFS directory '''img/''' and floppy images found in the '''floppyimg/''' directory.<br />
<br />
The examples below show some common uses of this feature.<br />
<br />
== Adding a VGA option ROM ==<br />
<br />
It is frequently necessary to add a VGA option ROM to CBFS in order to use a VGA adapter that is built-in to a motherboard. Note, VGA adapters on external cards do not require this step as SeaBIOS will automatically extract the VGA bios directly from the card.<br />
<br />
The first step is to find the vendor and device ID of the built-in VGA adapter. This information can be found from '''lspci''':<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
01:00.0 VGA compatible controller [0300]: VIA Technologies, Inc. UniChrome Pro IGP [1106:3344] (rev 01) (prog-if 00 [VGA controller])<br />
</source><br />
<br />
In the above example, the VGA vendor/device ID is '''1106:3344'''. [[VGA support#How_to_retrieve_a_good_video_bios|Obtain the VGA ROM]] (eg, '''vgabios.bin''') and add it to the ROM with:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add /path/to/vgabios.bin pci1106,3344.rom 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
Alternatively, SeaBIOS supports LZMA compressed option ROMs. Use the following to add a compressed option ROM instead:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/vgabios.bin > vgabios.bin.lzma<br />
$ ./cbfs/cbfstool coreboot.rom add vgabios.bin.lzma pci1106,3344.rom.lzma 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
After the above is done, one can write the coreboot.rom file to flash. SeaBIOS will extract the VGA ROM and run it during boot.<br />
<br />
== Adding gpxe support ==<br />
<br />
A [[GPXE|gpxe]] option ROM can nicely complement SeaBIOS and coreboot by adding network boot support. Adding gpxe is similar to [[#Adding a VGA option ROM]]. The first step is to find the Ethernet vendor/device ID. For example:<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
00:09.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet [10ec:8167] (rev 10)<br />
</source><br />
<br />
Then one can build a gpxe option ROM. For example:<br />
<br />
<source lang="bash"><br />
$ cd /path/to/gpxe/src/<br />
$ make bin/10ec8167.rom<br />
</source><br />
<br />
And add it to the coreboot image. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add /path/to/gpxe/src/bin/10ec8167.rom pci10ec,8167.rom 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
As with VGA option ROMs, the gpxe option ROM may be compressed with LZMA. However, compression won't significantly reduce gpxe's size as it implements its own compression.<br />
<br />
In addition to gpxe, other option ROMs can be added in the same manor.<br />
<br />
== Adding sgabios support ==<br />
<br />
An [http://code.google.com/p/sgabios/ sgabios] option ROM can forward some VGA BIOS requests over a serial port.<br />
<br />
Unfortunately, the current version of sgabios (as of 20090617) does not implement a proper checksum. As a work around, a tool from the seabios source repo can fix the checksum:<br />
<source lang="bash"><br />
$ /path/to/seabios/tools/buildrom.py /path/to/sgabios.bin sgabios-fixed.bin<br />
</source><br />
<br />
Once the above is done, place the ROM file in the '''vgaroms/''' directory of CBFS. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add sgabios-fixed.bin vgaroms/sgabios.bin 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
When using sgabios, all the characters that SeaBIOS writes to the screen will be seen twice - once from SeaBIOS sending the character to the serial port and once from sgabios forwarding the character. To prevent the duplicates one can edit the SeaBIOS '''src/config.h''' file and set the following:<br />
<br />
<source lang="C"><br />
#define CONFIG_SCREEN_AND_DEBUG 0<br />
</source><br />
<br />
== Adding payloads ==<br />
<br />
Most [[Payloads|payloads]] can also be launched from SeaBIOS. To add a payload, build the corresponding .elf file and then add it to the '''coreboot.rom''' file in the '''img/''' directory. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add-payload /path/to/payload.elf img/MyPayload l<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
During boot, one can press the '''F12''' key to get a boot menu. SeaBIOS will show all files in the '''img/''' directory, and one can instruct SeaBIOS to run them.<br />
<br />
Note, SeaBIOS currently supports uncompressed and LZMA compressed payloads. The nrv2b compression algorithm is not supported.<br />
<br />
== Adding a floppy image ==<br />
<br />
It is possible to embed an image of a floppy in flash. SeaBIOS can then boot from and redirect floppy BIOS calls to the flash image. This is mainly useful for legacy software (such as DOS utilities). To use this feature, place a floppy image into the CBFS directory '''floppyimg/'''. For example:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/myfloppy.img > myfloppy.img.lzma<br />
$ ./cbfs/cbfstool coreboot.rom add myfloppy.img.lzma floppyimg/MyFloppy.lzma 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
Both uncompressed and lzma compressed images are supported. Several floppy formats are available: 360K, 1.2MB, 720K, 1.44MB, 2.88MB, 160K, 180K, 320K.<br />
<br />
The floppy image will appear as writable to the system, however all writes are discarded on reboot.<br />
<br />
When using this system, SeaBIOS reserves high-memory to store the floppy. The reserved memory is then no longer available for OS use, so this feature should only be used when needed.<br />
<br />
= Trouble reporting =<br />
<br />
If you are experiencing problems with SeaBIOS, it's useful to increase the debugging level. This is done by editing the '''src/config.h''' file and setting the debug level to a higher number (for example 8):<br />
<br />
<source lang="C"><br />
#define CONFIG_DEBUG_LEVEL 8<br />
</source><br />
<br />
A debug level of 8 will show a lot of diagnostic information without flooding the serial port (levels above 8 will frequently cause too much data).<br />
<br />
To report an issue, please collect the serial boot log with SeaBIOS set to a debug level of 8 and forward the full log along with a description of the problem to the coreboot [[Mailinglist|mailing list]].</div>KevinOConnorhttps://www.coreboot.org/index.php?title=SeaBIOS&diff=9187SeaBIOS2010-01-09T05:05:37Z<p>KevinOConnor: /* Compiled SeaBIOS images */ Latest SeaBIOS is 0.5.1</p>
<hr />
<div>'''SeaBIOS''' is an open-source legacy BIOS implementation which can be used as a coreboot [[Payloads|payload]]. It implements the standard BIOS calling interfaces that a typical x86 proprietary BIOS implements.<br />
<br />
This page describes using SeaBIOS with coreboot. SeaBIOS can also run natively in qemu and bochs - see the SeaBIOS README file for information on non-coreboot uses.<br />
<br />
= Use cases =<br />
<br />
Any software requiring 16-bit BIOS services benefits from SeaBIOS (eg, Windows and DOS). SeaBIOS also enables booting Linux out of the box (using standard boot-loaders like GRUB and Syslinux).<br />
<br />
SeaBIOS supports booting from ATA hard drives, ATAPI cdroms, payloads in flash, and from [http://en.wikipedia.org/wiki/Option_ROM Option ROMs] (eg, SCSI or network cards). SeaBIOS can initialize and use a ps2 keyboard and it has basic support for USB keyboards. SeaBIOS does not currently support booting from USB drives.<br />
<br />
== Windows ==<br />
<br />
SeaBIOS has been tested with Windows XP, Windows Vista (64/32 bit), and Windows 7 Beta (64 bit).<br />
<br />
However, Windows has a very strict ACPI interpreter, and many coreboot boards do not have a complete [[ACPI in coreboot|ACPI definition]]. As a result, many coreboot boards will fail during Windows boot (eg, it may fail with a STOP 0xA5 code).<br />
<br />
So far [[ASUS M2V-MX SE]] and [[GIGABYTE GA-M57SLI-S4]] have known good working ACPI and are able to boot XP/Vista/Windows 7. Please ask on the [[Mailinglist|mailing list]] for the status of other boards/chipsets.<br />
<br />
== Linux ==<br />
<br />
SeaBIOS has been tested with GRUB, LILO, and Syslinux. Linux booting works well.<br />
<br />
== Other ==<br />
<br />
SeaBIOS has also been tested with FreeDOS and NetBSD.<br />
<br />
Because SeaBIOS implements the standard x86 BIOS interfaces, it is expected many other operating systems and boot-loaders will work.<br />
<br />
= Building =<br />
<br />
== SeaBIOS ==<br />
<br />
One can download the latest version of SeaBIOS through a git repository:<br />
<br />
<source lang="bash"><br />
$ git clone git://git.linuxtogo.org/home/kevin/seabios.git seabios<br />
$ cd seabios<br />
</source><br />
<br />
There's also a [http://git.linuxtogo.org/?p=kevin/seabios.git;a=summary gitweb] facility to browse the latest source code online.<br />
<br />
Edit '''src/config.h''' and set the following values:<br />
<br />
<source lang="C"><br />
#define CONFIG_COREBOOT 1<br />
#define CONFIG_DEBUG_SERIAL 1<br />
#define CONFIG_COREBOOT_FLASH 1<br />
#define CONFIG_VGAHOOKS 1<br />
</source><br />
<br />
Then:<br />
<br />
<source lang="bash"><br />
$ make<br />
</source><br />
<br />
The final SeaBIOS payload file is '''out/bios.bin.elf''', which can be used with coreboot v2 or v3.<br />
<br />
=== Compiled SeaBIOS images ===<br />
<br />
It is also possible to download a compiled SeaBIOS image. The latest released version compiled for coreboot is: http://linuxtogo.org/~kevin/SeaBIOS/bios.bin.elf-0.5.1<br />
<br />
Other versions are also available at: http://linuxtogo.org/~kevin/SeaBIOS/<br />
<br />
== coreboot ==<br />
<br />
For best results, use coreboot-v2 and edit the '''targets/..../Config.lb''' with the following:<br />
<br />
option CONFIG_CBFS = 1<br />
option HAVE_HIGH_TABLES = 1<br />
...<br />
romimage "fallback"<br />
...<br />
payload /path/to/seabios/out/bios.bin.elf<br />
end<br />
<br />
Unfortunately, many boards don't have HAVE_HIGH_TABLES support, yet. If the build fails complaining about this option, one can edit the '''src/mainboard/<vendor>/<board>/Options.lb''' file and add a "uses HAVE_HIGH_TABLES" line. Then one can edit '''src/arch/i386/boot/tables.c''' and change the lines:<br />
<br />
<source lang="C"><br />
uint64_t high_tables_base = 0;<br />
uint64_t high_tables_size;<br />
</source><br />
<br />
to:<br />
<br />
<source lang="C"><br />
uint64_t high_tables_base = ( <memorysize> ) * 1024 * 1024 - (64 * 1024);<br />
uint64_t high_tables_size = 64 * 1024;<br />
</source><br />
<br />
where <memorysize> is the amount of memory (in MiB) available on the target machine, but '''not more than 3072'''. So, if there is more than 3GiB of RAM installed, put 3072. Otherwise, put the number of MiB of RAM installed in the machine.<br />
<br />
Alternatively, one can add proper support for HAVE_HIGH_TABLES.<br />
<br />
Once the above is done, the final image will be in '''coreboot.rom'''.<br />
<br />
= SeaBIOS and CBFS =<br />
<br />
SeaBIOS can read the coreboot flash filesystem and extract option ROMs and payloads.<br />
<br />
When SeaBIOS scans the target machine's PCI devices, it will recognize option ROMs in CBFS that have the form '''pciVVVV,DDDD.rom'''. It will also run any file in the directory '''vgaroms/''' as a vga option ROM not specific to a device and files in '''genroms/''' as a generic option ROM not specific to a device. In the above cases, SeaBIOS will recognize files with a '''.lzma''' suffix, and automatically decompress them (eg, '''pci1106,3344.rom.lzma''' and '''vgaroms/sgabios.bin.lzma''').<br />
<br />
SeaBIOS will also load payloads found in the CBFS directory '''img/''' and floppy images found in the '''floppyimg/''' directory.<br />
<br />
The examples below show some common uses of this feature.<br />
<br />
== Adding a VGA option ROM ==<br />
<br />
It is frequently necessary to add a VGA option ROM to CBFS in order to use a VGA adapter that is built-in to a motherboard. Note, VGA adapters on external cards do not require this step as SeaBIOS will automatically extract the VGA bios directly from the card.<br />
<br />
The first step is to find the vendor and device ID of the built-in VGA adapter. This information can be found from '''lspci''':<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
01:00.0 VGA compatible controller [0300]: VIA Technologies, Inc. UniChrome Pro IGP [1106:3344] (rev 01) (prog-if 00 [VGA controller])<br />
</source><br />
<br />
In the above example, the VGA vendor/device ID is '''1106:3344'''. [[VGA support#How_to_retrieve_a_good_video_bios|Obtain the VGA ROM]] (eg, '''vgabios.bin''') and add it to the ROM with:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add /path/to/vgabios.bin pci1106,3344.rom 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
Alternatively, SeaBIOS supports LZMA compressed option ROMs. Use the following to add a compressed option ROM instead:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/vgabios.bin > vgabios.bin.lzma<br />
$ ./cbfs/cbfstool coreboot.rom add vgabios.bin.lzma pci1106,3344.rom.lzma 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
After the above is done, one can write the coreboot.rom file to flash. SeaBIOS will extract the VGA ROM and run it during boot.<br />
<br />
== Adding gpxe support ==<br />
<br />
A [[GPXE|gpxe]] option ROM can nicely complement SeaBIOS and coreboot by adding network boot support. Adding gpxe is similar to [[#Adding a VGA option ROM]]. The first step is to find the Ethernet vendor/device ID. For example:<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
00:09.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet [10ec:8167] (rev 10)<br />
</source><br />
<br />
Then one can build a gpxe option ROM. For example:<br />
<br />
<source lang="bash"><br />
$ cd /path/to/gpxe/src/<br />
$ make bin/10ec8167.rom<br />
</source><br />
<br />
And add it to the coreboot image. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add /path/to/gpxe/src/bin/10ec8167.rom pci10ec,8167.rom 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
As with VGA option ROMs, the gpxe option ROM may be compressed with LZMA. However, compression won't significantly reduce gpxe's size as it implements its own compression.<br />
<br />
In addition to gpxe, other option ROMs can be added in the same manor.<br />
<br />
== Adding sgabios support ==<br />
<br />
An [http://code.google.com/p/sgabios/ sgabios] option ROM can forward some VGA BIOS requests over a serial port.<br />
<br />
Unfortunately, the current version of sgabios (as of 20090617) does not implement a proper checksum. As a work around, a tool from the seabios source repo can fix the checksum:<br />
<source lang="bash"><br />
$ /path/to/seabios/tools/buildrom.py /path/to/sgabios.bin sgabios-fixed.bin<br />
</source><br />
<br />
Once the above is done, place the ROM file in the '''vgaroms/''' directory of CBFS. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add sgabios-fixed.bin vgaroms/sgabios.bin 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
When using sgabios, all the characters that SeaBIOS writes to the screen will be seen twice - once from SeaBIOS sending the character to the serial port and once from sgabios forwarding the character. To prevent the duplicates one can edit the SeaBIOS '''src/config.h''' file and set the following:<br />
<br />
<source lang="C"><br />
#define CONFIG_SCREEN_AND_DEBUG 0<br />
</source><br />
<br />
== Adding payloads ==<br />
<br />
Most [[Payloads|payloads]] can also be launched from SeaBIOS. To add a payload, build the corresponding .elf file and then add it to the '''coreboot.rom''' file in the '''img/''' directory. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add-payload /path/to/payload.elf img/MyPayload l<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
During boot, one can press the '''F12''' key to get a boot menu. SeaBIOS will show all files in the '''img/''' directory, and one can instruct SeaBIOS to run them.<br />
<br />
Note, SeaBIOS currently supports uncompressed and LZMA compressed payloads. The nrv2b compression algorithm is not supported.<br />
<br />
== Adding a floppy image ==<br />
<br />
It is possible to embed an image of a floppy in flash. SeaBIOS can then boot from and redirect floppy BIOS calls to the flash image. This is mainly useful for legacy software (such as DOS utilities). To use this feature, place a floppy image into the CBFS directory '''floppyimg/'''. For example:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/myfloppy.img > myfloppy.img.lzma<br />
$ ./cbfs/cbfstool coreboot.rom add myfloppy.img.lzma floppyimg/MyFloppy.lzma 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
Both uncompressed and lzma compressed images are supported. Several floppy formats are available: 360K, 1.2MB, 720K, 1.44MB, 2.88MB, 160K, 180K, 320K.<br />
<br />
The floppy image will appear as writable to the system, however all writes are discarded on reboot.<br />
<br />
When using this system, SeaBIOS reserves high-memory to store the floppy. The reserved memory is then no longer available for OS use, so this feature should only be used when needed.<br />
<br />
= Trouble reporting =<br />
<br />
If you are experiencing problems with SeaBIOS, it's useful to increase the debugging level. This is done by editing the '''src/config.h''' file and setting the debug level to a higher number (for example 8):<br />
<br />
<source lang="C"><br />
#define CONFIG_DEBUG_LEVEL 8<br />
</source><br />
<br />
A debug level of 8 will show a lot of diagnostic information without flooding the serial port (levels above 8 will frequently cause too much data).<br />
<br />
To report an issue, please collect the serial boot log with SeaBIOS set to a debug level of 8 and forward the full log along with a description of the problem to the coreboot [[Mailinglist|mailing list]].</div>KevinOConnorhttps://www.coreboot.org/index.php?title=SeaBIOS&diff=9181SeaBIOS2010-01-05T00:42:47Z<p>KevinOConnor: /* SeaBIOS */ CONFIG_OPTIONROMS_DEPLOYED is now 0 by default.</p>
<hr />
<div>'''SeaBIOS''' is an open-source legacy BIOS implementation which can be used as a coreboot [[Payloads|payload]]. It implements the standard BIOS calling interfaces that a typical x86 proprietary BIOS implements.<br />
<br />
This page describes using SeaBIOS with coreboot. SeaBIOS can also run natively in qemu and bochs - see the SeaBIOS README file for information on non-coreboot uses.<br />
<br />
= Use cases =<br />
<br />
Any software requiring 16-bit BIOS services benefits from SeaBIOS (eg, Windows and DOS). SeaBIOS also enables booting Linux out of the box (using standard boot-loaders like GRUB and Syslinux).<br />
<br />
SeaBIOS supports booting from ATA hard drives, ATAPI cdroms, payloads in flash, and from [http://en.wikipedia.org/wiki/Option_ROM Option ROMs] (eg, SCSI or network cards). SeaBIOS can initialize and use a ps2 keyboard and it has basic support for USB keyboards. SeaBIOS does not currently support booting from USB drives.<br />
<br />
== Windows ==<br />
<br />
SeaBIOS has been tested with Windows XP, Windows Vista (64/32 bit), and Windows 7 Beta (64 bit).<br />
<br />
However, Windows has a very strict ACPI interpreter, and many coreboot boards do not have a complete [[ACPI in coreboot|ACPI definition]]. As a result, many coreboot boards will fail during Windows boot (eg, it may fail with a STOP 0xA5 code).<br />
<br />
So far [[ASUS M2V-MX SE]] and [[GIGABYTE GA-M57SLI-S4]] have known good working ACPI and are able to boot XP/Vista/Windows 7. Please ask on the [[Mailinglist|mailing list]] for the status of other boards/chipsets.<br />
<br />
== Linux ==<br />
<br />
SeaBIOS has been tested with GRUB, LILO, and Syslinux. Linux booting works well.<br />
<br />
== Other ==<br />
<br />
SeaBIOS has also been tested with FreeDOS and NetBSD.<br />
<br />
Because SeaBIOS implements the standard x86 BIOS interfaces, it is expected many other operating systems and boot-loaders will work.<br />
<br />
= Building =<br />
<br />
== SeaBIOS ==<br />
<br />
One can download the latest version of SeaBIOS through a git repository:<br />
<br />
<source lang="bash"><br />
$ git clone git://git.linuxtogo.org/home/kevin/seabios.git seabios<br />
$ cd seabios<br />
</source><br />
<br />
There's also a [http://git.linuxtogo.org/?p=kevin/seabios.git;a=summary gitweb] facility to browse the latest source code online.<br />
<br />
Edit '''src/config.h''' and set the following values:<br />
<br />
<source lang="C"><br />
#define CONFIG_COREBOOT 1<br />
#define CONFIG_DEBUG_SERIAL 1<br />
#define CONFIG_COREBOOT_FLASH 1<br />
#define CONFIG_VGAHOOKS 1<br />
</source><br />
<br />
Then:<br />
<br />
<source lang="bash"><br />
$ make<br />
</source><br />
<br />
The final SeaBIOS payload file is '''out/bios.bin.elf''', which can be used with coreboot v2 or v3.<br />
<br />
=== Compiled SeaBIOS images ===<br />
<br />
It is also possible to download a compiled SeaBIOS image. The latest released version compiled for coreboot is: http://linuxtogo.org/~kevin/SeaBIOS/bios.bin.elf-0.5.0<br />
<br />
Other versions are also available at: http://linuxtogo.org/~kevin/SeaBIOS/<br />
<br />
== coreboot ==<br />
<br />
For best results, use coreboot-v2 and edit the '''targets/..../Config.lb''' with the following:<br />
<br />
option CONFIG_CBFS = 1<br />
option HAVE_HIGH_TABLES = 1<br />
...<br />
romimage "fallback"<br />
...<br />
payload /path/to/seabios/out/bios.bin.elf<br />
end<br />
<br />
Unfortunately, many boards don't have HAVE_HIGH_TABLES support, yet. If the build fails complaining about this option, one can edit the '''src/mainboard/<vendor>/<board>/Options.lb''' file and add a "uses HAVE_HIGH_TABLES" line. Then one can edit '''src/arch/i386/boot/tables.c''' and change the lines:<br />
<br />
<source lang="C"><br />
uint64_t high_tables_base = 0;<br />
uint64_t high_tables_size;<br />
</source><br />
<br />
to:<br />
<br />
<source lang="C"><br />
uint64_t high_tables_base = ( <memorysize> ) * 1024 * 1024 - (64 * 1024);<br />
uint64_t high_tables_size = 64 * 1024;<br />
</source><br />
<br />
where <memorysize> is the amount of memory (in MiB) available on the target machine, but '''not more than 3072'''. So, if there is more than 3GiB of RAM installed, put 3072. Otherwise, put the number of MiB of RAM installed in the machine.<br />
<br />
Alternatively, one can add proper support for HAVE_HIGH_TABLES.<br />
<br />
Once the above is done, the final image will be in '''coreboot.rom'''.<br />
<br />
= SeaBIOS and CBFS =<br />
<br />
SeaBIOS can read the coreboot flash filesystem and extract option ROMs and payloads.<br />
<br />
When SeaBIOS scans the target machine's PCI devices, it will recognize option ROMs in CBFS that have the form '''pciVVVV,DDDD.rom'''. It will also run any file in the directory '''vgaroms/''' as a vga option ROM not specific to a device and files in '''genroms/''' as a generic option ROM not specific to a device. In the above cases, SeaBIOS will recognize files with a '''.lzma''' suffix, and automatically decompress them (eg, '''pci1106,3344.rom.lzma''' and '''vgaroms/sgabios.bin.lzma''').<br />
<br />
SeaBIOS will also load payloads found in the CBFS directory '''img/''' and floppy images found in the '''floppyimg/''' directory.<br />
<br />
The examples below show some common uses of this feature.<br />
<br />
== Adding a VGA option ROM ==<br />
<br />
It is frequently necessary to add a VGA option ROM to CBFS in order to use a VGA adapter that is built-in to a motherboard. Note, VGA adapters on external cards do not require this step as SeaBIOS will automatically extract the VGA bios directly from the card.<br />
<br />
The first step is to find the vendor and device ID of the built-in VGA adapter. This information can be found from '''lspci''':<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
01:00.0 VGA compatible controller [0300]: VIA Technologies, Inc. UniChrome Pro IGP [1106:3344] (rev 01) (prog-if 00 [VGA controller])<br />
</source><br />
<br />
In the above example, the VGA vendor/device ID is '''1106:3344'''. [[VGA support#How_to_retrieve_a_good_video_bios|Obtain the VGA ROM]] (eg, '''vgabios.bin''') and add it to the ROM with:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add /path/to/vgabios.bin pci1106,3344.rom 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
Alternatively, SeaBIOS supports LZMA compressed option ROMs. Use the following to add a compressed option ROM instead:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/vgabios.bin > vgabios.bin.lzma<br />
$ ./cbfs/cbfstool coreboot.rom add vgabios.bin.lzma pci1106,3344.rom.lzma 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
After the above is done, one can write the coreboot.rom file to flash. SeaBIOS will extract the VGA ROM and run it during boot.<br />
<br />
== Adding gpxe support ==<br />
<br />
A [[GPXE|gpxe]] option ROM can nicely complement SeaBIOS and coreboot by adding network boot support. Adding gpxe is similar to [[#Adding a VGA option ROM]]. The first step is to find the Ethernet vendor/device ID. For example:<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
00:09.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet [10ec:8167] (rev 10)<br />
</source><br />
<br />
Then one can build a gpxe option ROM. For example:<br />
<br />
<source lang="bash"><br />
$ cd /path/to/gpxe/src/<br />
$ make bin/10ec8167.rom<br />
</source><br />
<br />
And add it to the coreboot image. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add /path/to/gpxe/src/bin/10ec8167.rom pci10ec,8167.rom 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
As with VGA option ROMs, the gpxe option ROM may be compressed with LZMA. However, compression won't significantly reduce gpxe's size as it implements its own compression.<br />
<br />
In addition to gpxe, other option ROMs can be added in the same manor.<br />
<br />
== Adding sgabios support ==<br />
<br />
An [http://code.google.com/p/sgabios/ sgabios] option ROM can forward some VGA BIOS requests over a serial port.<br />
<br />
Unfortunately, the current version of sgabios (as of 20090617) does not implement a proper checksum. As a work around, a tool from the seabios source repo can fix the checksum:<br />
<source lang="bash"><br />
$ /path/to/seabios/tools/buildrom.py /path/to/sgabios.bin sgabios-fixed.bin<br />
</source><br />
<br />
Once the above is done, place the ROM file in the '''vgaroms/''' directory of CBFS. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add sgabios-fixed.bin vgaroms/sgabios.bin 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
When using sgabios, all the characters that SeaBIOS writes to the screen will be seen twice - once from SeaBIOS sending the character to the serial port and once from sgabios forwarding the character. To prevent the duplicates one can edit the SeaBIOS '''src/config.h''' file and set the following:<br />
<br />
<source lang="C"><br />
#define CONFIG_SCREEN_AND_DEBUG 0<br />
</source><br />
<br />
== Adding payloads ==<br />
<br />
Most [[Payloads|payloads]] can also be launched from SeaBIOS. To add a payload, build the corresponding .elf file and then add it to the '''coreboot.rom''' file in the '''img/''' directory. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add-payload /path/to/payload.elf img/MyPayload l<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
During boot, one can press the '''F12''' key to get a boot menu. SeaBIOS will show all files in the '''img/''' directory, and one can instruct SeaBIOS to run them.<br />
<br />
Note, SeaBIOS currently supports uncompressed and LZMA compressed payloads. The nrv2b compression algorithm is not supported.<br />
<br />
== Adding a floppy image ==<br />
<br />
It is possible to embed an image of a floppy in flash. SeaBIOS can then boot from and redirect floppy BIOS calls to the flash image. This is mainly useful for legacy software (such as DOS utilities). To use this feature, place a floppy image into the CBFS directory '''floppyimg/'''. For example:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/myfloppy.img > myfloppy.img.lzma<br />
$ ./cbfs/cbfstool coreboot.rom add myfloppy.img.lzma floppyimg/MyFloppy.lzma 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
Both uncompressed and lzma compressed images are supported. Several floppy formats are available: 360K, 1.2MB, 720K, 1.44MB, 2.88MB, 160K, 180K, 320K.<br />
<br />
The floppy image will appear as writable to the system, however all writes are discarded on reboot.<br />
<br />
When using this system, SeaBIOS reserves high-memory to store the floppy. The reserved memory is then no longer available for OS use, so this feature should only be used when needed.<br />
<br />
= Trouble reporting =<br />
<br />
If you are experiencing problems with SeaBIOS, it's useful to increase the debugging level. This is done by editing the '''src/config.h''' file and setting the debug level to a higher number (for example 8):<br />
<br />
<source lang="C"><br />
#define CONFIG_DEBUG_LEVEL 8<br />
</source><br />
<br />
A debug level of 8 will show a lot of diagnostic information without flooding the serial port (levels above 8 will frequently cause too much data).<br />
<br />
To report an issue, please collect the serial boot log with SeaBIOS set to a debug level of 8 and forward the full log along with a description of the problem to the coreboot [[Mailinglist|mailing list]].</div>KevinOConnorhttps://www.coreboot.org/index.php?title=SeaBIOS&diff=9175SeaBIOS2009-12-19T17:45:37Z<p>KevinOConnor: /* Use cases */ Note USB keyboard support.</p>
<hr />
<div>'''SeaBIOS''' is an open-source legacy BIOS implementation which can be used as a coreboot [[Payloads|payload]]. It implements the standard BIOS calling interfaces that a typical x86 proprietary BIOS implements.<br />
<br />
This page describes using SeaBIOS with coreboot. SeaBIOS can also run natively in qemu and bochs - see the SeaBIOS README file for information on non-coreboot uses.<br />
<br />
= Use cases =<br />
<br />
Any software requiring 16-bit BIOS services benefits from SeaBIOS (eg, Windows and DOS). SeaBIOS also enables booting Linux out of the box (using standard boot-loaders like GRUB and Syslinux).<br />
<br />
SeaBIOS supports booting from ATA hard drives, ATAPI cdroms, payloads in flash, and from [http://en.wikipedia.org/wiki/Option_ROM Option ROMs] (eg, SCSI or network cards). SeaBIOS can initialize and use a ps2 keyboard and it has basic support for USB keyboards. SeaBIOS does not currently support booting from USB drives.<br />
<br />
== Windows ==<br />
<br />
SeaBIOS has been tested with Windows XP, Windows Vista (64/32 bit), and Windows 7 Beta (64 bit).<br />
<br />
However, Windows has a very strict ACPI interpreter, and many coreboot boards do not have a complete [[ACPI in coreboot|ACPI definition]]. As a result, many coreboot boards will fail during Windows boot (eg, it may fail with a STOP 0xA5 code).<br />
<br />
So far [[ASUS M2V-MX SE]] and [[GIGABYTE GA-M57SLI-S4]] have known good working ACPI and are able to boot XP/Vista/Windows 7. Please ask on the [[Mailinglist|mailing list]] for the status of other boards/chipsets.<br />
<br />
== Linux ==<br />
<br />
SeaBIOS has been tested with GRUB, LILO, and Syslinux. Linux booting works well.<br />
<br />
== Other ==<br />
<br />
SeaBIOS has also been tested with FreeDOS and NetBSD.<br />
<br />
Because SeaBIOS implements the standard x86 BIOS interfaces, it is expected many other operating systems and boot-loaders will work.<br />
<br />
= Building =<br />
<br />
== SeaBIOS ==<br />
<br />
One can download the latest version of SeaBIOS through a git repository:<br />
<br />
<source lang="bash"><br />
$ git clone git://git.linuxtogo.org/home/kevin/seabios.git seabios<br />
$ cd seabios<br />
</source><br />
<br />
There's also a [http://git.linuxtogo.org/?p=kevin/seabios.git;a=summary gitweb] facility to browse the latest source code online.<br />
<br />
Edit '''src/config.h''' and set the following values:<br />
<br />
<source lang="C"><br />
#define CONFIG_COREBOOT 1<br />
#define CONFIG_DEBUG_SERIAL 1<br />
#define CONFIG_OPTIONROMS_DEPLOYED 0<br />
#define CONFIG_COREBOOT_FLASH 1<br />
#define CONFIG_VGAHOOKS 1<br />
</source><br />
<br />
Then:<br />
<br />
<source lang="bash"><br />
$ make<br />
</source><br />
<br />
The final SeaBIOS payload file is '''out/bios.bin.elf''', which can be used with coreboot v2 or v3.<br />
<br />
=== Compiled SeaBIOS images ===<br />
<br />
It is also possible to download a compiled SeaBIOS image. The latest released version compiled for coreboot is: http://linuxtogo.org/~kevin/SeaBIOS/bios.bin.elf-0.5.0<br />
<br />
Other versions are also available at: http://linuxtogo.org/~kevin/SeaBIOS/<br />
<br />
== coreboot ==<br />
<br />
For best results, use coreboot-v2 and edit the '''targets/..../Config.lb''' with the following:<br />
<br />
option CONFIG_CBFS = 1<br />
option HAVE_HIGH_TABLES = 1<br />
...<br />
romimage "fallback"<br />
...<br />
payload /path/to/seabios/out/bios.bin.elf<br />
end<br />
<br />
Unfortunately, many boards don't have HAVE_HIGH_TABLES support, yet. If the build fails complaining about this option, one can edit the '''src/mainboard/<vendor>/<board>/Options.lb''' file and add a "uses HAVE_HIGH_TABLES" line. Then one can edit '''src/arch/i386/boot/tables.c''' and change the lines:<br />
<br />
<source lang="C"><br />
uint64_t high_tables_base = 0;<br />
uint64_t high_tables_size;<br />
</source><br />
<br />
to:<br />
<br />
<source lang="C"><br />
uint64_t high_tables_base = ( <memorysize> ) * 1024 * 1024 - (64 * 1024);<br />
uint64_t high_tables_size = 64 * 1024;<br />
</source><br />
<br />
where <memorysize> is the amount of memory (in MiB) available on the target machine, but '''not more than 3072'''. So, if there is more than 3GiB of RAM installed, put 3072. Otherwise, put the number of MiB of RAM installed in the machine.<br />
<br />
Alternatively, one can add proper support for HAVE_HIGH_TABLES.<br />
<br />
Once the above is done, the final image will be in '''coreboot.rom'''.<br />
<br />
= SeaBIOS and CBFS =<br />
<br />
SeaBIOS can read the coreboot flash filesystem and extract option ROMs and payloads.<br />
<br />
When SeaBIOS scans the target machine's PCI devices, it will recognize option ROMs in CBFS that have the form '''pciVVVV,DDDD.rom'''. It will also run any file in the directory '''vgaroms/''' as a vga option ROM not specific to a device and files in '''genroms/''' as a generic option ROM not specific to a device. In the above cases, SeaBIOS will recognize files with a '''.lzma''' suffix, and automatically decompress them (eg, '''pci1106,3344.rom.lzma''' and '''vgaroms/sgabios.bin.lzma''').<br />
<br />
SeaBIOS will also load payloads found in the CBFS directory '''img/''' and floppy images found in the '''floppyimg/''' directory.<br />
<br />
The examples below show some common uses of this feature.<br />
<br />
== Adding a VGA option ROM ==<br />
<br />
It is frequently necessary to add a VGA option ROM to CBFS in order to use a VGA adapter that is built-in to a motherboard. Note, VGA adapters on external cards do not require this step as SeaBIOS will automatically extract the VGA bios directly from the card.<br />
<br />
The first step is to find the vendor and device ID of the built-in VGA adapter. This information can be found from '''lspci''':<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
01:00.0 VGA compatible controller [0300]: VIA Technologies, Inc. UniChrome Pro IGP [1106:3344] (rev 01) (prog-if 00 [VGA controller])<br />
</source><br />
<br />
In the above example, the VGA vendor/device ID is '''1106:3344'''. [[VGA support#How_to_retrieve_a_good_video_bios|Obtain the VGA ROM]] (eg, '''vgabios.bin''') and add it to the ROM with:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add /path/to/vgabios.bin pci1106,3344.rom 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
Alternatively, SeaBIOS supports LZMA compressed option ROMs. Use the following to add a compressed option ROM instead:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/vgabios.bin > vgabios.bin.lzma<br />
$ ./cbfs/cbfstool coreboot.rom add vgabios.bin.lzma pci1106,3344.rom.lzma 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
After the above is done, one can write the coreboot.rom file to flash. SeaBIOS will extract the VGA ROM and run it during boot.<br />
<br />
== Adding gpxe support ==<br />
<br />
A [[GPXE|gpxe]] option ROM can nicely complement SeaBIOS and coreboot by adding network boot support. Adding gpxe is similar to [[#Adding a VGA option ROM]]. The first step is to find the Ethernet vendor/device ID. For example:<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
00:09.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet [10ec:8167] (rev 10)<br />
</source><br />
<br />
Then one can build a gpxe option ROM. For example:<br />
<br />
<source lang="bash"><br />
$ cd /path/to/gpxe/src/<br />
$ make bin/10ec8167.rom<br />
</source><br />
<br />
And add it to the coreboot image. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add /path/to/gpxe/src/bin/10ec8167.rom pci10ec,8167.rom 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
As with VGA option ROMs, the gpxe option ROM may be compressed with LZMA. However, compression won't significantly reduce gpxe's size as it implements its own compression.<br />
<br />
In addition to gpxe, other option ROMs can be added in the same manor.<br />
<br />
== Adding sgabios support ==<br />
<br />
An [http://code.google.com/p/sgabios/ sgabios] option ROM can forward some VGA BIOS requests over a serial port.<br />
<br />
Unfortunately, the current version of sgabios (as of 20090617) does not implement a proper checksum. As a work around, a tool from the seabios source repo can fix the checksum:<br />
<source lang="bash"><br />
$ /path/to/seabios/tools/buildrom.py /path/to/sgabios.bin sgabios-fixed.bin<br />
</source><br />
<br />
Once the above is done, place the ROM file in the '''vgaroms/''' directory of CBFS. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add sgabios-fixed.bin vgaroms/sgabios.bin 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
When using sgabios, all the characters that SeaBIOS writes to the screen will be seen twice - once from SeaBIOS sending the character to the serial port and once from sgabios forwarding the character. To prevent the duplicates one can edit the SeaBIOS '''src/config.h''' file and set the following:<br />
<br />
<source lang="C"><br />
#define CONFIG_SCREEN_AND_DEBUG 0<br />
</source><br />
<br />
== Adding payloads ==<br />
<br />
Most [[Payloads|payloads]] can also be launched from SeaBIOS. To add a payload, build the corresponding .elf file and then add it to the '''coreboot.rom''' file in the '''img/''' directory. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add-payload /path/to/payload.elf img/MyPayload l<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
During boot, one can press the '''F12''' key to get a boot menu. SeaBIOS will show all files in the '''img/''' directory, and one can instruct SeaBIOS to run them.<br />
<br />
Note, SeaBIOS currently supports uncompressed and LZMA compressed payloads. The nrv2b compression algorithm is not supported.<br />
<br />
== Adding a floppy image ==<br />
<br />
It is possible to embed an image of a floppy in flash. SeaBIOS can then boot from and redirect floppy BIOS calls to the flash image. This is mainly useful for legacy software (such as DOS utilities). To use this feature, place a floppy image into the CBFS directory '''floppyimg/'''. For example:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/myfloppy.img > myfloppy.img.lzma<br />
$ ./cbfs/cbfstool coreboot.rom add myfloppy.img.lzma floppyimg/MyFloppy.lzma 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
Both uncompressed and lzma compressed images are supported. Several floppy formats are available: 360K, 1.2MB, 720K, 1.44MB, 2.88MB, 160K, 180K, 320K.<br />
<br />
The floppy image will appear as writable to the system, however all writes are discarded on reboot.<br />
<br />
When using this system, SeaBIOS reserves high-memory to store the floppy. The reserved memory is then no longer available for OS use, so this feature should only be used when needed.<br />
<br />
= Trouble reporting =<br />
<br />
If you are experiencing problems with SeaBIOS, it's useful to increase the debugging level. This is done by editing the '''src/config.h''' file and setting the debug level to a higher number (for example 8):<br />
<br />
<source lang="C"><br />
#define CONFIG_DEBUG_LEVEL 8<br />
</source><br />
<br />
A debug level of 8 will show a lot of diagnostic information without flooding the serial port (levels above 8 will frequently cause too much data).<br />
<br />
To report an issue, please collect the serial boot log with SeaBIOS set to a debug level of 8 and forward the full log along with a description of the problem to the coreboot [[Mailinglist|mailing list]].</div>KevinOConnorhttps://www.coreboot.org/index.php?title=SeaBIOS&diff=9174SeaBIOS2009-12-19T17:29:41Z<p>KevinOConnor: /* Compiled SeaBIOS images */ Note new version</p>
<hr />
<div>'''SeaBIOS''' is an open-source legacy BIOS implementation which can be used as a coreboot [[Payloads|payload]]. It implements the standard BIOS calling interfaces that a typical x86 proprietary BIOS implements.<br />
<br />
This page describes using SeaBIOS with coreboot. SeaBIOS can also run natively in qemu and bochs - see the SeaBIOS README file for information on non-coreboot uses.<br />
<br />
= Use cases =<br />
<br />
Any software requiring 16-bit BIOS services benefits from SeaBIOS (eg, Windows and DOS). SeaBIOS also enables booting Linux out of the box (using standard boot-loaders like GRUB and Syslinux).<br />
<br />
SeaBIOS supports booting from ATA hard drives, ATAPI cdroms, payloads in flash, and from [http://en.wikipedia.org/wiki/Option_ROM Option ROMs] (eg, SCSI or network cards). SeaBIOS can initialize and use a ps2 keyboard. SeaBIOS does not currently support booting from USB drives or using USB keyboards.<br />
<br />
== Windows ==<br />
<br />
SeaBIOS has been tested with Windows XP, Windows Vista (64/32 bit), and Windows 7 Beta (64 bit).<br />
<br />
However, Windows has a very strict ACPI interpreter, and many coreboot boards do not have a complete [[ACPI in coreboot|ACPI definition]]. As a result, many coreboot boards will fail during Windows boot (eg, it may fail with a STOP 0xA5 code).<br />
<br />
So far [[ASUS M2V-MX SE]] and [[GIGABYTE GA-M57SLI-S4]] have known good working ACPI and are able to boot XP/Vista/Windows 7. Please ask on the [[Mailinglist|mailing list]] for the status of other boards/chipsets.<br />
<br />
== Linux ==<br />
<br />
SeaBIOS has been tested with GRUB, LILO, and Syslinux. Linux booting works well.<br />
<br />
== Other ==<br />
<br />
SeaBIOS has also been tested with FreeDOS and NetBSD.<br />
<br />
Because SeaBIOS implements the standard x86 BIOS interfaces, it is expected many other operating systems and boot-loaders will work.<br />
<br />
= Building =<br />
<br />
== SeaBIOS ==<br />
<br />
One can download the latest version of SeaBIOS through a git repository:<br />
<br />
<source lang="bash"><br />
$ git clone git://git.linuxtogo.org/home/kevin/seabios.git seabios<br />
$ cd seabios<br />
</source><br />
<br />
There's also a [http://git.linuxtogo.org/?p=kevin/seabios.git;a=summary gitweb] facility to browse the latest source code online.<br />
<br />
Edit '''src/config.h''' and set the following values:<br />
<br />
<source lang="C"><br />
#define CONFIG_COREBOOT 1<br />
#define CONFIG_DEBUG_SERIAL 1<br />
#define CONFIG_OPTIONROMS_DEPLOYED 0<br />
#define CONFIG_COREBOOT_FLASH 1<br />
#define CONFIG_VGAHOOKS 1<br />
</source><br />
<br />
Then:<br />
<br />
<source lang="bash"><br />
$ make<br />
</source><br />
<br />
The final SeaBIOS payload file is '''out/bios.bin.elf''', which can be used with coreboot v2 or v3.<br />
<br />
=== Compiled SeaBIOS images ===<br />
<br />
It is also possible to download a compiled SeaBIOS image. The latest released version compiled for coreboot is: http://linuxtogo.org/~kevin/SeaBIOS/bios.bin.elf-0.5.0<br />
<br />
Other versions are also available at: http://linuxtogo.org/~kevin/SeaBIOS/<br />
<br />
== coreboot ==<br />
<br />
For best results, use coreboot-v2 and edit the '''targets/..../Config.lb''' with the following:<br />
<br />
option CONFIG_CBFS = 1<br />
option HAVE_HIGH_TABLES = 1<br />
...<br />
romimage "fallback"<br />
...<br />
payload /path/to/seabios/out/bios.bin.elf<br />
end<br />
<br />
Unfortunately, many boards don't have HAVE_HIGH_TABLES support, yet. If the build fails complaining about this option, one can edit the '''src/mainboard/<vendor>/<board>/Options.lb''' file and add a "uses HAVE_HIGH_TABLES" line. Then one can edit '''src/arch/i386/boot/tables.c''' and change the lines:<br />
<br />
<source lang="C"><br />
uint64_t high_tables_base = 0;<br />
uint64_t high_tables_size;<br />
</source><br />
<br />
to:<br />
<br />
<source lang="C"><br />
uint64_t high_tables_base = ( <memorysize> ) * 1024 * 1024 - (64 * 1024);<br />
uint64_t high_tables_size = 64 * 1024;<br />
</source><br />
<br />
where <memorysize> is the amount of memory (in MiB) available on the target machine, but '''not more than 3072'''. So, if there is more than 3GiB of RAM installed, put 3072. Otherwise, put the number of MiB of RAM installed in the machine.<br />
<br />
Alternatively, one can add proper support for HAVE_HIGH_TABLES.<br />
<br />
Once the above is done, the final image will be in '''coreboot.rom'''.<br />
<br />
= SeaBIOS and CBFS =<br />
<br />
SeaBIOS can read the coreboot flash filesystem and extract option ROMs and payloads.<br />
<br />
When SeaBIOS scans the target machine's PCI devices, it will recognize option ROMs in CBFS that have the form '''pciVVVV,DDDD.rom'''. It will also run any file in the directory '''vgaroms/''' as a vga option ROM not specific to a device and files in '''genroms/''' as a generic option ROM not specific to a device. In the above cases, SeaBIOS will recognize files with a '''.lzma''' suffix, and automatically decompress them (eg, '''pci1106,3344.rom.lzma''' and '''vgaroms/sgabios.bin.lzma''').<br />
<br />
SeaBIOS will also load payloads found in the CBFS directory '''img/''' and floppy images found in the '''floppyimg/''' directory.<br />
<br />
The examples below show some common uses of this feature.<br />
<br />
== Adding a VGA option ROM ==<br />
<br />
It is frequently necessary to add a VGA option ROM to CBFS in order to use a VGA adapter that is built-in to a motherboard. Note, VGA adapters on external cards do not require this step as SeaBIOS will automatically extract the VGA bios directly from the card.<br />
<br />
The first step is to find the vendor and device ID of the built-in VGA adapter. This information can be found from '''lspci''':<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
01:00.0 VGA compatible controller [0300]: VIA Technologies, Inc. UniChrome Pro IGP [1106:3344] (rev 01) (prog-if 00 [VGA controller])<br />
</source><br />
<br />
In the above example, the VGA vendor/device ID is '''1106:3344'''. [[VGA support#How_to_retrieve_a_good_video_bios|Obtain the VGA ROM]] (eg, '''vgabios.bin''') and add it to the ROM with:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add /path/to/vgabios.bin pci1106,3344.rom 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
Alternatively, SeaBIOS supports LZMA compressed option ROMs. Use the following to add a compressed option ROM instead:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/vgabios.bin > vgabios.bin.lzma<br />
$ ./cbfs/cbfstool coreboot.rom add vgabios.bin.lzma pci1106,3344.rom.lzma 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
After the above is done, one can write the coreboot.rom file to flash. SeaBIOS will extract the VGA ROM and run it during boot.<br />
<br />
== Adding gpxe support ==<br />
<br />
A [[GPXE|gpxe]] option ROM can nicely complement SeaBIOS and coreboot by adding network boot support. Adding gpxe is similar to [[#Adding a VGA option ROM]]. The first step is to find the Ethernet vendor/device ID. For example:<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
00:09.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet [10ec:8167] (rev 10)<br />
</source><br />
<br />
Then one can build a gpxe option ROM. For example:<br />
<br />
<source lang="bash"><br />
$ cd /path/to/gpxe/src/<br />
$ make bin/10ec8167.rom<br />
</source><br />
<br />
And add it to the coreboot image. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add /path/to/gpxe/src/bin/10ec8167.rom pci10ec,8167.rom 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
As with VGA option ROMs, the gpxe option ROM may be compressed with LZMA. However, compression won't significantly reduce gpxe's size as it implements its own compression.<br />
<br />
In addition to gpxe, other option ROMs can be added in the same manor.<br />
<br />
== Adding sgabios support ==<br />
<br />
An [http://code.google.com/p/sgabios/ sgabios] option ROM can forward some VGA BIOS requests over a serial port.<br />
<br />
Unfortunately, the current version of sgabios (as of 20090617) does not implement a proper checksum. As a work around, a tool from the seabios source repo can fix the checksum:<br />
<source lang="bash"><br />
$ /path/to/seabios/tools/buildrom.py /path/to/sgabios.bin sgabios-fixed.bin<br />
</source><br />
<br />
Once the above is done, place the ROM file in the '''vgaroms/''' directory of CBFS. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add sgabios-fixed.bin vgaroms/sgabios.bin 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
When using sgabios, all the characters that SeaBIOS writes to the screen will be seen twice - once from SeaBIOS sending the character to the serial port and once from sgabios forwarding the character. To prevent the duplicates one can edit the SeaBIOS '''src/config.h''' file and set the following:<br />
<br />
<source lang="C"><br />
#define CONFIG_SCREEN_AND_DEBUG 0<br />
</source><br />
<br />
== Adding payloads ==<br />
<br />
Most [[Payloads|payloads]] can also be launched from SeaBIOS. To add a payload, build the corresponding .elf file and then add it to the '''coreboot.rom''' file in the '''img/''' directory. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add-payload /path/to/payload.elf img/MyPayload l<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
During boot, one can press the '''F12''' key to get a boot menu. SeaBIOS will show all files in the '''img/''' directory, and one can instruct SeaBIOS to run them.<br />
<br />
Note, SeaBIOS currently supports uncompressed and LZMA compressed payloads. The nrv2b compression algorithm is not supported.<br />
<br />
== Adding a floppy image ==<br />
<br />
It is possible to embed an image of a floppy in flash. SeaBIOS can then boot from and redirect floppy BIOS calls to the flash image. This is mainly useful for legacy software (such as DOS utilities). To use this feature, place a floppy image into the CBFS directory '''floppyimg/'''. For example:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/myfloppy.img > myfloppy.img.lzma<br />
$ ./cbfs/cbfstool coreboot.rom add myfloppy.img.lzma floppyimg/MyFloppy.lzma 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
Both uncompressed and lzma compressed images are supported. Several floppy formats are available: 360K, 1.2MB, 720K, 1.44MB, 2.88MB, 160K, 180K, 320K.<br />
<br />
The floppy image will appear as writable to the system, however all writes are discarded on reboot.<br />
<br />
When using this system, SeaBIOS reserves high-memory to store the floppy. The reserved memory is then no longer available for OS use, so this feature should only be used when needed.<br />
<br />
= Trouble reporting =<br />
<br />
If you are experiencing problems with SeaBIOS, it's useful to increase the debugging level. This is done by editing the '''src/config.h''' file and setting the debug level to a higher number (for example 8):<br />
<br />
<source lang="C"><br />
#define CONFIG_DEBUG_LEVEL 8<br />
</source><br />
<br />
A debug level of 8 will show a lot of diagnostic information without flooding the serial port (levels above 8 will frequently cause too much data).<br />
<br />
To report an issue, please collect the serial boot log with SeaBIOS set to a debug level of 8 and forward the full log along with a description of the problem to the coreboot [[Mailinglist|mailing list]].</div>KevinOConnorhttps://www.coreboot.org/index.php?title=SeaBIOS&diff=9070SeaBIOS2009-10-22T00:38:58Z<p>KevinOConnor: Add section on trouble reporting</p>
<hr />
<div>'''SeaBIOS''' is an open-source legacy BIOS implementation which can be used as a coreboot [[Payloads|payload]]. It implements the standard BIOS calling interfaces that a typical x86 proprietary BIOS implements.<br />
<br />
This page describes using SeaBIOS with coreboot. SeaBIOS can also run natively in qemu and bochs - see the SeaBIOS README file for information on non-coreboot uses.<br />
<br />
= Use cases =<br />
<br />
Any software requiring 16-bit BIOS services benefits from SeaBIOS (eg, Windows and DOS). SeaBIOS also enables booting Linux out of the box (using standard boot-loaders like GRUB and Syslinux).<br />
<br />
SeaBIOS supports booting from ATA hard drives, ATAPI cdroms, payloads in flash, and from [http://en.wikipedia.org/wiki/Option_ROM Option ROMs] (eg, SCSI or network cards). SeaBIOS can initialize and use a ps2 keyboard. SeaBIOS does not currently support booting from USB drives or using USB keyboards.<br />
<br />
== Windows ==<br />
<br />
SeaBIOS has been tested with Windows XP, Windows Vista (64/32 bit), and Windows 7 Beta (64 bit).<br />
<br />
However, Windows has a very strict ACPI interpreter, and many coreboot boards do not have a complete [[ACPI in coreboot|ACPI definition]]. As a result, many coreboot boards will fail during Windows boot (eg, it may fail with a STOP 0xA5 code).<br />
<br />
So far [[ASUS M2V-MX SE]] and [[GIGABYTE GA-M57SLI-S4]] have known good working ACPI and are able to boot XP/Vista/Windows 7. Please ask on the [[Mailinglist|mailing list]] for the status of other boards/chipsets.<br />
<br />
== Linux ==<br />
<br />
SeaBIOS has been tested with GRUB, LILO, and Syslinux. Linux booting works well.<br />
<br />
== Other ==<br />
<br />
SeaBIOS has also been tested with FreeDOS and NetBSD.<br />
<br />
Because SeaBIOS implements the standard x86 BIOS interfaces, it is expected many other operating systems and boot-loaders will work.<br />
<br />
= Building =<br />
<br />
== SeaBIOS ==<br />
<br />
One can download the latest version of SeaBIOS through a git repository:<br />
<br />
<source lang="bash"><br />
$ git clone git://git.linuxtogo.org/home/kevin/seabios.git seabios<br />
$ cd seabios<br />
</source><br />
<br />
There's also a [http://git.linuxtogo.org/?p=kevin/seabios.git;a=summary gitweb] facility to browse the latest source code online.<br />
<br />
Edit '''src/config.h''' and set the following values:<br />
<br />
<source lang="C"><br />
#define CONFIG_COREBOOT 1<br />
#define CONFIG_DEBUG_SERIAL 1<br />
#define CONFIG_OPTIONROMS_DEPLOYED 0<br />
#define CONFIG_COREBOOT_FLASH 1<br />
#define CONFIG_VGAHOOKS 1<br />
</source><br />
<br />
Then:<br />
<br />
<source lang="bash"><br />
$ make<br />
</source><br />
<br />
The final SeaBIOS payload file is '''out/bios.bin.elf''', which can be used with coreboot v2 or v3.<br />
<br />
=== Compiled SeaBIOS images ===<br />
<br />
It is also possible to download a compiled SeaBIOS image. The latest released version compiled for coreboot is: http://linuxtogo.org/~kevin/SeaBIOS/bios.bin.elf-0.4.2<br />
<br />
Other versions are also available at: http://linuxtogo.org/~kevin/SeaBIOS/<br />
<br />
== coreboot ==<br />
<br />
For best results, use coreboot-v2 and edit the '''targets/..../Config.lb''' with the following:<br />
<br />
option CONFIG_CBFS = 1<br />
option HAVE_HIGH_TABLES = 1<br />
...<br />
romimage "fallback"<br />
...<br />
payload /path/to/seabios/out/bios.bin.elf<br />
end<br />
<br />
Unfortunately, many boards don't have HAVE_HIGH_TABLES support, yet. If the build fails complaining about this option, one can edit the '''src/mainboard/<vendor>/<board>/Options.lb''' file and add a "uses HAVE_HIGH_TABLES" line. Then one can edit '''src/arch/i386/boot/tables.c''' and change the lines:<br />
<br />
<source lang="C"><br />
uint64_t high_tables_base = 0;<br />
uint64_t high_tables_size;<br />
</source><br />
<br />
to:<br />
<br />
<source lang="C"><br />
uint64_t high_tables_base = ( <memorysize> ) * 1024 * 1024 - (64 * 1024);<br />
uint64_t high_tables_size = 64 * 1024;<br />
</source><br />
<br />
where <memorysize> is the amount of memory (in MiB) available on the target machine, but '''not more than 3072'''. So, if there is more than 3GiB of RAM installed, put 3072. Otherwise, put the number of MiB of RAM installed in the machine.<br />
<br />
Alternatively, one can add proper support for HAVE_HIGH_TABLES.<br />
<br />
Once the above is done, the final image will be in '''coreboot.rom'''.<br />
<br />
= SeaBIOS and CBFS =<br />
<br />
SeaBIOS can read the coreboot flash filesystem and extract option ROMs and payloads.<br />
<br />
When SeaBIOS scans the target machine's PCI devices, it will recognize option ROMs in CBFS that have the form '''pciVVVV,DDDD.rom'''. It will also run any file in the directory '''vgaroms/''' as a vga option ROM not specific to a device and files in '''genroms/''' as a generic option ROM not specific to a device. In the above cases, SeaBIOS will recognize files with a '''.lzma''' suffix, and automatically decompress them (eg, '''pci1106,3344.rom.lzma''' and '''vgaroms/sgabios.bin.lzma''').<br />
<br />
SeaBIOS will also load payloads found in the CBFS directory '''img/''' and floppy images found in the '''floppyimg/''' directory.<br />
<br />
The examples below show some common uses of this feature.<br />
<br />
== Adding a VGA option ROM ==<br />
<br />
It is frequently necessary to add a VGA option ROM to CBFS in order to use a VGA adapter that is built-in to a motherboard. Note, VGA adapters on external cards do not require this step as SeaBIOS will automatically extract the VGA bios directly from the card.<br />
<br />
The first step is to find the vendor and device ID of the built-in VGA adapter. This information can be found from '''lspci''':<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
01:00.0 VGA compatible controller [0300]: VIA Technologies, Inc. UniChrome Pro IGP [1106:3344] (rev 01) (prog-if 00 [VGA controller])<br />
</source><br />
<br />
In the above example, the VGA vendor/device ID is '''1106:3344'''. [[VGA support#How_to_retrieve_a_good_video_bios|Obtain the VGA ROM]] (eg, '''vgabios.bin''') and add it to the ROM with:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add /path/to/vgabios.bin pci1106,3344.rom 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
Alternatively, SeaBIOS supports LZMA compressed option ROMs. Use the following to add a compressed option ROM instead:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/vgabios.bin > vgabios.bin.lzma<br />
$ ./cbfs/cbfstool coreboot.rom add vgabios.bin.lzma pci1106,3344.rom.lzma 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
After the above is done, one can write the coreboot.rom file to flash. SeaBIOS will extract the VGA ROM and run it during boot.<br />
<br />
== Adding gpxe support ==<br />
<br />
A [[GPXE|gpxe]] option ROM can nicely complement SeaBIOS and coreboot by adding network boot support. Adding gpxe is similar to [[#Adding a VGA option ROM]]. The first step is to find the Ethernet vendor/device ID. For example:<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
00:09.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet [10ec:8167] (rev 10)<br />
</source><br />
<br />
Then one can build a gpxe option ROM. For example:<br />
<br />
<source lang="bash"><br />
$ cd /path/to/gpxe/src/<br />
$ make bin/10ec8167.rom<br />
</source><br />
<br />
And add it to the coreboot image. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add /path/to/gpxe/src/bin/10ec8167.rom pci10ec,8167.rom 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
As with VGA option ROMs, the gpxe option ROM may be compressed with LZMA. However, compression won't significantly reduce gpxe's size as it implements its own compression.<br />
<br />
In addition to gpxe, other option ROMs can be added in the same manor.<br />
<br />
== Adding sgabios support ==<br />
<br />
An [http://code.google.com/p/sgabios/ sgabios] option ROM can forward some VGA BIOS requests over a serial port.<br />
<br />
Unfortunately, the current version of sgabios (as of 20090617) does not implement a proper checksum. As a work around, a tool from the seabios source repo can fix the checksum:<br />
<source lang="bash"><br />
$ /path/to/seabios/tools/buildrom.py /path/to/sgabios.bin sgabios-fixed.bin<br />
</source><br />
<br />
Once the above is done, place the ROM file in the '''vgaroms/''' directory of CBFS. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add sgabios-fixed.bin vgaroms/sgabios.bin 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
When using sgabios, all the characters that SeaBIOS writes to the screen will be seen twice - once from SeaBIOS sending the character to the serial port and once from sgabios forwarding the character. To prevent the duplicates one can edit the SeaBIOS '''src/config.h''' file and set the following:<br />
<br />
<source lang="C"><br />
#define CONFIG_SCREEN_AND_DEBUG 0<br />
</source><br />
<br />
== Adding payloads ==<br />
<br />
Most [[Payloads|payloads]] can also be launched from SeaBIOS. To add a payload, build the corresponding .elf file and then add it to the '''coreboot.rom''' file in the '''img/''' directory. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add-payload /path/to/payload.elf img/MyPayload l<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
During boot, one can press the '''F12''' key to get a boot menu. SeaBIOS will show all files in the '''img/''' directory, and one can instruct SeaBIOS to run them.<br />
<br />
Note, SeaBIOS currently supports uncompressed and LZMA compressed payloads. The nrv2b compression algorithm is not supported.<br />
<br />
== Adding a floppy image ==<br />
<br />
It is possible to embed an image of a floppy in flash. SeaBIOS can then boot from and redirect floppy BIOS calls to the flash image. This is mainly useful for legacy software (such as DOS utilities). To use this feature, place a floppy image into the CBFS directory '''floppyimg/'''. For example:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/myfloppy.img > myfloppy.img.lzma<br />
$ ./cbfs/cbfstool coreboot.rom add myfloppy.img.lzma floppyimg/MyFloppy.lzma 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
Both uncompressed and lzma compressed images are supported. Several floppy formats are available: 360K, 1.2MB, 720K, 1.44MB, 2.88MB, 160K, 180K, 320K.<br />
<br />
The floppy image will appear as writable to the system, however all writes are discarded on reboot.<br />
<br />
When using this system, SeaBIOS reserves high-memory to store the floppy. The reserved memory is then no longer available for OS use, so this feature should only be used when needed.<br />
<br />
= Trouble reporting =<br />
<br />
If you are experiencing problems with SeaBIOS, it's useful to increase the debugging level. This is done by editing the '''src/config.h''' file and setting the debug level to a higher number (for example 8):<br />
<br />
<source lang="C"><br />
#define CONFIG_DEBUG_LEVEL 8<br />
</source><br />
<br />
A debug level of 8 will show a lot of diagnostic information without flooding the serial port (levels above 8 will frequently cause too much data).<br />
<br />
To report an issue, please collect the serial boot log with SeaBIOS set to a debug level of 8 and forward the full log along with a description of the problem to the coreboot [[Mailinglist|mailing list]].</div>KevinOConnorhttps://www.coreboot.org/index.php?title=SeaBIOS&diff=8946SeaBIOS2009-09-09T00:39:51Z<p>KevinOConnor: /* Use cases */ Add wikipedia link for option roms.</p>
<hr />
<div>'''SeaBIOS''' is an open-source legacy BIOS implementation which can be used as a coreboot [[Payloads|payload]]. It implements the standard BIOS calling interfaces that a typical x86 proprietary BIOS implements.<br />
<br />
This page describes using SeaBIOS with coreboot. SeaBIOS can also run natively in qemu and bochs - see the SeaBIOS README file for information on non-coreboot uses.<br />
<br />
= Use cases =<br />
<br />
Any software requiring 16-bit BIOS services benefits from SeaBIOS (eg, Windows and DOS). SeaBIOS also enables booting Linux out of the box (using standard boot-loaders like GRUB and Syslinux).<br />
<br />
SeaBIOS supports booting from ATA hard drives, ATAPI cdroms, payloads in flash, and from [http://en.wikipedia.org/wiki/Option_ROM Option ROMs] (eg, SCSI or network cards). SeaBIOS can initialize and use a ps2 keyboard. SeaBIOS does not currently support booting from USB drives or using USB keyboards.<br />
<br />
== Windows ==<br />
<br />
SeaBIOS has been tested with Windows XP, Windows Vista (64/32 bit), and Windows 7 Beta (64 bit).<br />
<br />
However, Windows has a very strict ACPI interpreter, and many coreboot boards do not have a complete [[ACPI in coreboot|ACPI definition]]. As a result, many coreboot boards will fail during Windows boot (eg, it may fail with a STOP 0xA5 code).<br />
<br />
So far [[ASUS M2V-MX SE]] and [[GIGABYTE GA-M57SLI-S4]] have known good working ACPI and are able to boot XP/Vista/Windows 7. Please ask on the [[Mailinglist|mailing list]] for the status of other boards/chipsets.<br />
<br />
== Linux ==<br />
<br />
SeaBIOS has been tested with GRUB, LILO, and Syslinux. Linux booting works well.<br />
<br />
== Other ==<br />
<br />
SeaBIOS has also been tested with FreeDOS and NetBSD.<br />
<br />
Because SeaBIOS implements the standard x86 BIOS interfaces, it is expected many other operating systems and boot-loaders will work.<br />
<br />
= Building =<br />
<br />
== SeaBIOS ==<br />
<br />
One can download the latest version of SeaBIOS through a git repository:<br />
<br />
<source lang="bash"><br />
$ git clone git://git.linuxtogo.org/home/kevin/seabios.git seabios<br />
$ cd seabios<br />
</source><br />
<br />
There's also a [http://git.linuxtogo.org/?p=kevin/seabios.git;a=summary gitweb] facility to browse the latest source code online.<br />
<br />
Edit '''src/config.h''' and set the following values:<br />
<br />
<source lang="C"><br />
#define CONFIG_COREBOOT 1<br />
#define CONFIG_DEBUG_SERIAL 1<br />
#define CONFIG_OPTIONROMS_DEPLOYED 0<br />
#define CONFIG_COREBOOT_FLASH 1<br />
#define CONFIG_VGAHOOKS 1<br />
</source><br />
<br />
Then:<br />
<br />
<source lang="bash"><br />
$ make<br />
</source><br />
<br />
The final SeaBIOS payload file is '''out/bios.bin.elf''', which can be used with coreboot v2 or v3.<br />
<br />
=== Compiled SeaBIOS images ===<br />
<br />
It is also possible to download a compiled SeaBIOS image. The latest released version compiled for coreboot is: http://linuxtogo.org/~kevin/SeaBIOS/bios.bin.elf-0.4.2<br />
<br />
Other versions are also available at: http://linuxtogo.org/~kevin/SeaBIOS/<br />
<br />
== coreboot ==<br />
<br />
For best results, use coreboot-v2 and edit the '''targets/..../Config.lb''' with the following:<br />
<br />
option CONFIG_CBFS = 1<br />
option HAVE_HIGH_TABLES = 1<br />
...<br />
romimage "fallback"<br />
...<br />
payload /path/to/seabios/out/bios.bin.elf<br />
end<br />
<br />
Unfortunately, many boards don't have HAVE_HIGH_TABLES support, yet. If the build fails complaining about this option, one can edit the '''src/mainboard/<vendor>/<board>/Options.lb''' file and add a "uses HAVE_HIGH_TABLES" line. Then one can edit '''src/arch/i386/boot/tables.c''' and change the lines:<br />
<br />
<source lang="C"><br />
uint64_t high_tables_base = 0;<br />
uint64_t high_tables_size;<br />
</source><br />
<br />
to:<br />
<br />
<source lang="C"><br />
uint64_t high_tables_base = ( <memorysize> ) * 1024 * 1024 - (64 * 1024);<br />
uint64_t high_tables_size = 64 * 1024;<br />
</source><br />
<br />
where <memorysize> is the amount of memory (in MiB) available on the target machine, but '''not more than 3072'''. So, if there is more than 3GiB of RAM installed, put 3072. Otherwise, put the number of MiB of RAM installed in the machine.<br />
<br />
Alternatively, one can add proper support for HAVE_HIGH_TABLES.<br />
<br />
Once the above is done, the final image will be in '''coreboot.rom'''.<br />
<br />
= SeaBIOS and CBFS =<br />
<br />
SeaBIOS can read the coreboot flash filesystem and extract option ROMs and payloads.<br />
<br />
When SeaBIOS scans the target machine's PCI devices, it will recognize option ROMs in CBFS that have the form '''pciVVVV,DDDD.rom'''. It will also run any file in the directory '''vgaroms/''' as a vga option ROM not specific to a device and files in '''genroms/''' as a generic option ROM not specific to a device. In the above cases, SeaBIOS will recognize files with a '''.lzma''' suffix, and automatically decompress them (eg, '''pci1106,3344.rom.lzma''' and '''vgaroms/sgabios.bin.lzma''').<br />
<br />
SeaBIOS will also load payloads found in the CBFS directory '''img/''' and floppy images found in the '''floppyimg/''' directory.<br />
<br />
The examples below show some common uses of this feature.<br />
<br />
== Adding a VGA option ROM ==<br />
<br />
It is frequently necessary to add a VGA option ROM to CBFS in order to use a VGA adapter that is built-in to a motherboard. Note, VGA adapters on external cards do not require this step as SeaBIOS will automatically extract the VGA bios directly from the card.<br />
<br />
The first step is to find the vendor and device ID of the built-in VGA adapter. This information can be found from '''lspci''':<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
01:00.0 VGA compatible controller [0300]: VIA Technologies, Inc. UniChrome Pro IGP [1106:3344] (rev 01) (prog-if 00 [VGA controller])<br />
</source><br />
<br />
In the above example, the VGA vendor/device ID is '''1106:3344'''. [[VGA support#How_to_retrieve_a_good_video_bios|Obtain the VGA ROM]] (eg, '''vgabios.bin''') and add it to the ROM with:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add /path/to/vgabios.bin pci1106,3344.rom 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
Alternatively, SeaBIOS supports LZMA compressed option ROMs. Use the following to add a compressed option ROM instead:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/vgabios.bin > vgabios.bin.lzma<br />
$ ./cbfs/cbfstool coreboot.rom add vgabios.bin.lzma pci1106,3344.rom.lzma 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
After the above is done, one can write the coreboot.rom file to flash. SeaBIOS will extract the VGA ROM and run it during boot.<br />
<br />
== Adding gpxe support ==<br />
<br />
A [[GPXE|gpxe]] option ROM can nicely complement SeaBIOS and coreboot by adding network boot support. Adding gpxe is similar to [[#Adding a VGA option ROM]]. The first step is to find the Ethernet vendor/device ID. For example:<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
00:09.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet [10ec:8167] (rev 10)<br />
</source><br />
<br />
Then one can build a gpxe option ROM. For example:<br />
<br />
<source lang="bash"><br />
$ cd /path/to/gpxe/src/<br />
$ make bin/10ec8167.rom<br />
</source><br />
<br />
And add it to the coreboot image. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add /path/to/gpxe/src/bin/10ec8167.rom pci10ec,8167.rom 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
As with VGA option ROMs, the gpxe option ROM may be compressed with LZMA. However, compression won't significantly reduce gpxe's size as it implements its own compression.<br />
<br />
In addition to gpxe, other option ROMs can be added in the same manor.<br />
<br />
== Adding sgabios support ==<br />
<br />
An [http://code.google.com/p/sgabios/ sgabios] option ROM can forward some VGA BIOS requests over a serial port.<br />
<br />
Unfortunately, the current version of sgabios (as of 20090617) does not implement a proper checksum. As a work around, a tool from the seabios source repo can fix the checksum:<br />
<source lang="bash"><br />
$ /path/to/seabios/tools/buildrom.py /path/to/sgabios.bin sgabios-fixed.bin<br />
</source><br />
<br />
Once the above is done, place the ROM file in the '''vgaroms/''' directory of CBFS. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add sgabios-fixed.bin vgaroms/sgabios.bin 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
When using sgabios, all the characters that SeaBIOS writes to the screen will be seen twice - once from SeaBIOS sending the character to the serial port and once from sgabios forwarding the character. To prevent the duplicates one can edit the SeaBIOS '''src/config.h''' file and set the following:<br />
<br />
<source lang="C"><br />
#define CONFIG_SCREEN_AND_DEBUG 0<br />
</source><br />
<br />
== Adding payloads ==<br />
<br />
Most [[Payloads|payloads]] can also be launched from SeaBIOS. To add a payload, build the corresponding .elf file and then add it to the '''coreboot.rom''' file in the '''img/''' directory. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add-payload /path/to/payload.elf img/MyPayload l<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
During boot, one can press the '''F12''' key to get a boot menu. SeaBIOS will show all files in the '''img/''' directory, and one can instruct SeaBIOS to run them.<br />
<br />
Note, SeaBIOS currently supports uncompressed and LZMA compressed payloads. The nrv2b compression algorithm is not supported.<br />
<br />
== Adding a floppy image ==<br />
<br />
It is possible to embed an image of a floppy in flash. SeaBIOS can then boot from and redirect floppy BIOS calls to the flash image. This is mainly useful for legacy software (such as DOS utilities). To use this feature, place a floppy image into the CBFS directory '''floppyimg/'''. For example:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/myfloppy.img > myfloppy.img.lzma<br />
$ ./cbfs/cbfstool coreboot.rom add myfloppy.img.lzma floppyimg/MyFloppy.lzma 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
Both uncompressed and lzma compressed images are supported. Several floppy formats are available: 360K, 1.2MB, 720K, 1.44MB, 2.88MB, 160K, 180K, 320K.<br />
<br />
The floppy image will appear as writable to the system, however all writes are discarded on reboot.<br />
<br />
When using this system, SeaBIOS reserves high-memory to store the floppy. The reserved memory is then no longer available for OS use, so this feature should only be used when needed.</div>KevinOConnorhttps://www.coreboot.org/index.php?title=SeaBIOS&diff=8945SeaBIOS2009-09-09T00:36:30Z<p>KevinOConnor: Some grammer updates</p>
<hr />
<div>'''SeaBIOS''' is an open-source legacy BIOS implementation which can be used as a coreboot [[Payloads|payload]]. It implements the standard BIOS calling interfaces that a typical x86 proprietary BIOS implements.<br />
<br />
This page describes using SeaBIOS with coreboot. SeaBIOS can also run natively in qemu and bochs - see the SeaBIOS README file for information on non-coreboot uses.<br />
<br />
= Use cases =<br />
<br />
Any software requiring 16-bit BIOS services benefits from SeaBIOS (eg, Windows and DOS). SeaBIOS also enables booting Linux out of the box (using standard boot-loaders like GRUB and Syslinux).<br />
<br />
SeaBIOS supports booting from ATA hard drives, ATAPI cdroms, payloads in flash, and from "Option ROMs" (eg, SCSI or network cards). SeaBIOS can initialize and use a ps2 keyboard. SeaBIOS does not currently support booting from USB drives or using USB keyboards.<br />
<br />
== Windows ==<br />
<br />
SeaBIOS has been tested with Windows XP, Windows Vista (64/32 bit), and Windows 7 Beta (64 bit).<br />
<br />
However, Windows has a very strict ACPI interpreter, and many coreboot boards do not have a complete [[ACPI in coreboot|ACPI definition]]. As a result, many coreboot boards will fail during Windows boot (eg, it may fail with a STOP 0xA5 code).<br />
<br />
So far [[ASUS M2V-MX SE]] and [[GIGABYTE GA-M57SLI-S4]] have known good working ACPI and are able to boot XP/Vista/Windows 7. Please ask on the [[Mailinglist|mailing list]] for the status of other boards/chipsets.<br />
<br />
== Linux ==<br />
<br />
SeaBIOS has been tested with GRUB, LILO, and Syslinux. Linux booting works well.<br />
<br />
== Other ==<br />
<br />
SeaBIOS has also been tested with FreeDOS and NetBSD.<br />
<br />
Because SeaBIOS implements the standard x86 BIOS interfaces, it is expected many other operating systems and boot-loaders will work.<br />
<br />
= Building =<br />
<br />
== SeaBIOS ==<br />
<br />
One can download the latest version of SeaBIOS through a git repository:<br />
<br />
<source lang="bash"><br />
$ git clone git://git.linuxtogo.org/home/kevin/seabios.git seabios<br />
$ cd seabios<br />
</source><br />
<br />
There's also a [http://git.linuxtogo.org/?p=kevin/seabios.git;a=summary gitweb] facility to browse the latest source code online.<br />
<br />
Edit '''src/config.h''' and set the following values:<br />
<br />
<source lang="C"><br />
#define CONFIG_COREBOOT 1<br />
#define CONFIG_DEBUG_SERIAL 1<br />
#define CONFIG_OPTIONROMS_DEPLOYED 0<br />
#define CONFIG_COREBOOT_FLASH 1<br />
#define CONFIG_VGAHOOKS 1<br />
</source><br />
<br />
Then:<br />
<br />
<source lang="bash"><br />
$ make<br />
</source><br />
<br />
The final SeaBIOS payload file is '''out/bios.bin.elf''', which can be used with coreboot v2 or v3.<br />
<br />
=== Compiled SeaBIOS images ===<br />
<br />
It is also possible to download a compiled SeaBIOS image. The latest released version compiled for coreboot is: http://linuxtogo.org/~kevin/SeaBIOS/bios.bin.elf-0.4.2<br />
<br />
Other versions are also available at: http://linuxtogo.org/~kevin/SeaBIOS/<br />
<br />
== coreboot ==<br />
<br />
For best results, use coreboot-v2 and edit the '''targets/..../Config.lb''' with the following:<br />
<br />
option CONFIG_CBFS = 1<br />
option HAVE_HIGH_TABLES = 1<br />
...<br />
romimage "fallback"<br />
...<br />
payload /path/to/seabios/out/bios.bin.elf<br />
end<br />
<br />
Unfortunately, many boards don't have HAVE_HIGH_TABLES support, yet. If the build fails complaining about this option, one can edit the '''src/mainboard/<vendor>/<board>/Options.lb''' file and add a "uses HAVE_HIGH_TABLES" line. Then one can edit '''src/arch/i386/boot/tables.c''' and change the lines:<br />
<br />
<source lang="C"><br />
uint64_t high_tables_base = 0;<br />
uint64_t high_tables_size;<br />
</source><br />
<br />
to:<br />
<br />
<source lang="C"><br />
uint64_t high_tables_base = ( <memorysize> ) * 1024 * 1024 - (64 * 1024);<br />
uint64_t high_tables_size = 64 * 1024;<br />
</source><br />
<br />
where <memorysize> is the amount of memory (in MiB) available on the target machine, but '''not more than 3072'''. So, if there is more than 3GiB of RAM installed, put 3072. Otherwise, put the number of MiB of RAM installed in the machine.<br />
<br />
Alternatively, one can add proper support for HAVE_HIGH_TABLES.<br />
<br />
Once the above is done, the final image will be in '''coreboot.rom'''.<br />
<br />
= SeaBIOS and CBFS =<br />
<br />
SeaBIOS can read the coreboot flash filesystem and extract option ROMs and payloads.<br />
<br />
When SeaBIOS scans the target machine's PCI devices, it will recognize option ROMs in CBFS that have the form '''pciVVVV,DDDD.rom'''. It will also run any file in the directory '''vgaroms/''' as a vga option ROM not specific to a device and files in '''genroms/''' as a generic option ROM not specific to a device. In the above cases, SeaBIOS will recognize files with a '''.lzma''' suffix, and automatically decompress them (eg, '''pci1106,3344.rom.lzma''' and '''vgaroms/sgabios.bin.lzma''').<br />
<br />
SeaBIOS will also load payloads found in the CBFS directory '''img/''' and floppy images found in the '''floppyimg/''' directory.<br />
<br />
The examples below show some common uses of this feature.<br />
<br />
== Adding a VGA option ROM ==<br />
<br />
It is frequently necessary to add a VGA option ROM to CBFS in order to use a VGA adapter that is built-in to a motherboard. Note, VGA adapters on external cards do not require this step as SeaBIOS will automatically extract the VGA bios directly from the card.<br />
<br />
The first step is to find the vendor and device ID of the built-in VGA adapter. This information can be found from '''lspci''':<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
01:00.0 VGA compatible controller [0300]: VIA Technologies, Inc. UniChrome Pro IGP [1106:3344] (rev 01) (prog-if 00 [VGA controller])<br />
</source><br />
<br />
In the above example, the VGA vendor/device ID is '''1106:3344'''. [[VGA support#How_to_retrieve_a_good_video_bios|Obtain the VGA ROM]] (eg, '''vgabios.bin''') and add it to the ROM with:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add /path/to/vgabios.bin pci1106,3344.rom 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
Alternatively, SeaBIOS supports LZMA compressed option ROMs. Use the following to add a compressed option ROM instead:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/vgabios.bin > vgabios.bin.lzma<br />
$ ./cbfs/cbfstool coreboot.rom add vgabios.bin.lzma pci1106,3344.rom.lzma 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
After the above is done, one can write the coreboot.rom file to flash. SeaBIOS will extract the VGA ROM and run it during boot.<br />
<br />
== Adding gpxe support ==<br />
<br />
A [[GPXE|gpxe]] option ROM can nicely complement SeaBIOS and coreboot by adding network boot support. Adding gpxe is similar to [[#Adding a VGA option ROM]]. The first step is to find the Ethernet vendor/device ID. For example:<br />
<br />
<source lang="bash"><br />
$ lspci -vnn<br />
...<br />
00:09.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet [10ec:8167] (rev 10)<br />
</source><br />
<br />
Then one can build a gpxe option ROM. For example:<br />
<br />
<source lang="bash"><br />
$ cd /path/to/gpxe/src/<br />
$ make bin/10ec8167.rom<br />
</source><br />
<br />
And add it to the coreboot image. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add /path/to/gpxe/src/bin/10ec8167.rom pci10ec,8167.rom 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
As with VGA option ROMs, the gpxe option ROM may be compressed with LZMA. However, compression won't significantly reduce gpxe's size as it implements its own compression.<br />
<br />
In addition to gpxe, other option ROMs can be added in the same manor.<br />
<br />
== Adding sgabios support ==<br />
<br />
An [http://code.google.com/p/sgabios/ sgabios] option ROM can forward some VGA BIOS requests over a serial port.<br />
<br />
Unfortunately, the current version of sgabios (as of 20090617) does not implement a proper checksum. As a work around, a tool from the seabios source repo can fix the checksum:<br />
<source lang="bash"><br />
$ /path/to/seabios/tools/buildrom.py /path/to/sgabios.bin sgabios-fixed.bin<br />
</source><br />
<br />
Once the above is done, place the ROM file in the '''vgaroms/''' directory of CBFS. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add sgabios-fixed.bin vgaroms/sgabios.bin 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
When using sgabios, all the characters that SeaBIOS writes to the screen will be seen twice - once from SeaBIOS sending the character to the serial port and once from sgabios forwarding the character. To prevent the duplicates one can edit the SeaBIOS '''src/config.h''' file and set the following:<br />
<br />
<source lang="C"><br />
#define CONFIG_SCREEN_AND_DEBUG 0<br />
</source><br />
<br />
== Adding payloads ==<br />
<br />
Most [[Payloads|payloads]] can also be launched from SeaBIOS. To add a payload, build the corresponding .elf file and then add it to the '''coreboot.rom''' file in the '''img/''' directory. For example:<br />
<br />
<source lang="bash"><br />
$ ./cbfs/cbfstool coreboot.rom add-payload /path/to/payload.elf img/MyPayload l<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
During boot, one can press the '''F12''' key to get a boot menu. SeaBIOS will show all files in the '''img/''' directory, and one can instruct SeaBIOS to run them.<br />
<br />
Note, SeaBIOS currently supports uncompressed and LZMA compressed payloads. The nrv2b compression algorithm is not supported.<br />
<br />
== Adding a floppy image ==<br />
<br />
It is possible to embed an image of a floppy in flash. SeaBIOS can then boot from and redirect floppy BIOS calls to the flash image. This is mainly useful for legacy software (such as DOS utilities). To use this feature, place a floppy image into the CBFS directory '''floppyimg/'''. For example:<br />
<br />
<source lang="bash"><br />
$ lzma -zc /path/to/myfloppy.img > myfloppy.img.lzma<br />
$ ./cbfs/cbfstool coreboot.rom add myfloppy.img.lzma floppyimg/MyFloppy.lzma 99<br />
$ ./cbfs/cbfstool coreboot.rom print<br />
</source><br />
<br />
Both uncompressed and lzma compressed images are supported. Several floppy formats are available: 360K, 1.2MB, 720K, 1.44MB, 2.88MB, 160K, 180K, 320K.<br />
<br />
The floppy image will appear as writable to the system, however all writes are discarded on reboot.<br />
<br />
When using this system, SeaBIOS reserves high-memory to store the floppy. The reserved memory is then no longer available for OS use, so this feature should only be used when needed.</div>KevinOConnor