sel4环境搭建与运行

尝试运行sel4,总结环境搭建与运行的全流程。

sel4环境搭建与运行

环境

  • ubuntu 22.04.03
  • ARM QEMU

配置

基础依赖

1
2
3
4
5
6
7
8
9
sudo apt-get update
sudo apt-get install build-essential

sudo apt-get install cmake ccache ninja-build cmake-curses-gui
sudo apt-get install libxml2-utils ncurses-dev
sudo apt-get install curl git doxygen device-tree-compiler
sudo apt-get install u-boot-tools
sudo apt-get install python3-dev python3-pip python-is-python3
sudo apt-get install protobuf-compiler python3-protobuf

ARM Qemu

1
sudo apt-get install qemu-system-arm qemu-system-x86 qemu-system-misc

ARM交叉编译

1
2
sudo apt-get install gcc-arm-linux-gnueabi g++-arm-linux-gnueabi
sudo apt-get install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu

Python依赖

1
2
3
4
5
6
pip3 install --user setuptools
pip3 install --user sel4-deps

pip install --user aenum
pip install --user pyelftools
pip install sortedcontainers

获取tutorials代码

1
2
3
4
5
6
7
apt install repo

mkdir sel4-tutorials-manifest
cd sel4-tutorials-manifest

repo init -u https://github.com/seL4/sel4-tutorials-manifest
repo sync

运行Hello world!

参考项目根目录README.md

1
2
3
4
5
./init --tut hello-world

cd ./hello-world_build
ninja
./simulate

打印如下内容说明成功运行

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Booting all finished, dropped to user space
Hello, World!
Caught cap fault in send phase at address 0
while trying to handle:
vm fault on data at address 0 with status 0x4
in thread 0xffffff801fe08400 "rootserver" at address 0
With stack:
0x41ce88: 0x4017bf
0x41ce90: 0x41cf00
0x41ce98: 0x0
0x41cea0: 0x41cee0
0x41cea8: 0x40123a
0x41ceb0: 0x0
0x41ceb8: 0x41cf20
0x41cec0: 0x41cf10
0x41cec8: 0x41cf00
0x41ced0: 0x1
0x41ced8: 0x4010f6
0x41cee0: 0x41cff0
0x41cee8: 0x4013dc
0x41cef0: 0x0
0x41cef8: 0x525000
0x41cf00: 0x41201c

结束的话是按 CRTL+A ,松开按 x

可修改hello-world/src/main.c中的代码并保存,在hello-world_build目录下重新编译运行。

1
2
ninja
./simulate

参考链接:seL4(1)-配置和运行_tutorials工程 sel4-CSDN博客