目录

编译环境

kconfig工具下载

系统编译需要用到kconfig工具,用于生成config文件与头文件

# 在项目根目录下运行
git clone https://gitlink.org.cn/xuos/kconfig-frontends.git

docker镜像

项目提供了dockerfile来构建docker镜像,以快捷地搭建编译环境。

# 在项目根目录下运行,dockefile会将前面下载的kconfig工具一并打包到镜像中
docker build --build-arg UID=$(id -u) --build-arg GID=$(id -g) --build-arg USER=$(whoami) -f ubuntu.dockerfile -t xiuos_build .

镜像使用与编译

上面的指令会构建生成名为xiuos_build的docker镜像,可以使用以下指令来使用该镜像

# 在项目根目录下运行
docker run -it --rm --network=host --name xiuos_test -v ./:/workspace xiuos_build:latest

该命令会直接在容器内运行make指令,可以使用alias进行别名以快捷调用

alias xiuos_make "docker run -it --rm --name xiuos_make -v ./:/workspace xiuos_build:latest"
xiuos_make

项目构建

配置

先使用menuconfig对进行配置

# 确保终端窗口不要太小
xiuos_make BOARD=gd32f470 menuconfig

完成后保存config文件,并会生成对应的头文件xsconfig.h

编译
xiuos_make BOARD=gd32f470

编译生成镜像文件位于Ubiquitous/XiZi_IIoT/build

关于

XiuOS-GD32

188.4 MB
邀请码