]>
Commit | Line | Data |
---|---|---|
e2a013fa | 1 | Deprecation Notice |
2 | ================== | |
3 | UnixPkg is deprecated. Please see UnixPkg/Deprecated.txt for more information. | |
4 | ||
020f7cf4 | 5 | Unix Simulation Platform |
6 | ======================== | |
7 | ||
8 | UnixPkg is one of platform package which can be built to a platform's firmware from UnixPkg.dsc file. | |
9 | And this package provide a simulation platform under *INUX environment in IA32 architecture. | |
10 | ||
11 | - Same points between real platform and simulation platform: | |
12 | 1) Unix simulation platform also run with firmware device image built from UnixPkg | |
13 | 2) The working flow of simulation platform also contains SEC/PEI/DXE phase. | |
14 | ||
15 | - Different points between real platform and simulation platform: | |
16 | 1) The SEC phase in simulation platform in fact is a *INUX native application which can be run from *INUX shell; | |
17 | 2) The device in simulation platform is not real hardware but simulation component in API level; | |
18 | 3) The ThunkBus driver in simulation platform will get virtual device's desription from PCD and create virtual Device | |
19 | ||
20 | Build | |
21 | ===== | |
22 | UnixPkg is built with following command: | |
23 | build -p UnixPkg/UnixPkg.dsc -a IA32 -t ELFGCC | |
24 | Notes: ELFGCC is defined in <Workspace>/Conf/tools_def.txt file. This tool chain use native gcc/binutil instead of | |
25 | cross-compiler like UNIXGCC tool chain. | |
26 | ||
7ee3b613 A |
27 | On Mac OS X you can cd into UnixPkg directory and execute ./build.sh to build. This does not require |
28 | setting up the environment like running the build command. Note Snow Leopard or later is required. | |
29 | This script should also work for any *INUX, but has not been tested. | |
30 | ||
31 | ./build.sh run will lanuch the emulator in gdb so you can source level debug via gdb. | |
32 | ||
33 | ||
34 | Notes: | |
35 | ===== | |
36 | On Mac OS X Snow Leopard you can use Xcode 3.2 as a GUI debugger. | |
37 | Launch Xcode and open UnixPkg/Xcode/xcode_project/xcode_project.xcodeproj | |
38 | Under the build menu chose build and debug. shift-cmd-B shows the build results. | |
39 | ||
40 | Under most *INUX the EFI executables are placed in the emulated EFI memory by the EFI PE/COFF loader | |
41 | but dlopen() is used to also load the image into the process to support source level debug. | |
42 | The entry point for the image is moved from the EFI emulator memory into the dlopen() image. This | |
43 | is not the case for Mac OS X. On Mac OS X a debugger script is used and the real EFI images in | |
44 | the emulator are the ones being debugged. | |
45 | ||
46 | Also on Mac OS X the stack alignment requirements for IA-32 are 16 bytes and this is more strict | |
47 | than the EFI ABI. To work around this gasket code was introduced to ensure the stack is always | |
48 | 16 byte aligned when making any POSIX call on Mac OS X. | |
49 | ||
50 | To build PE/COFF images with Xcode 3.2 and extra tool call mtoc is required to convert Mach-O | |
51 | images into PE/COFF images. The tool only supports EFI PE/COFF images and the instructions on | |
52 | how to download it are on the edk2 website. | |
020f7cf4 | 53 | |
54 | FAQ | |
55 | === | |
56 | 1, I fail to build UnixPkg due to "X11/extensions/XShm.h: No such file or directory"? | |
57 | The display adapter in UnixPkg is a virtual device written in X11 API. The library of x11proto-xext-dev is required | |
58 | for building. | |
59 | ||
60 | 2, I fail to build UnixPkg due to "/usr/bin/ld: cannot find -lXext"? | |
61 | libxext-dev library is required for building. | |
62 |