1 | $Id: ReadMe.txt 29156 2010-05-06 13:50:07Z vboxsync $
|
---|
2 |
|
---|
3 | Setting up the source trees
|
---|
4 | ===========================
|
---|
5 |
|
---|
6 | Check out the EDK2 trunk/edk2 to some directory of your choice (the command
|
---|
7 | creates an edk2 subdirectory):
|
---|
8 |
|
---|
9 | svn checkout \
|
---|
10 | --username guest --password guest \
|
---|
11 | -r9332 https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2 edk2
|
---|
12 |
|
---|
13 | Enter into the edk2 directory and check out EFI/Firmware2/VBoxPkg into a
|
---|
14 | VBoxPkg subdirectory:
|
---|
15 |
|
---|
16 | svn checkout \
|
---|
17 | https://linserv.germany.sun.com/vbox/svn/trunk/src/VBox/Devices/EFI/Firmware2/VBoxPkg VBoxPkg
|
---|
18 |
|
---|
19 | Enter into the VBoxPkg/Include and check out include/iprt and include/VBox:
|
---|
20 |
|
---|
21 | svn checkout https://linserv.germany.sun.com/vbox/svn/trunk/include/iprt iprt
|
---|
22 | svn checkout https://linserv.germany.sun.com/vbox/svn/trunk/include/VBox VBox
|
---|
23 |
|
---|
24 | Then copy version-generated.h from
|
---|
25 | <VBox-trunk>/out/win.*/*/version-generated.h (into VBoxPkg/include/).
|
---|
26 | <VBox-trunk>/out/win.*/*/product-generated.h (into VBoxPkg/include/).
|
---|
27 |
|
---|
28 |
|
---|
29 | Symlink alternative for Vista
|
---|
30 | -----------------------------
|
---|
31 |
|
---|
32 | Say you've got VBox checked out as e:\vbox\trunk and you're on 32-bit Windows
|
---|
33 | and having done a debug build. Check out EDK2 somewhere (see above). Then do:
|
---|
34 |
|
---|
35 | kmk_ln -s %VBOXSVN%\src\VBox\Devices\EFI\Firmware2\VBoxPkg\ edk2\VBoxPkg
|
---|
36 | kmk_ln -s %VBOXSVN%\include\iprt\ edk2\VBoxPkg\Include\iprt
|
---|
37 | kmk_ln -s %VBOXSVN%\include\VBox\ edk2\VBoxPkg\Include\VBox
|
---|
38 | kmk_ln -s %VBOXSVN%\out\win.x86\debug\version-generated.h edk2\VBoxPkg\Include\version-generated.h
|
---|
39 | kmk_ln -s %VBOXSVN%\out\win.x86\debug\product-generated.h edk2\VBoxPkg\Include\product-generated.h
|
---|
40 |
|
---|
41 | MinGW for Linux
|
---|
42 | ================
|
---|
43 |
|
---|
44 | To install MinGW on Ubuntu systems, just perform
|
---|
45 |
|
---|
46 | apt-get install mingw32-binutils mingw32 mingw32-runtime
|
---|
47 |
|
---|
48 | After that, you can even avoid setting up symlinks, as build script will do
|
---|
49 | that automagically.
|
---|
50 |
|
---|
51 | MinGW-w64 for Linux
|
---|
52 | ===================
|
---|
53 | To build the X64 firmware on Linux, the wimgw-w64 port of mingw is required.
|
---|
54 | The binaries are available at:
|
---|
55 |
|
---|
56 | http://sourceforge.net/projects/mingw-w64/files/
|
---|
57 |
|
---|
58 | Some non-fatal warnings might appears while compiling on Linux machine so it
|
---|
59 | is recommended to disable -Werror at Conf/tools_def.txt:*_UNIXGCC_X64_CC_FLAGS.
|
---|
60 |
|
---|
61 | While building some versions of wingw-w64/linker might complain that __ModuleEntryPoint wasn't found (and fills entry point field with some default value)
|
---|
62 | to fix that, just split the the definition (IA32 and X64),with removing leading underscore '_' for X64 at Conf/tools_def.txt:
|
---|
63 | *_UNIXGCC_*_DLINK_FLAGS=... -entry _$(IMAGE_ENTRY_POINT) ...
|
---|
64 | to
|
---|
65 | *_UNIXGCC_IA32_DLINK_FLAGS=... -entry _$(IMAGE_ENTRY_POINT) ...
|
---|
66 | *_UNIXGCC_X64_DLINK_FLAGS=... -entry $(IMAGE_ENTRY_POINT) ...
|
---|
67 |
|
---|
68 | Setting up the environment
|
---|
69 | ==========================
|
---|
70 |
|
---|
71 | First, enter the VirtualBox environment using tools/env.cmd (and whatever
|
---|
72 | local additions you normally use).
|
---|
73 |
|
---|
74 | Go to the EDK2 source tree you set up in the previous section and run
|
---|
75 | VBoxPkg/env.cmd (Windows) and VBoxPkg/env.sh (Unix).
|
---|
76 |
|
---|
77 | That's it. You can now run build.
|
---|
78 |
|
---|
79 |
|
---|
80 | Patching
|
---|
81 | ========
|
---|
82 |
|
---|
83 | VBox guests and hardware required some modifications in EDK2 do before
|
---|
84 | building some patches are required:
|
---|
85 |
|
---|
86 | cat VBoxPkg/edk2.patch-pmtimer | patch -p0
|
---|
87 | cat VBoxPkg/edk2.patch-no_blocking_partition | patch -p0
|
---|
88 | cat VBoxPkg/edk2.patch-ovmf_pei | patch -p0
|
---|
89 | cat VBoxPkg/edk2.patch-no_blocking_partition | patch -p0
|
---|
90 | cat VBoxPkg/edk2.patch-apple | patch -p0
|
---|
91 | cat VBoxPkg/edk2.patch-rtc | patch -p0
|
---|
92 | cat VBoxPkg/edk2.patch-mem_acpi | patch -p0
|
---|
93 | cat VBoxPkg/edk2.patch-idtgdt | patch -p0
|
---|
94 |
|
---|
95 |
|
---|
96 | Building
|
---|
97 | ========
|
---|
98 | Edit Cont/target.txt:
|
---|
99 |
|
---|
100 | $ cat Conf/target.txt
|
---|
101 | ACTIVE_PLATFORM = VBoxPkg/VBoxPkgOSE.dsc
|
---|
102 | TARGET = DEBUG
|
---|
103 | TARGET_ARCH = IA32
|
---|
104 | TOOL_CHAIN_CONF = Conf/tools_def.txt
|
---|
105 | TOOL_CHAIN_TAG = UNIXGCC
|
---|
106 | MAX_CONCURRENT_THREAD_NUMBER = 1
|
---|
107 | MULTIPLE_THREAD = Disable
|
---|
108 | BUILD_RULE_CONF = Conf/build_rule.txt
|
---|
109 |
|
---|
110 | The make program is called 'build' (edk2\BaseTools\Bin\Win32\build.exe). To
|
---|
111 | start building just execute 'build'. If you have a multicore machine and run
|
---|
112 | into bad build errors, try 'build -n 1' to avoid mixing up errors. For more
|
---|
113 | options try 'build --help'.
|
---|
114 |
|
---|
115 |
|
---|
116 | Running
|
---|
117 | =======
|
---|
118 |
|
---|
119 | Copy (or symlink) Build\VBoxPkg\DEBUG_MYTOOLS\FV\VBOX.fd to the
|
---|
120 | VirtualBox bin directory as vboxefi.fv.
|
---|
121 | copy e:\edk2\Build\VBoxPkg\DEBUG_MYTOOLS\FV\VBOX.fd e:\vbox\trunk\out\win.x86\debug\bin\VBoxEFI32.fd
|
---|
122 | or
|
---|
123 | kmk_ln -s e:\edk2\Build\VBoxPkg\DEBUG_MYTOOLS\FV\VBOX.fd e:\vbox\trunk\out\win.x86\debug\bin\VBoxEFI32.fd
|
---|
124 |
|
---|
125 | You need to build have a VirtualBox debug build with the following in your
|
---|
126 | Note that these options will not change the VirtualBox behavior only enable
|
---|
127 | the EFI feature.
|
---|
128 |
|
---|
129 | Create a new VM with enabled EFI support.
|
---|
130 |
|
---|
131 | Currently all there is to see is in the log output and debugger. Suggested
|
---|
132 | log setup (debug builds only):
|
---|
133 |
|
---|
134 | set VBOX_LOG=dev_efi.e.l2
|
---|
135 | set VBOX_LOG_DEST=stderr
|
---|
136 | set VBOX_LOG_FLAGS=unbuffered msprog thread
|
---|
137 |
|
---|
138 | And suggested way of starting the VM:
|
---|
139 |
|
---|
140 | VirtualBox.exe --startvm efi
|
---|
141 |
|
---|