Build, Test, Execute - lulu98/projects-with-sel4 GitHub Wiki
Build, Test, Execute
Build
There are three options to build an application image in this project:
- Option 1: Build on local machine
- Option 2: Build in Docker container
- Option 3: Build with
build.sh
script (preferred)
Option 1: Build on local machine
Sample applications for this project are located at src/main/projects/my_project/apps
and can be invoked with the -DCAMKES_APP
compiler flag. If you want to build the hello-world
application in src/main/projects/my_projects/apps/hello-world
for the zynq7000
platform, execute the following commands:
mkdir build
cd build
../init-build.sh -DPLATFORM=zynq7000 -DCAMKES_APP=hello-world
ninja
The problem here is that this requires all the necessary dependencies to be installed.
Option 2: Build in Docker container
CAmkES and seL4 projects have a lot of dependencies that must be installed:
If you do not want all the dependencies on the host machine, you can simply use a Docker container:
You can clone the specified repository and start a container while linking the project repository. The Docker container will then operate in the project repository. The build instructions are exactly the same as Option 1.
build.sh
script (preferred)
Option 3: Build with The easiest way to build the application images is probably by invoking the build.sh
script in the src/
directory. You can comment out the
platforms and applications that you do not want to build for. This script uses the repository mentioned in Option 2 but you do not have to explicitly specify all the build commands every time you want to build an application.
Test
The project utilizes QEMU and the pexpect python package to test the different application images. The test cases can be found in src/test/unit_tests/
.
Execute
Running on real HW
After letting ninja
build the application for a platform, you can find the binary image in the build/images
directory. This image can be copied on a micro-SD card and will be loaded and executed by U-Boot.
Simulation in QEMU
If you do not have access to the real hardware (e.g. Zynq7000), you can add the -DSIMULATION=ON
compiler flag and then simulate the built image in QEMU:
mkdir build
cd build
../init-build.sh -DPLATFORM=x86_64 -DSIMULATION=ON -DCAMKES_APP=hello-world
ninja
./simulate