Add qemu 2.4.0
[kvmfornfv.git] / qemu / roms / seabios / docs / Build_overview.md
1 The SeaBIOS code can be built using standard GNU tools. A recent Linux
2 distribution should be able to build SeaBIOS using the standard
3 compiler tools.
4
5 Building SeaBIOS
6 ================
7
8 First, [obtain the code](Download). SeaBIOS can be compiled for
9 several different build targets. It is also possible to configure
10 additional compile time options - run **make menuconfig** to do this.
11
12 Build for QEMU (along with KVM, Xen, and Bochs)
13 -----------------------------------------------
14
15 To build for QEMU (and similar), one should be able to run "make" in
16 the main directory. The resulting file "out/bios.bin" contains the
17 processed bios image.
18
19 One can use the resulting binary with QEMU by using QEMU's "-bios"
20 option. For example:
21
22 `qemu -bios out/bios.bin -fda myfdimage.img`
23
24 One can also use the resulting binary with Bochs. For example:
25
26 `bochs -q 'floppya: 1_44=myfdimage.img' 'romimage: file=out/bios.bin'`
27
28 Build for coreboot
29 ------------------
30
31 To build for coreboot please see the coreboot build instructions at:
32 <http://www.coreboot.org/SeaBIOS>
33
34 Build as a UEFI Compatibility Support Module (CSM)
35 --------------------------------------------------
36
37 To build as a CSM, first run kconfig (make menuconfig) and enable
38 CONFIG_CSM. Then build SeaBIOS (make) - the resulting binary will be
39 in "out/Csm16.bin".
40
41 This binary may be used with the OMVF/EDK-II UEFI firmware. It will
42 provide "legacy" BIOS services for booting non-EFI operating systems
43 and will also allow OVMF to display on otherwise unsupported video
44 hardware by using the traditional VGA BIOS. (Windows 2008r2 is known
45 to use INT 10h BIOS calls even when booted via EFI, and the presence
46 of a CSM makes this work as expected too.)
47
48 Having built SeaBIOS with CONFIG_CSM, one should be able to drop the
49 result (out/Csm16.bin) into an OVMF build tree at
50 OvmfPkg/Csm/Csm16/Csm16.bin and then build OVMF with 'build -D
51 CSM_ENABLE'. The SeaBIOS binary will be included as a discrete file
52 within the 'Flash Volume' which is created, and there are tools which
53 will extract it and allow it to be replaced.
54
55 Overview of files in the repository
56 ===================================
57
58 The **src/** directory contains the main bios source code. The
59 **src/hw/** directory contains source code specific to hardware
60 drivers. The **src/fw/** directory contains source code for platform
61 firmware initialization. The **src/std/** directory contains header
62 files describing standard bios, firmware, and hardware interfaces.
63
64 The **vgasrc/** directory contains code for VGA BIOS implementations.
65 This code is separate from the main BIOS code in the src/ directory.
66 When the build is configured to produce a VGA BIOS the resulting
67 binary is found in out/vgabios.bin. The VGA BIOS code is always
68 compiled in 16bit mode.
69
70 The **scripts/** directory contains helper utilities for manipulating
71 and building the final roms.
72
73 The **out/** directory is created by the build process - it contains
74 all intermediate and final files.
75
76 When reading the C code be aware that code that runs in 16bit mode can
77 not arbitrarily access non-stack memory - see [Memory Model](Memory
78 Model) for more details. For information on the major C code functions
79 and where code execution starts see [Execution and code
80 flow](Execution and code flow).