You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Open Virtual Machine firmware bios images (OVMF) by [Tianocore](https://tianocore.org)
1762
+
1763
+
On a debian-like system it is sufficient to install the packages as follows:
1764
+
1765
+
```
1766
+
# for wolfBoot and others
1767
+
apt install git make gcc
1768
+
1769
+
# for test scripts
1770
+
apt install sudo dosfstools curl
1771
+
apt install qemu qemu-system-x86 ovmf gnu-efi
1772
+
1773
+
# for buildroot
1774
+
apt install file bzip2 g++ wget cpio unzip rsync bc
1775
+
```
1776
+
1777
+
### Configuration
1778
+
1779
+
An example configuration is provided in [config/examples/x86_64_efi.config](config/examples/x86_64_efi.config)
1780
+
1781
+
### Building and running on qemu
1782
+
1783
+
The bootloader and the initialization script `startup.nsh` for execution in the EFI environment are stored in a loopback FAT partition.
1784
+
1785
+
The script [tools/efi/prepare_uefi_partition.sh](tools/efi/prepare_uefi_partition.sh) creates a new empty
1786
+
FAT loopback partitions and adds `startup.nsh`.
1787
+
1788
+
A kernel with an embedded rootfs partition can be now created and added to the image, via the
1789
+
script [tools/efi/compile_efi_linux.sh](tools/efi/compile_efi_linux.sh). The script actually adds two instances
1790
+
of the target systems: `kernel.img` and `update.img`, both signed for authentication, and tagged with version
1791
+
`1` and `2` respectively.
1792
+
1793
+
Compiling with `make` will produce the bootloader image in `wolfboot.efi`.
1794
+
1795
+
1796
+
The script [tools/efi/run_efi.sh](tools/efi/run_efi.sh) will add `wolfboot.efi` to the bootloader loopback
1797
+
partition, and run the system on qemu. If both kernel images are present and valid, wolfBoot will choose the image
1798
+
with the higher version number, so `update.img` will be staged as it's tagged with version `2`.
1799
+
1800
+
The sequence is summarized below:
1801
+
1802
+
```
1803
+
cp config/examples/x86_64_efi.config .config
1804
+
tools/efi/prepare_efi_partition.sh
1805
+
make
1806
+
tools/efi/compile_efi_linux.sh
1807
+
tools/efi/run_efi.sh
1808
+
```
1809
+
1810
+
```
1811
+
EFI v2.70 (EDK II, 0x00010000)
1812
+
[700/1832]
1813
+
Mapping table
1814
+
FS0: Alias(s):F0a:;BLK0:
1815
+
PciRoot(0x0)/Pci(0x1,0x1)/Ata(0x0)
1816
+
BLK1: Alias(s):
1817
+
PciRoot(0x0)/Pci(0x1,0x1)/Ata(0x0)
1818
+
Press ESC in 1 seconds to skip startup.nsh or any other key to continue.
1819
+
Starting wolfBoot EFI...
1820
+
Image base: 0xE3C6000
1821
+
Opening file: kernel.img, size: 6658272
1822
+
Opening file: update.img, size: 6658272
1823
+
Active Part 1
1824
+
Firmware Valid
1825
+
Booting at 0D630000
1826
+
Staging kernel at address D630100, size: 6658016
1827
+
```
1828
+
1829
+
You can `Ctrl-C` or login as `root` and power off qemu with `poweroff`
1830
+
1831
+
1825
1832
1826
1833
## Intel x86_64 with Intel FSP support
1827
1834
1828
-
This feature is experimental. Intel FSP provides a set of common firmware
1829
-
services that can be used for memory initialization, power management, and
1830
-
silicon initialization. Wolfboot accesses these services by invoking
1831
-
machine-dependent binary code provided by the Intel FSP in the form of binary
1832
-
blobs.
1835
+
This setup is more complex than the UEFI approach described earlier, but allows
1836
+
for complete control of the machine since the very first stage after poweron.
1837
+
1838
+
In other words, wolfBoot can run as a secure replacement of the system BIOS, thanks to the
1839
+
integration with the Intel Firmware Support Package (FSP). FSP provides services
1840
+
for target-specific initial configuration (memory and silicon initialization,
1841
+
power management, etc.). These services are designed to be accessed and invoked
1842
+
by the bootloader.
1843
+
1844
+
If wolfBoot is compiled with FSP support, it invokes the necessary machine-dependent
1845
+
binary code, which that can be obtained from the chip manufacturer.
1846
+
1847
+
The following variables must be set in your `.config` file when using this feature:
1833
1848
1834
-
To use this feature, you will need to configure the following variables:
1835
1849
1836
1850
-`ARCH` = `x86_64`
1837
1851
-`TARGET` = A useful name for the target you want to support. You can refer to
@@ -1847,13 +1861,13 @@ To use this feature, you will need to configure the following variables:
1847
1861
-`WOLFBOOT_LOAD_BASE`: the address where wolfboot will be loaded in RAM after the first initialization phase
1848
1862
1849
1863
While Intel FSP aims to abstract away specific machine details, you still need
1850
-
some machine-specific code. Refer to the Intel Integration Guide of the selected
1864
+
some machine-specific code. In the next section we show how to retrieve the
1865
+
target-specific code for qemu. Refer to the Intel Integration Guide of the selected
1851
1866
silicon for more information.
1852
1867
1853
1868
Note:
1854
-
- This feature is experimental, so it may have bugs or limitations.
1855
1869
1856
-
- This feature requires NASM
1870
+
- This feature requires `NASM` to be installed on the machine building wolfBoot.
1857
1871
1858
1872
1859
1873
### Running on 64-bit Qemu
@@ -2039,7 +2053,6 @@ booting...
2039
2053
Linux version 5.17.15 (arch@wb-hg-2) (x86_64-linux-gcc.br_real (Buildroot toolchains.bootlin.com-2021.11-5) 11.2.0, GNU ld (GNU Binutils) 2.37) #24 PREEMPT Wed May 17 13:47:24 UTC 2023
2040
2054
```
2041
2055
2042
-
2043
2056
### Running on 64-bit Qemu with swtpm (TPM emulator)
2044
2057
2045
2058
The example configuration for this setup can be found in
0 commit comments