Merge branch 'master' into feat-network-rebuild

Signed-off-by: longjin <longjin@DragonOS.org>
This commit is contained in:
longjin 2024-11-27 14:34:01 +00:00
commit 14c21430a5
153 changed files with 2578 additions and 1847 deletions

View File

@ -44,4 +44,4 @@ jobs:
AWS_SECRET_ACCESS_KEY: ${{ secrets.DOCS_DEPLOY_S3_SECRET_KEY }} AWS_SECRET_ACCESS_KEY: ${{ secrets.DOCS_DEPLOY_S3_SECRET_KEY }}
run: | run: |
aws s3 sync ./_build/html s3://dragonos-docs --delete aws s3 sync ./_build/html s3://dragonos-docs --delete --exclude "p/*"

View File

@ -7,19 +7,18 @@ on:
branches: ["master", "feat-*", "fix-*"] branches: ["master", "feat-*", "fix-*"]
jobs: jobs:
format-check: format-check:
name: Format check ${{ matrix.arch }} name: Format check ${{ matrix.arch }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
continue-on-error: true continue-on-error: true
container: dragonos/dragonos-dev:v1.6 container: dragonos/dragonos-dev:v1.7
strategy: strategy:
matrix: matrix:
arch: [x86_64, riscv64] arch: [x86_64, riscv64]
steps: steps:
- run: echo "Running in dragonos/dragonos-dev:v1.6" - run: echo "Running in dragonos/dragonos-dev:v1.7"
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Format check - name: Format check
@ -29,20 +28,21 @@ jobs:
shell: bash -ileo pipefail {0} shell: bash -ileo pipefail {0}
run: | run: |
printf "\n" >> kernel/src/include/bindings/bindings.rs printf "\n" >> kernel/src/include/bindings/bindings.rs
sed -i 's/arch = ".*"/arch = "${{ matrix.arch }}"/' dadk-manifest.toml
FMT_CHECK=1 make fmt FMT_CHECK=1 make fmt
kernel-static-test: kernel-static-test:
name: Kernel static test ${{ matrix.arch }} name: Kernel static test ${{ matrix.arch }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
continue-on-error: true continue-on-error: true
container: dragonos/dragonos-dev:v1.6 container: dragonos/dragonos-dev:v1.7
strategy: strategy:
matrix: matrix:
arch: [x86_64, riscv64] arch: [x86_64, riscv64]
steps: steps:
- run: echo "Running in dragonos/dragonos-dev:v1.6" - run: echo "Running in dragonos/dragonos-dev:v1.7"
- uses: actions/checkout@v3 - uses: actions/checkout@v3
@ -54,12 +54,11 @@ jobs:
run: bash -c "source /root/.cargo/env && cd kernel && make test && make test-rbpf" run: bash -c "source /root/.cargo/env && cd kernel && make test && make test-rbpf"
build-x86_64: build-x86_64:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: dragonos/dragonos-dev:v1.6 container: dragonos/dragonos-dev:v1.7
steps: steps:
- run: echo "Running in dragonos/dragonos-dev:v1.6" - run: echo "Running in dragonos/dragonos-dev:v1.7"
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: build the DragonOS - name: build the DragonOS
@ -72,20 +71,20 @@ jobs:
source ~/.bashrc source ~/.bashrc
source ~/.cargo/env source ~/.cargo/env
export DragonOS_GCC=$HOME/opt/dragonos-gcc/gcc-x86_64-unknown-none/bin export DragonOS_GCC=$HOME/opt/dragonos-gcc/gcc-x86_64-unknown-none/bin
sed -i 's/arch = ".*"/arch = "${{ env.ARCH }}"/' dadk-manifest.toml
make -j $(nproc) make all -j $(nproc)
build-riscv64: build-riscv64:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: dragonos/dragonos-dev:v1.6 container: dragonos/dragonos-dev:v1.7
steps: steps:
- run: echo "Running in dragonos/dragonos-dev:v1.6" - run: echo "Running in dragonos/dragonos-dev:v1.7"
- uses: actions/checkout@v3 - uses: actions/checkout@v3
with: with:
submodules: 'recursive' submodules: "recursive"
- name: build the DragonOS - name: build the DragonOS
shell: bash -ileo pipefail {0} shell: bash -ileo pipefail {0}
@ -93,5 +92,7 @@ jobs:
ARCH: riscv64 ARCH: riscv64
HOME: /root HOME: /root
run: source ~/.bashrc && source ~/.cargo/env && make kernel -j $(nproc) run: |
source ~/.bashrc && source ~/.cargo/env
sed -i 's/arch = ".*"/arch = "${{ env.ARCH }}"/' dadk-manifest.toml
make kernel -j $(nproc)

View File

@ -34,19 +34,22 @@ else
FMT_CHECK= FMT_CHECK=
endif endif
# Check if ARCH matches the arch field in dadk-manifest.toml
check_arch:
@bash tools/check_arch.sh
.PHONY: all .PHONY: all
all: kernel user all: kernel user
.PHONY: kernel .PHONY: kernel
kernel: kernel: check_arch
mkdir -p bin/kernel/ mkdir -p bin/kernel/
$(MAKE) -C ./kernel all ARCH=$(ARCH) || (sh -c "echo 内核编译失败" && exit 1) $(MAKE) -C ./kernel all ARCH=$(ARCH) || (sh -c "echo 内核编译失败" && exit 1)
.PHONY: user .PHONY: user
user: user: check_arch
$(MAKE) -C ./user all ARCH=$(ARCH) || (sh -c "echo 用户程序编译失败" && exit 1) $(MAKE) -C ./user all ARCH=$(ARCH) || (sh -c "echo 用户程序编译失败" && exit 1)
.PHONY: clean .PHONY: clean
@ -61,11 +64,6 @@ clean:
ECHO: ECHO:
@echo "$@" @echo "$@"
cppcheck-xml:
cppcheck kernel user --platform=unix64 --std=c11 -I user/libs/ -I=kernel/ --force -j $(NPROCS) --xml 2> cppcheck.xml
cppcheck:
cppcheck kernel user --platform=unix64 --std=c11 -I user/libs/ -I=kernel/ --force -j $(NPROCS)
docs: ECHO docs: ECHO
bash -c "cd docs && make html && cd .." bash -c "cd docs && make html && cd .."
@ -81,74 +79,74 @@ else
endif endif
# 写入磁盘镜像 # 写入磁盘镜像
write_diskimage: write_diskimage: check_arch
@echo "write_diskimage arch=$(ARCH)" @echo "write_diskimage arch=$(ARCH)"
bash -c "export ARCH=$(ARCH); cd tools && bash grub_auto_install.sh && sudo ARCH=$(ARCH) bash $(ROOT_PATH)/tools/write_disk_image.sh --bios=legacy && cd .." bash -c "export ARCH=$(ARCH); cd tools && bash grub_auto_install.sh && sudo DADK=$(DADK) ARCH=$(ARCH) bash $(ROOT_PATH)/tools/write_disk_image.sh --bios=legacy && cd .."
# 写入磁盘镜像(uefi) # 写入磁盘镜像(uefi)
write_diskimage-uefi: write_diskimage-uefi: check_arch
bash -c "export ARCH=$(ARCH); cd tools && bash grub_auto_install.sh && sudo ARCH=$(ARCH) bash $(ROOT_PATH)/tools/write_disk_image.sh --bios=uefi && cd .." bash -c "export ARCH=$(ARCH); cd tools && bash grub_auto_install.sh && sudo DADK=$(DADK) ARCH=$(ARCH) bash $(ROOT_PATH)/tools/write_disk_image.sh --bios=uefi && cd .."
# 不编译直接启动QEMU # 不编译直接启动QEMU
qemu: qemu: check_arch
sh -c "cd tools && bash run-qemu.sh --bios=legacy --display=window && cd .." sh -c "cd tools && bash run-qemu.sh --bios=legacy --display=window && cd .."
# 不编译直接启动QEMU,不显示图像 # 不编译直接启动QEMU,不显示图像
qemu-nographic: qemu-nographic: check_arch
sh -c "cd tools && bash run-qemu.sh --bios=legacy --display=nographic && cd .." sh -c "cd tools && bash run-qemu.sh --bios=legacy --display=nographic && cd .."
# 不编译直接启动QEMU(UEFI) # 不编译直接启动QEMU(UEFI)
qemu-uefi: qemu-uefi: check_arch
sh -c "cd tools && bash run-qemu.sh --bios=uefi --display=window && cd .." sh -c "cd tools && bash run-qemu.sh --bios=uefi --display=window && cd .."
# 不编译直接启动QEMU,使用VNC Display作为图像输出 # 不编译直接启动QEMU,使用VNC Display作为图像输出
qemu-vnc: qemu-vnc: check_arch
sh -c "cd tools && bash run-qemu.sh --bios=legacy --display=vnc && cd .." sh -c "cd tools && bash run-qemu.sh --bios=legacy --display=vnc && cd .."
# 不编译直接启动QEMU(UEFI),使用VNC Display作为图像输出 # 不编译直接启动QEMU(UEFI),使用VNC Display作为图像输出
qemu-uefi-vnc: qemu-uefi-vnc: check_arch
sh -c "cd tools && bash run-qemu.sh --bios=uefi --display=vnc && cd .." sh -c "cd tools && bash run-qemu.sh --bios=uefi --display=vnc && cd .."
# 编译并写入磁盘镜像 # 编译并写入磁盘镜像
build: build: check_arch
$(MAKE) all -j $(NPROCS) $(MAKE) all -j $(NPROCS)
$(MAKE) write_diskimage || exit 1 $(MAKE) write_diskimage || exit 1
# 在docker中编译并写入磁盘镜像 # 在docker中编译并写入磁盘镜像
docker: docker: check_arch
@echo "使用docker构建" @echo "使用docker构建"
sudo bash tools/build_in_docker.sh || exit 1 sudo bash tools/build_in_docker.sh || exit 1
$(MAKE) write_diskimage || exit 1 $(MAKE) write_diskimage || exit 1
# uefi方式启动 # uefi方式启动
run-uefi: run-uefi: check_arch
$(MAKE) all -j $(NPROCS) $(MAKE) all -j $(NPROCS)
$(MAKE) write_diskimage-uefi || exit 1 $(MAKE) write_diskimage-uefi || exit 1
$(MAKE) qemu-uefi $(MAKE) qemu-uefi
# 编译并启动QEMU # 编译并启动QEMU
run: run: check_arch
$(MAKE) all -j $(NPROCS) $(MAKE) all -j $(NPROCS)
$(MAKE) write_diskimage || exit 1 $(MAKE) write_diskimage || exit 1
$(MAKE) qemu $(MAKE) qemu
# uefi方式启动使用VNC Display作为图像输出 # uefi方式启动使用VNC Display作为图像输出
run-uefi-vnc: run-uefi-vnc: check_arch
$(MAKE) all -j $(NPROCS) $(MAKE) all -j $(NPROCS)
$(MAKE) write_diskimage-uefi || exit 1 $(MAKE) write_diskimage-uefi || exit 1
$(MAKE) qemu-uefi-vnc $(MAKE) qemu-uefi-vnc
# 编译并启动QEMU使用VNC Display作为图像输出 # 编译并启动QEMU使用VNC Display作为图像输出
run-vnc: run-vnc: check_arch
$(MAKE) all -j $(NPROCS) $(MAKE) all -j $(NPROCS)
$(MAKE) write_diskimage || exit 1 $(MAKE) write_diskimage || exit 1
$(MAKE) qemu-vnc $(MAKE) qemu-vnc
# 在docker中编译并启动QEMU # 在docker中编译并启动QEMU
run-docker: run-docker: check_arch
@echo "使用docker构建并运行" @echo "使用docker构建并运行"
sudo bash tools/build_in_docker.sh || exit 1 sudo bash tools/build_in_docker.sh || exit 1
$(MAKE) write_diskimage || exit 1 $(MAKE) write_diskimage || exit 1
$(MAKE) qemu $(MAKE) qemu
fmt: fmt: check_arch
@echo "格式化代码" @echo "格式化代码"
FMT_CHECK=$(FMT_CHECK) $(MAKE) fmt -C kernel FMT_CHECK=$(FMT_CHECK) $(MAKE) fmt -C kernel
FMT_CHECK=$(FMT_CHECK) $(MAKE) fmt -C user FMT_CHECK=$(FMT_CHECK) $(MAKE) fmt -C user

14
config/rootfs.toml Normal file
View File

@ -0,0 +1,14 @@
[metadata]
# Filesystem type (options: `fat32`)
fs_type = "fat32"
# Size of the rootfs disk image (eg, `1G`, `1024M`)
size = "1G"
[partition]
# Partition type (options: "none", "mbr", "gpt")
#
# If "none" is specified, no partition table will be created,
# and the entire disk will be treated as a single partition.
#
# Note that the "none" option is incompatible with GRUB boot.
type = "mbr"

24
dadk-manifest.toml Normal file
View File

@ -0,0 +1,24 @@
# DADK 总控文件
[metadata]
# Target architecture. Options: x86_64, riscv64
arch = "x86_64"
# Hypervisor config path
hypervisor-config = "config/hypervisor.toml"
# RootFS config path
rootfs-config = "config/rootfs.toml"
# Boot config path
boot-config = "config/boot.toml"
# System root directory folder (DADK will copy the files in this directory to the root directory of the disk image)
sysroot-dir = "bin/sysroot"
# DADK Root Cache directory path
cache-root-dir = "bin/dadk_cache"
# User configuration directory path
# 这个字段只是临时用于兼容旧版本v0.2版本重构完成后会删除
user-config-dir = "user/dadk/config"

View File

@ -10,4 +10,4 @@
:maxdepth: 2 :maxdepth: 2
namespaces/index namespaces/index
filesystem/unionfs/index ../filesystem/unionfs/index

View File

@ -1,5 +1,5 @@
==================================== ====================================
空间 名空间
==================================== ====================================
DragonOS的namespaces目前支持pid_namespace和mnt_namespace 预计之后会继续完善 DragonOS的namespaces目前支持pid_namespace和mnt_namespace 预计之后会继续完善

View File

@ -1,10 +1,10 @@
# 挂载名空间 # 挂载名空间
## 底层架构 ## 底层架构
pcb -> nsproxy -> mnt_namespace pcb -> nsproxy -> mnt_namespace
每一个挂载文件系统都有自立独立的挂载点,表现在数据结构上是一个挂载的红黑树,每一个名空间中挂载是独立的,所以文件系统的挂载和卸载不会影响别的 每一个挂载文件系统都有自立独立的挂载点,表现在数据结构上是一个挂载的红黑树,每一个名空间中挂载是独立的,所以文件系统的挂载和卸载不会影响别的
## 系统调用接口 ## 系统调用接口
@ -14,6 +14,6 @@ pcb -> nsproxy -> mnt_namespace
- unshare - unshare
- 使用 CLONE_NEWPID 标志调用 unshare() 后,后续创建的所有子进程都将在新的命名空间中运行。 - 使用 CLONE_NEWPID 标志调用 unshare() 后,后续创建的所有子进程都将在新的命名空间中运行。
- setns - setns
- 将进程加入到指定的名空间 - 将进程加入到指定的名空间
- chroot - chroot
- 将当前进程的根目录更改为指定的路径,提供文件系统隔离。 - 将当前进程的根目录更改为指定的路径,提供文件系统隔离。

View File

@ -1,8 +1,10 @@
# 进程名空间 # 进程名空间
:::{note} 本文作者:操丰毅 1553389239@qq.com :::{note} 本文作者:操丰毅 1553389239@qq.com
2024年10月30日 ::: 2024年10月30日
pid_namespace 是内核中的一种名称空间用于实现进程隔离允许在不同的名称空间中运行的进程有独立的pid试图 :::
pid_namespace 是内核中的一种命名空间用于实现进程隔离允许在不同的命名空间中运行的进程有独立的pid视图
## 底层架构 ## 底层架构

View File

@ -9,3 +9,4 @@
traceback traceback
debug-kernel-with-gdb debug-kernel-with-gdb
profiling-kernel-with-dadk

View File

@ -0,0 +1,95 @@
# 使用DADK对内核进行性能分析
## 1. 概述
本文将教你使用DADK对DragonOS内核进行性能分析以识别和解决潜在的性能瓶颈。
### 1.1 准备工作
::: {note}
在开始之前请确保你已经安装了DADK并且已经配置好了DragonOS内核的编译环境。
:::
### 1.2 什么是火焰图?
如果你没有听说过火焰图,可以先阅读这篇文章:[《如何读懂火焰图?- 阮一峰》](https://www.ruanyifeng.com/blog/2017/09/flame-graph.html)
简单的说,火焰图是基于性能采样结果产生的 SVG 图片,用来展示 CPU 的调用栈。
![](https://web-static2.dragonos.org.cn//longjin/flame2.svg?imageSlim)
x 轴表示抽样数,如果一个函数在 x 轴占据的宽度越宽就表示它被抽到的次数多即执行的时间长。注意x 轴不代表时间,而是所有的调用栈合并后,按字母顺序排列的。
火焰图就是看顶层的哪个函数占据的宽度最大。只要有"平顶"plateaus就表示该函数可能存在性能问题。
颜色没有特殊含义,因为火焰图表示的是 CPU 的繁忙程度,所以一般选择暖色调。
## 2. 配置DragonOS内核
由于性能分析需要详尽的符号表数据,因此我们需要在编译内核时,需要进行以下配置:
`kernel/Cargo.toml`中的`[profile.release]`部分,设置以下两项:
```toml
[profile.release]
debug = true
opt-level = 1
```
这样,编译出来的内核就会包含符号表数据,方便我们进行性能分析。
## 3. 使用DADK进行性能分析
### 3.1 启动内核
首先我们需要启动DragonOS内核。
```shell
# 使用你喜欢的方式启动内核,例如:
make run
# 或者
make build && make qemu-nographic
```
### 3.2 运行你的工作负载
在启动内核后,我们需要运行一些工作负载,以便进行性能分析。
这可以是一个应用程序也可以是别的东西。甚至你可以什么都不运行只是单纯看看DragonOS内核在空闲时的调用栈情况。
### 3.3 启动DADK进行性能分析
在DragonOS项目目录下运行以下命令
```shell
dadk profile sample --format flamegraph --output flame.svg --interval 200ms --duration 20s --cpu-mask 0x1
```
上面的命令将会对DragonOS内核进行性能分析并生成一个火焰图。
详细解释:
- `--format flamegraph`:指定输出格式为火焰图。
- `--output flame.svg`:指定输出文件名为`flame.svg`
- `--interval 200ms`指定采样间隔为200ms。
- `--duration 20s`指定采样时间为20s。
- `--cpu-mask 0x1`指定采样的CPU为0号CPU。这是个按位掩码也就是说如果要采样0和1号CPU那么cpu-mask为0x3
*更多参数请参考`dadk profile sample --help`.*
::: {note}
由于采样时会暂停vCPU因此采样时间不宜过短否则会影响系统的正常运行。
:::
经过一段时间的等待,你将会得到一个`flame.svg`文件。
### 3.4 分析火焰图
使用浏览器打开`flame.svg`文件,你将会看到一个火焰图。
你可以通过点击火焰图中的某个函数,来查看它的调用栈。
**你可以右键下面的图片,在新的标签页打开,体验交互效果。**
![](https://web-static2.dragonos.org.cn//longjin/flame2.svg?imageSlim)

View File

@ -13,3 +13,6 @@ musl-gcc -static -o hello hello.c
在移植现有程序时,可能需要配置`CFLAGS``LDFLAGS`,以及`CPPFLAGS`,以便正确地编译,具体请以实际为准。 在移植现有程序时,可能需要配置`CFLAGS``LDFLAGS`,以及`CPPFLAGS`,以便正确地编译,具体请以实际为准。
## 配置dadk
请参考:[Quick Start | DADK](https://docs.dragonos.org.cn/p/dadk/user-manual/quickstart.html)

View File

@ -8,3 +8,5 @@
rust-quick-start rust-quick-start
c-cpp-quick-start c-cpp-quick-start
快速使用DADK打包一个应用到DragonOS <https://docs.dragonos.org.cn/p/dadk/user-manual/quickstart.html>
DADK完整文档 <https://docs.dragonos.org.cn/p/dadk/>

View File

@ -2,19 +2,14 @@
## 编译环境 ## 编译环境
&emsp;&emsp;DragonOS与Linux具有部分二进制兼容性因此可以使用Linux的Rust编译器进行编译但是需要进行一些配置 &emsp;&emsp;DragonOS与Linux具有部分二进制兼容性因此可以使用Linux的Rust编译器进行编译。
您可以参考DragonOS的`tools/bootstrap.sh`中,`initialize_userland_musl_toolchain()`函数的实现,进行配置。
或者只要运行一下bootstrap.sh就可以了。
主要是因为DragonOS还不支持动态链接但是默认的工具链里面包含了动态链接解释器相关的代码因此像脚本内那样进行替换就能运行。
## 配置项目 ## 配置项目
### 从模板创建 ### 从模板创建
:::{note} :::{note}
该功能需要dadk 0.1.4及以上版本方能支持 该功能需要dadk 0.2.0及以上版本方能支持。旧版的请参考历史版本的DragonOS文档。
::: :::
1. 使用DragonOS的tools目录下的`bootstrap.sh`脚本初始化环境 1. 使用DragonOS的tools目录下的`bootstrap.sh`脚本初始化环境
@ -30,7 +25,7 @@ cargo generate --git https://git.mirrors.dragonos.org/DragonOS-Community/Rust-Ap
``` ```
4. 使用`cargo run`来运行项目 4. 使用`cargo run`来运行项目
5. 在DragonOS的`user/dadk/config`目录下,使用`dadk new`命令,创建编译配置,安装到DragonOS的`/`目录下。 5. 在DragonOS的`user/dadk/config`目录下,参考模版[userapp_config.toml](https://github.com/DragonOS-Community/DADK/blob/main/dadk-config/templates/config/userapp_config.toml),创建编译配置,安装到DragonOS的`/`目录下。
(在dadk的编译命令选项处请使用Makefile里面的`make install`配置进行编译、安装) (在dadk的编译命令选项处请使用Makefile里面的`make install`配置进行编译、安装)
6. 编译DragonOS即可安装 6. 编译DragonOS即可安装

3
env.mk
View File

@ -8,3 +8,6 @@ endif
ifeq ($(EMULATOR), ) ifeq ($(EMULATOR), )
export EMULATOR=__NO_EMULATION__ export EMULATOR=__NO_EMULATION__
endif endif
export DADK?=$(shell which dadk)

View File

@ -15,9 +15,9 @@ members = [
] ]
[features] [features]
default = ["backtrace", "kvm", "fatfs", "fatfs-secure"] default = ["backtrace", "kvm", "fatfs", "fatfs-secure", "static_keys_test"]
# 内核栈回溯 # 内核栈回溯
backtrace = [] backtrace = ["dep:unwinding"]
# kvm # kvm
kvm = [] kvm = []
@ -27,6 +27,7 @@ driver_ps2_mouse = []
# kprobe # kprobe
kprobe_test = [] kprobe_test = []
static_keys_test = []
# 运行时依赖项 # 运行时依赖项
[dependencies] [dependencies]
@ -67,9 +68,17 @@ lru = "0.12.3"
rbpf = { path = "crates/rbpf" } rbpf = { path = "crates/rbpf" }
printf-compat = { version = "0.1.1", default-features = false } printf-compat = { version = "0.1.1", default-features = false }
static-keys = "=0.6.1"
unwinding = { git = "https://git.mirrors.dragonos.org.cn/DragonOS-Community/unwinding", rev = "4eb845da62", default-features = false, optional = true, features = [
"unwinder",
"fde-gnu-eh-frame-hdr",
"panic",
"personality"
]}
# target为x86_64时使用下面的依赖 # target为x86_64时使用下面的依赖
[target.'cfg(target_arch = "x86_64")'.dependencies] [target.'cfg(target_arch = "x86_64")'.dependencies]
mini-backtrace = { git = "https://git.mirrors.dragonos.org.cn/DragonOS-Community/mini-backtrace.git", rev = "e0b1d90940" }
multiboot2 = { git = "https://git.mirrors.dragonos.org.cn/DragonOS-Community/multiboot2", rev = "05739aab40" } multiboot2 = { git = "https://git.mirrors.dragonos.org.cn/DragonOS-Community/multiboot2", rev = "05739aab40" }
raw-cpuid = "11.0.1" raw-cpuid = "11.0.1"
x86 = "=0.52.0" x86 = "=0.52.0"

View File

@ -6,7 +6,7 @@ include ./env.mk
ifeq ($(ARCH), x86_64) ifeq ($(ARCH), x86_64)
export TARGET_JSON=arch/x86_64/x86_64-unknown-none.json export TARGET_JSON=arch/x86_64/x86_64-unknown-none.json
else ifeq ($(ARCH), riscv64) else ifeq ($(ARCH), riscv64)
export TARGET_JSON=riscv64gc-unknown-none-elf export TARGET_JSON=arch/riscv64/riscv64gc-unknown-none-elf.json
endif endif
export CARGO_ZBUILD=-Z build-std=core,alloc,compiler_builtins -Z build-std-features=compiler-builtins-mem export CARGO_ZBUILD=-Z build-std=core,alloc,compiler_builtins -Z build-std-features=compiler-builtins-mem
@ -27,19 +27,13 @@ clean:
fmt: fmt:
RUSTFLAGS="$(RUSTFLAGS)" cargo fmt --all $(FMT_CHECK) RUSTFLAGS="$(RUSTFLAGS)" cargo fmt --all $(FMT_CHECK)
ifeq ($(ARCH), x86_64) ifeq ($(ARCH), x86_64)
RUSTFLAGS="$(RUSTFLAGS)" cargo clippy --all-features RUSTFLAGS="$(RUSTFLAGS)" cargo +nightly-2024-11-05 clippy --all-features
endif endif
.PHONY: check .PHONY: check
check: ECHO check: ECHO
# @echo "Checking kernel... ARCH=$(ARCH)" $(MAKE) -C src check ARCH=$(ARCH)
# @exit 1
ifeq ($(ARCH), x86_64)
RUSTFLAGS="$(RUSTFLAGS)" cargo +nightly-2024-11-05 check --workspace $(CARGO_ZBUILD) --message-format=json --target ./src/$(TARGET_JSON)
else ifeq ($(ARCH), riscv64)
RUSTFLAGS="$(RUSTFLAGS)" cargo +nightly-2024-11-05 check --workspace $(CARGO_ZBUILD) --message-format=json --target $(TARGET_JSON)
endif
test: test:
# 测试内核库 # 测试内核库

View File

@ -2,6 +2,8 @@
//! 然后在当前目录执行 `cargo expand --bin unified-init-expand` //! 然后在当前目录执行 `cargo expand --bin unified-init-expand`
//! 就可以看到把proc macro展开后的代码了 //! 就可以看到把proc macro展开后的代码了
#![no_std] #![no_std]
#![allow(internal_features)]
#![feature(lang_items)]
fn main() { fn main() {
todo!() todo!()
@ -14,6 +16,10 @@ pub fn panic(_info: &core::panic::PanicInfo) -> ! {
loop {} loop {}
} }
#[cfg(target_os = "none")]
#[lang = "eh_personality"]
unsafe extern "C" fn eh_personality() {}
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use system_error::SystemError; use system_error::SystemError;

View File

@ -15,10 +15,8 @@ LDFLAGS_UNWIND =
RUSTFLAGS_UNWIND = RUSTFLAGS_UNWIND =
ifeq ($(UNWIND_ENABLE), yes) ifeq ($(UNWIND_ENABLE), yes)
CFLAGS_UNWIND = -funwind-tables CFLAGS_UNWIND = -funwind-tables
ifeq ($(ARCH), x86_64)
LDFLAGS_UNWIND = --eh-frame-hdr LDFLAGS_UNWIND = --eh-frame-hdr
RUSTFLAGS_UNWIND = -Cforce-unwind-tables -Clink-arg=-Wl,eh_frame.ld RUSTFLAGS_UNWIND = -Cforce-unwind-tables -Clink-arg=-Wl,eh_frame.ld -Cpanic=unwind
endif
endif endif
RUSTFLAGS += $(RUSTFLAGS_UNWIND) RUSTFLAGS += $(RUSTFLAGS_UNWIND)
@ -58,7 +56,6 @@ ECHO:
@echo "$@" @echo "$@"
$(kernel_subdirs): ECHO $(kernel_subdirs): ECHO
$(MAKE) -C $@ all CFLAGS="$(CFLAGS)" ASFLAGS="$(ASFLAGS)" kernel_root_path="$(shell pwd)" $(MAKE) -C $@ all CFLAGS="$(CFLAGS)" ASFLAGS="$(ASFLAGS)" kernel_root_path="$(shell pwd)"
kernel: $(kernel_subdirs) kernel_rust kernel: $(kernel_subdirs) kernel_rust
@ -66,7 +63,26 @@ kernel: $(kernel_subdirs) kernel_rust
__link_riscv64_kernel: __link_riscv64_kernel:
@echo "Linking kernel..." @echo "Linking kernel..."
$(LD) -b elf64-littleriscv -z muldefs $(LDFLAGS_UNWIND) -o kernel $(shell find . -name "*.o") ../target/riscv64gc-unknown-none-elf/release/libdragonos_kernel.a -T arch/riscv64/link.ld --no-relax $(LD) -b elf64-littleriscv -z muldefs $(LDFLAGS_UNWIND) -o kernel $(shell find . -name "*.o") ../target/riscv64gc-unknown-none-elf/release/libdragonos_kernel.a -T arch/riscv64/link.ld --no-relax
# 生成kallsyms
current_dir=$(pwd)
@dbg='debug';for x in $$dbg; do \
cd $$x;\
$(MAKE) generate_kallsyms kernel_root_path="$(shell pwd)"||exit 1;\
cd ..;\
done
# 重新链接
@echo "Re-Linking kernel..."
@echo $(shell find . -name "*.o")
$(LD) -b elf64-littleriscv -z muldefs $(LDFLAGS_UNWIND) -o kernel $(shell find . -name "*.o") ../target/riscv64gc-unknown-none-elf/release/libdragonos_kernel.a ./debug/kallsyms.o -T arch/riscv64/link.ld --no-relax
@echo "Generating kernel ELF file..."
ifeq ($(UNWIND_ENABLE), yes)
$(OBJCOPY) -I elf64-littleriscv -O elf64-littleriscv kernel ../../bin/kernel/kernel.elf
else
$(OBJCOPY) -I elf64-littleriscv -O elf64-littleriscv -R ".eh_frame" kernel ../../bin/kernel/kernel.elf $(OBJCOPY) -I elf64-littleriscv -O elf64-littleriscv -R ".eh_frame" kernel ../../bin/kernel/kernel.elf
endif
@rm kernel @rm kernel
$(MAKE) __dragon_stub PAYLOAD_ELF="$(shell pwd)/../../bin/kernel/kernel.elf" $(MAKE) __dragon_stub PAYLOAD_ELF="$(shell pwd)/../../bin/kernel/kernel.elf"
@ -111,3 +127,7 @@ clean:
cd $$subdir && $(MAKE) clean;\ cd $$subdir && $(MAKE) clean;\
cd .. ;\ cd .. ;\
done done
.PHONY: check
check:
RUSTFLAGS="$(RUSTFLAGS)" cargo +nightly-2024-11-05 $(CARGO_ZBUILD) check --workspace --message-format=json --target $(TARGET_JSON)

View File

@ -28,6 +28,7 @@ SECTIONS
. = ALIGN(4096); . = ALIGN(4096);
text_start_pa = .; text_start_pa = .;
__executable_start = .;
.text (text_start_pa): AT(text_start_pa - KERNEL_VMA) .text (text_start_pa): AT(text_start_pa - KERNEL_VMA)
{ {
_text = .; _text = .;
@ -39,6 +40,7 @@ SECTIONS
*(.text.*) *(.text.*)
_etext = .; _etext = .;
__etext = .;
} }
. = ALIGN(32768); . = ALIGN(32768);
data_start_pa = .; data_start_pa = .;
@ -60,6 +62,7 @@ SECTIONS
_rodata = .; _rodata = .;
*(.rodata) *(.rodata)
*(.rodata.*) *(.rodata.*)
*(.gcc_except_table .gcc_except_table.*)
_erodata = .; _erodata = .;
} }

View File

@ -0,0 +1,28 @@
{
"arch": "riscv64",
"code-model": "medium",
"cpu": "generic-rv64",
"crt-objects-fallback": "false",
"data-layout": "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128",
"eh-frame-header": false,
"emit-debug-gdb-scripts": false,
"features": "+m,+a,+f,+d,+c",
"linker": "rust-lld",
"linker-flavor": "gnu-lld",
"llvm-abiname": "lp64d",
"llvm-target": "riscv64",
"max-atomic-width": 64,
"metadata": {
"description": "Bare RISC-V (RV64IMAFDC ISA)",
"host_tools": false,
"std": false,
"tier": 2
},
"panic-strategy": "abort",
"relocation-model": "static",
"supported-sanitizers": [
"shadow-call-stack",
"kernel-address"
],
"target-pointer-width": "64"
}

View File

@ -35,9 +35,17 @@ pub(super) fn syscall_handler(syscall_num: usize, frame: &mut TrapFrame) -> () {
} }
let args = [frame.a0, frame.a1, frame.a2, frame.a3, frame.a4, frame.a5]; let args = [frame.a0, frame.a1, frame.a2, frame.a3, frame.a4, frame.a5];
syscall_return!( let mut syscall_handle = || -> usize {
Syscall::handle(syscall_num, &args, frame).unwrap_or_else(|e| e.to_posix_errno() as usize), #[cfg(feature = "backtrace")]
frame, {
false Syscall::catch_handle(syscall_num, &args, frame)
); .unwrap_or_else(|e| e.to_posix_errno() as usize)
}
#[cfg(not(feature = "backtrace"))]
{
Syscall::handle(syscall_num, &args, frame)
.unwrap_or_else(|e| e.to_posix_errno() as usize)
}
};
syscall_return!(syscall_handle(), frame, false);
} }

View File

@ -26,6 +26,7 @@ SECTIONS
. = ALIGN(32768); . = ALIGN(32768);
. += KERNEL_VMA; . += KERNEL_VMA;
text_start_pa = .; text_start_pa = .;
__executable_start = .;
.text (text_start_pa): AT(text_start_pa - KERNEL_VMA) .text (text_start_pa): AT(text_start_pa - KERNEL_VMA)
{ {
_text = .; _text = .;
@ -37,6 +38,7 @@ SECTIONS
*(.text.*) *(.text.*)
_etext = .; _etext = .;
__etext = .;
} }
. = ALIGN(32768); . = ALIGN(32768);
data_start_pa = .; data_start_pa = .;
@ -59,6 +61,7 @@ SECTIONS
*(.rodata.*) *(.rodata.*)
*(.note.gnu.*) *(.note.gnu.*)
*(.fixup) *(.fixup)
*(.gcc_except_table .gcc_except_table.*)
_erodata = .; _erodata = .;
} }

View File

@ -151,7 +151,19 @@ pub extern "sysv64" fn syscall_handler(frame: &mut TrapFrame) {
} }
_ => {} _ => {}
} }
normal_syscall_return!(Syscall::handle(syscall_num, &args, frame), frame, show); let mut syscall_handle = || -> u64 {
#[cfg(feature = "backtrace")]
{
Syscall::catch_handle(syscall_num, &args, frame)
.unwrap_or_else(|e| e.to_posix_errno() as usize) as u64
}
#[cfg(not(feature = "backtrace"))]
{
Syscall::handle(syscall_num, &args, frame)
.unwrap_or_else(|e| e.to_posix_errno() as usize) as u64
}
};
syscall_return!(syscall_handle(), frame, show);
} }
/// 系统调用初始化 /// 系统调用初始化

View File

@ -0,0 +1,28 @@
#[cfg(feature = "static_keys_test")]
mod tests {
use static_keys::{define_static_key_false, static_branch_unlikely};
define_static_key_false!(MY_STATIC_KEY);
#[inline(always)]
fn foo() {
println!("Entering foo function");
if static_branch_unlikely!(MY_STATIC_KEY) {
println!("A branch");
} else {
println!("B branch");
}
}
pub(super) fn static_keys_test() {
foo();
unsafe {
MY_STATIC_KEY.enable();
}
foo();
}
}
pub fn static_keys_init() {
static_keys::global_init();
#[cfg(feature = "static_keys_test")]
tests::static_keys_test();
}

View File

@ -1,2 +1,4 @@
pub mod jump_label;
pub mod klog; pub mod klog;
pub mod kprobe; pub mod kprobe;
pub mod panic;

View File

@ -0,0 +1,27 @@
use unwinding::abi::{UnwindContext, UnwindReasonCode, _Unwind_GetIP};
use unwinding::panic::UserUnwindTrace;
extern "C" {
fn lookup_kallsyms(addr: u64, level: i32) -> i32;
}
/// User hook for unwinding
///
/// During stack backtrace, the user can print the function location of the current stack frame.
pub struct Tracer;
pub struct CallbackData {
pub counter: usize,
}
impl UserUnwindTrace for Tracer {
type Arg = CallbackData;
fn trace(ctx: &UnwindContext<'_>, arg: *mut Self::Arg) -> UnwindReasonCode {
let data = unsafe { &mut *(arg) };
data.counter += 1;
let pc = _Unwind_GetIP(ctx);
unsafe {
lookup_kallsyms(pc as u64, data.counter as i32);
}
UnwindReasonCode::NO_REASON
}
}

View File

@ -0,0 +1,46 @@
#[cfg(feature = "backtrace")]
mod hook;
use core::panic::PanicInfo;
/// 全局的panic处理函数
///
#[cfg(target_os = "none")]
#[panic_handler]
#[no_mangle]
pub fn panic(info: &PanicInfo) -> ! {
use log::error;
use crate::process;
error!("Kernel Panic Occurred.");
match info.location() {
Some(loc) => {
println!(
"Location:\n\tFile: {}\n\tLine: {}, Column: {}",
loc.file(),
loc.line(),
loc.column()
);
}
None => {
println!("No location info");
}
}
println!("Message:\n\t{}", info.message());
#[cfg(feature = "backtrace")]
{
let mut data = hook::CallbackData { counter: 0 };
println!("Rust Panic Backtrace:");
let _res = unwinding::panic::begin_panic_with_hook::<hook::Tracer>(
alloc::boxed::Box::new(()),
&mut data,
);
// log::error!("panic unreachable: {:?}", res.0);
}
println!(
"Current PCB:\n\t{:?}",
process::ProcessManager::current_pcb()
);
process::ProcessManager::exit(usize::MAX);
}

View File

@ -57,6 +57,7 @@ fn do_start_kernel() {
unsafe { mm_init() }; unsafe { mm_init() };
// crate::debug::jump_label::static_keys_init();
if scm_reinit().is_ok() { if scm_reinit().is_ok() {
if let Err(e) = textui_init() { if let Err(e) = textui_init() {
warn!("Failed to init textui: {:?}", e); warn!("Failed to init textui: {:?}", e);
@ -90,6 +91,7 @@ fn do_start_kernel() {
clocksource_boot_finish(); clocksource_boot_finish();
Futex::init(); Futex::init();
crate::bpf::init_bpf_system(); crate::bpf::init_bpf_system();
crate::debug::jump_label::static_keys_init();
#[cfg(all(target_arch = "x86_64", feature = "kvm"))] #[cfg(all(target_arch = "x86_64", feature = "kvm"))]
crate::virt::kvm::kvm_init(); crate::virt::kvm::kvm_init();
} }

View File

@ -17,6 +17,7 @@
#![feature(sync_unsafe_cell)] #![feature(sync_unsafe_cell)]
#![feature(vec_into_raw_parts)] #![feature(vec_into_raw_parts)]
#![feature(c_variadic)] #![feature(c_variadic)]
#![feature(asm_goto)]
#![cfg_attr(target_os = "none", no_std)] #![cfg_attr(target_os = "none", no_std)]
#![allow(static_mut_refs, non_local_definitions, internal_features)] #![allow(static_mut_refs, non_local_definitions, internal_features)]
// clippy的配置 // clippy的配置
@ -36,8 +37,6 @@
#[macro_use] #[macro_use]
extern crate std; extern crate std;
use core::panic::PanicInfo;
/// 导出x86_64架构相关的代码命名为arch模块 /// 导出x86_64架构相关的代码命名为arch模块
#[macro_use] #[macro_use]
mod arch; mod arch;
@ -93,56 +92,6 @@ extern crate wait_queue_macros;
use crate::mm::allocator::kernel_allocator::KernelAllocator; use crate::mm::allocator::kernel_allocator::KernelAllocator;
#[cfg(all(feature = "backtrace", target_arch = "x86_64"))]
extern crate mini_backtrace;
extern "C" {
fn lookup_kallsyms(addr: u64, level: i32) -> i32;
}
// 声明全局的分配器 // 声明全局的分配器
#[cfg_attr(not(test), global_allocator)] #[cfg_attr(not(test), global_allocator)]
pub static KERNEL_ALLOCATOR: KernelAllocator = KernelAllocator; pub static KERNEL_ALLOCATOR: KernelAllocator = KernelAllocator;
/// 全局的panic处理函数
#[cfg(target_os = "none")]
#[panic_handler]
#[no_mangle]
pub fn panic(info: &PanicInfo) -> ! {
use log::error;
use process::ProcessManager;
error!("Kernel Panic Occurred.");
match info.location() {
Some(loc) => {
println!(
"Location:\n\tFile: {}\n\tLine: {}, Column: {}",
loc.file(),
loc.line(),
loc.column()
);
}
None => {
println!("No location info");
}
}
println!("Message:\n\t{}", info.message());
#[cfg(all(feature = "backtrace", target_arch = "x86_64"))]
{
unsafe {
let bt = mini_backtrace::Backtrace::<16>::capture();
println!("Rust Panic Backtrace:");
let mut level = 0;
for frame in bt.frames {
lookup_kallsyms(frame as u64, level);
level += 1;
}
};
}
println!("Current PCB:\n\t{:?}", (ProcessManager::current_pcb()));
ProcessManager::exit(usize::MAX);
}

View File

@ -74,6 +74,20 @@ impl Syscall {
return r; return r;
} }
/// 系统调用分发器,用于分发系统调用。
///
/// 与[handle]不同这个函数会捕获系统调用处理函数的panic返回错误码。
#[cfg(feature = "backtrace")]
pub fn catch_handle(
syscall_num: usize,
args: &[usize],
frame: &mut TrapFrame,
) -> Result<usize, SystemError> {
let res = unwinding::panic::catch_unwind(|| Self::handle(syscall_num, args, frame));
res.unwrap_or_else(|_| loop {
core::hint::spin_loop();
})
}
/// @brief 系统调用分发器,用于分发系统调用。 /// @brief 系统调用分发器,用于分发系统调用。
/// ///
/// 这个函数内,需要根据系统调用号,调用对应的系统调用处理函数。 /// 这个函数内,需要根据系统调用号,调用对应的系统调用处理函数。

View File

@ -1 +1 @@
v1.6 v1.7

40
tools/check_arch.sh Normal file
View File

@ -0,0 +1,40 @@
#!/bin/bash
BASE_PATH=$(pwd)
# 定义错误信息
ARCH_MISMATCH_ERROR="Error: ARCH in env.mk does not match arch in dadk-manifest.toml"
if [ -z "$ARCH" ]; then
echo "Error: ARCH environment variable is not set." >&2
exit 1
fi
# Check if ROOT_PATH is set
if [ -n "$ROOT_PATH" ]; then
CHECK_PATH="$ROOT_PATH"
else
# Check if the current directory name is "tools"
if [ "$(basename "$BASE_PATH")" = "tools" ]; then
# Try the parent directory's dadk-manifest
CHECK_PATH=$(dirname "$BASE_PATH")/
else
# Otherwise, check the current directory
CHECK_PATH="$BASE_PATH"
fi
fi
echo "Checking $CHECK_PATH"
# 读取dadk-manifest.toml文件中的arch字段
DADK_ARCH=$(grep -oP '(?<=arch = ")[^"]+' $CHECK_PATH/dadk-manifest.toml)
# 检查arch字段是否为x86_64
if [ "$ARCH" != $DADK_ARCH ]; then
echo "$ARCH_MISMATCH_ERROR" >&2
exit 1
else
echo "Arch check passed."
exit 0
fi

View File

@ -1,27 +0,0 @@
# ======检查是否以sudo运行=================
uid=`id -u`
if [ ! $uid == "0" ];then
echo "请以sudo权限运行"
exit
fi
# 检查是否设置ARCH环境变量
if [ ! ${ARCH} ];then
echo "请设置ARCH环境变量"
exit
fi
DISK_NAME=disk-${ARCH}.img
echo "Mounting virtual disk image '${DISK_NAME}'..."
LOOP_DEVICE=$(losetup -f --show -P ../bin/${DISK_NAME}) \
|| exit 1
echo ${LOOP_DEVICE}p1
mkdir -p ../bin/disk_mount/
mount ${LOOP_DEVICE}p1 ../bin/disk_mount/
lsblk

View File

@ -65,7 +65,7 @@ UBOOT_VERSION="v2023.10"
RISCV64_UBOOT_PATH="arch/riscv64/u-boot-${UBOOT_VERSION}-riscv64" RISCV64_UBOOT_PATH="arch/riscv64/u-boot-${UBOOT_VERSION}-riscv64"
DISK_NAME="disk-${ARCH}.img" DISK_NAME="disk-image-${ARCH}.img"
QEMU=qemu-system-${ARCH} QEMU=qemu-system-${ARCH}
QEMU_DISK_IMAGE="../bin/${DISK_NAME}" QEMU_DISK_IMAGE="../bin/${DISK_NAME}"

View File

@ -1,19 +0,0 @@
# ======检查是否以sudo运行=================
uid=`id -u`
if [ ! $uid == "0" ];then
echo "请以sudo权限运行"
exit
fi
if [ ! ${ARCH} ];then
echo "请设置ARCH环境变量"
exit
fi
DISK_NAME=disk-${ARCH}.img
LOOP_DEVICE=$(lsblk | grep disk_mount|sed 's/.*\(loop[0-9]*\)p1.*/\1/1g'|awk 'END{print $0}')
umount -f ../bin/disk_mount/
losetup -d /dev/$LOOP_DEVICE
echo $LOOP_DEVICE

View File

@ -1,5 +1,5 @@
############################################### ###############################################
# 该脚本用于将disk_mount目录下的文件写入到disk-${ARCH}.img的第一个分区中, # 该脚本用于将文件拷贝到磁盘镜像中,
# 并在磁盘镜像中安装grub引导程序 # 并在磁盘镜像中安装grub引导程序
# #
# 用法bash write_disk_image.sh --bios legacy/uefi # 用法bash write_disk_image.sh --bios legacy/uefi
@ -11,15 +11,16 @@
echo "ARCH=${ARCH}" echo "ARCH=${ARCH}"
# 给ARCH变量赋默认值 # 给ARCH变量赋默认值
export ARCH=${ARCH:=x86_64} export ARCH=${ARCH:=x86_64}
export DADK=${DADK:=dadk}
DISK_NAME=disk-${ARCH}.img
# 内核映像 # 内核映像
root_folder=$(dirname $(pwd)) root_folder=$(dirname $(pwd))
kernel="${root_folder}/bin/kernel/kernel.elf" kernel="${root_folder}/bin/kernel/kernel.elf"
boot_folder="${root_folder}/bin/disk_mount/boot" mount_folder=$($DADK -w $root_folder rootfs show-mountpoint || exit 1)
boot_folder="${mount_folder}/boot"
GRUB_INSTALL_PATH="${boot_folder}/grub" GRUB_INSTALL_PATH="${boot_folder}/grub"
mount_folder="${root_folder}/bin/disk_mount"
ARGS=`getopt -o p -l bios: -- "$@"` ARGS=`getopt -o p -l bios: -- "$@"`
eval set -- "${ARGS}" eval set -- "${ARGS}"
#echo formatted parameters=[$@] #echo formatted parameters=[$@]
@ -67,34 +68,17 @@ if [ ${ARCH} == "i386" ] || [ ${ARCH} == "x86_64" ]; then
fi fi
fi fi
# 判断是否存在硬盘镜像文件,如果不存在,就创建一个(docker模式下由于镜像中缺少qemu-img不会创建) # 判断是否存在硬盘镜像文件,如果不存在,就创建一个
if [ ! -f "${root_folder}/bin/${DISK_NAME}" ]; then
echo "创建硬盘镜像文件..." echo "创建硬盘镜像文件..."
case "$1" in $DADK -w $root_folder rootfs create --skip-if-exists || exit 1
--bios)
case "$2" in
uefi)
sudo ARCH=${ARCH} bash ./create_hdd_image.sh -P MBR #GPT分区 用GPT分区uefi启动不了 内核没有针对gpt分区表来做处理
;;
legacy)
sudo ARCH=${ARCH} bash ./create_hdd_image.sh -P MBR #MBR分区
;;
esac
;;
*)
# 默认创建MBR分区
sudo ARCH=${ARCH} bash ./create_hdd_image.sh -P MBR #MBR分区
;;
esac
fi
# 拷贝程序到硬盘 $DADK -w $root_folder rootfs mount || exit 1
mkdir -p ${root_folder}/bin/disk_mount
bash mount_virt_disk.sh || exit 1
LOOP_DEVICE=$(lsblk | grep disk_mount|sed 's/.*\(loop[0-9]*\)p1.*/\1/1g'|awk 'END{print $0}')
LOOP_DEVICE=$($DADK -w $root_folder rootfs show-loop-device || exit 1)
echo $LOOP_DEVICE echo $LOOP_DEVICE
echo ${mount_folder}
# mkdir -p ${GRUB_INSTALL_PATH} # mkdir -p ${GRUB_INSTALL_PATH}
# 检测grub文件夹是否存在 # 检测grub文件夹是否存在
@ -107,21 +91,20 @@ fi
if [ ${ARCH} == "i386" ] || [ ${ARCH} == "x86_64" ]; then if [ ${ARCH} == "i386" ] || [ ${ARCH} == "x86_64" ]; then
cp ${kernel} ${root_folder}/bin/disk_mount/boot/ cp ${kernel} ${mount_folder}/boot/
fi fi
# 拷贝用户程序到磁盘镜像 # 拷贝用户程序到磁盘镜像
mkdir -p ${root_folder}/bin/disk_mount/bin mkdir -p ${mount_folder}/bin
mkdir -p ${root_folder}/bin/disk_mount/dev mkdir -p ${mount_folder}/dev
mkdir -p ${root_folder}/bin/disk_mount/proc mkdir -p ${mount_folder}/proc
mkdir -p ${root_folder}/bin/disk_mount/usr mkdir -p ${mount_folder}/usr
touch ${root_folder}/bin/disk_mount/dev/keyboard.dev cp -r ${root_folder}/bin/sysroot/* ${mount_folder}/
cp -r ${root_folder}/bin/sysroot/* ${root_folder}/bin/disk_mount/
# 设置 grub 相关数据 # 设置 grub 相关数据
if [ ${ARCH} == "i386" ] || [ ${ARCH} == "x86_64" ]; then if [ ${ARCH} == "i386" ] || [ ${ARCH} == "x86_64" ]; then
touch ${root_folder}/bin/disk_mount/boot/grub/grub.cfg touch ${mount_folder}/boot/grub/grub.cfg
cfg_content='set timeout=15 cfg_content='set timeout=15
set default=0 set default=0
insmod efi_gop insmod efi_gop
@ -154,7 +137,7 @@ if [ "${INSTALL_GRUB_TO_IMAGE}" = "1" ];then
;; ;;
legacy) #传统bios legacy) #传统bios
if [ ${ARCH} == "x86_64" ];then if [ ${ARCH} == "x86_64" ];then
${GRUB_PATH_I386_LEGACY_INSTALL} --target=i386-pc --boot-directory=${boot_folder} /dev/$LOOP_DEVICE ${GRUB_PATH_I386_LEGACY_INSTALL} --target=i386-pc --boot-directory=${boot_folder} $LOOP_DEVICE
elif [ ${ARCH} == "riscv64" ];then elif [ ${ARCH} == "riscv64" ];then
install_riscv64_efi install_riscv64_efi
else else
@ -165,11 +148,12 @@ if [ "${INSTALL_GRUB_TO_IMAGE}" = "1" ];then
;; ;;
*) *)
#传统bios #传统bios
${GRUB_PATH_I386_LEGACY_INSTALL} --target=i386-pc --boot-directory=${boot_folder} /dev/$LOOP_DEVICE ${GRUB_PATH_I386_LEGACY_INSTALL} --target=i386-pc --boot-directory=${boot_folder} $LOOP_DEVICE
;; ;;
esac esac
fi fi
sync sync
bash umount_virt_disk.sh
$DADK -w $root_folder rootfs umount || exit 1

View File

@ -1,13 +1,8 @@
user_sub_dirs = apps user_sub_dirs = apps
SUBDIR_ROOTS := .
DIRS := . $(shell find $(SUBDIR_ROOTS) -type d)
GARBAGE_PATTERNS := *.o *.a
GARBAGE := $(foreach DIR,$(DIRS),$(addprefix $(DIR)/,$(GARBAGE_PATTERNS)))
DADK_VERSION=$(shell dadk -V | awk 'END {print $$2}') DADK_VERSION=$(shell dadk -V | awk 'END {print $$2}')
# 最小的DADK版本 # 最小的DADK版本
MIN_DADK_VERSION = 0.1.11 MIN_DADK_VERSION = 0.2.0
DADK_CACHE_DIR = $(ROOT_PATH)/bin/dadk_cache DADK_CACHE_DIR = $(ROOT_PATH)/bin/dadk_cache
ECHO: ECHO:
@ -41,15 +36,12 @@ endif
.PHONY: dadk_run .PHONY: dadk_run
dadk_run: install_dadk dadk_run: install_dadk
mkdir -p $(DADK_CACHE_DIR) mkdir -p $(DADK_CACHE_DIR)
dadk --config-dir dadk/config --cache-dir $(DADK_CACHE_DIR) --dragonos-dir $(ROOT_PATH)/bin/sysroot build $(DADK) user build -w $(ROOT_PATH)
dadk --config-dir dadk/config --cache-dir $(DADK_CACHE_DIR) --dragonos-dir $(ROOT_PATH)/bin/sysroot install $(DADK) user install -w $(ROOT_PATH)
.PHONY: dadk_clean .PHONY: dadk_clean
dadk_clean: install_dadk dadk_clean: install_dadk
@echo dadk_clean @echo dadk_clean
# 不运行dadk clean的原因是把clean的工作交给应用程序自己去做这样可以节省编译时间
#dadk --config-dir dadk/config --cache-dir $(DADK_CACHE_DIR) --dragonos-dir $(ROOT_PATH)/bin/sysroot clean src
#dadk --config-dir dadk/config --cache-dir $(DADK_CACHE_DIR) --dragonos-dir $(ROOT_PATH)/bin/sysroot clean target
all: all:
mkdir -p $(ROOT_PATH)/bin/sysroot mkdir -p $(ROOT_PATH)/bin/sysroot
@ -59,13 +51,13 @@ all:
@echo 用户态程序编译完成 @echo 用户态程序编译完成
copy_sysconfig: dadk_run .PHONY: copy_sysconfig
copy_sysconfig:
cp -r sysconfig/* $(ROOT_PATH)/bin/sysroot/ cp -r sysconfig/* $(ROOT_PATH)/bin/sysroot/
.PHONY: clean .PHONY: clean
clean: clean:
rm -rf $(GARBAGE)
$(MAKE) dadk_clean $(MAKE) dadk_clean
@list='$(user_sub_dirs)'; for subdir in $$list; do \ @list='$(user_sub_dirs)'; for subdir in $$list; do \
echo "Clean in dir: $$subdir";\ echo "Clean in dir: $$subdir";\

View File

@ -1,25 +0,0 @@
{
"name": "about",
"version": "0.1.0",
"description": "",
"rust_target": null,
"task_type": {
"BuildFromSource": {
"Local": {
"path": "apps/about"
}
}
},
"depends": [],
"build": {
"build_command": "make install"
},
"install": {
"in_dragonos_path": "/bin"
},
"clean": {
"clean_command": "make clean"
},
"envs": [],
"target_arch": ["x86_64"]
}

View File

@ -0,0 +1,36 @@
# 用户程序名称
name = "about"
# 版本号
version = "0.1.0"
# 用户程序描述信息
description = ""
# 可选是否只构建一次如果为trueDADK会在构建成功后将构建结果缓存起来下次构建时直接使用缓存的构建结果
build-once = false
# (可选) 是否只安装一次如果为trueDADK会在安装成功后不再重复安装
install-once = false
# 目标架构
# 可选值:"x86_64", "aarch64", "riscv64"
target-arch = ["x86_64"]
# 任务源
[task-source]
# 构建类型
# 可选值:"build-from_source", "install-from-prebuilt"
type = "build-from-source"
# 构建来源
# "build_from_source" 可选值:"git", "local", "archive"
# "install_from_prebuilt" 可选值:"local", "archive"
source = "local"
# 路径或URL
source-path = "user/apps/about"
# 构建相关信息
[build]
# (可选)构建命令
build-command = "make install"
# 安装相关信息
[install]
# 可选安装到DragonOS的路径
in-dragonos-path = "/bin"
# 清除相关信息
[clean]
# (可选)清除命令
clean-command = "make clean"

View File

@ -1,23 +0,0 @@
{
"name": "clear",
"version": "0.1.0",
"description": "清屏",
"task_type": {
"BuildFromSource": {
"Local": {
"path": "apps/clear"
}
}
},
"depends": [],
"build": {
"build_command": "make install"
},
"clean": {
"clean_command": "make clean"
},
"install": {
"in_dragonos_path": "/"
},
"target_arch": ["x86_64"]
}

View File

@ -0,0 +1,44 @@
# 用户程序名称
name = "clear"
# 版本号
version = "0.1.0"
# 用户程序描述信息
description = "清屏"
# 可选是否只构建一次如果为trueDADK会在构建成功后将构建结果缓存起来下次构建时直接使用缓存的构建结果
build-once = false
# (可选) 是否只安装一次如果为trueDADK会在安装成功后不再重复安装
install-once = false
# 目标架构
# 可选值:"x86_64", "aarch64", "riscv64"
target-arch = ["x86_64"]
# 任务源
[task-source]
# 构建类型
# 可选值:"build-from-source", "install-from-prebuilt"
type = "build-from-source"
# 构建来源
# "build_from_source" 可选值:"git", "local", "archive"
# "install_from_prebuilt" 可选值:"local", "archive"
source = "local"
# 路径或URL
source-path = "user/apps/clear"
# 构建相关信息
[build]
# (可选)构建命令
build-command = "make install"
# 安装相关信息
[install]
# 可选安装到DragonOS的路径
in-dragonos-path = "/"
# 清除相关信息
[clean]
# (可选)清除命令
clean-command = "make clean"
# (可选)依赖项
# 注意:如果没有依赖项,忽略此项,不允许只留一个[[depends]]
# 由于原配置中没有依赖项,这里忽略[[depends]]部分
# (可选)环境变量
# 由于原配置中没有环境变量,这里忽略[[envs]]部分

View File

@ -1,27 +0,0 @@
{
"name": "Core utils",
"version": "9.4.0",
"description": "GNU Core utils",
"task_type": {
"BuildFromSource": {
"Archive": {
"url": "https://mirrors.dragonos.org.cn/pub/third_party/gnu/coreutils/coreutils-9.4.tar.xz"
}
}
},
"depends": [],
"build": {
"build_command": "./configure CC=x86_64-linux-musl-gcc CFLAGS=-static && make -j $(nproc) && DESTDIR=$DADK_CURRENT_BUILD_DIR make install"
},
"clean": {
"clean_command": "make clean"
},
"install": {
"in_dragonos_path": "/"
},
"build_once": true,
"install_once": true,
"target_arch": ["x86_64"]
}

View File

@ -0,0 +1,39 @@
# 用户程序名称
name = "core utils"
# 版本号
version = "9.4.0"
# 用户程序描述信息
description = "GNU Core utils"
# 可选是否只构建一次如果为trueDADK会在构建成功后将构建结果缓存起来下次构建时直接使用缓存的构建结果
build-once = true
# (可选) 是否只安装一次如果为trueDADK会在安装成功后不再重复安装
install-once = true
# 目标架构
# 可选值:"x86_64", "aarch64", "riscv64"
target-arch = ["x86_64"]
# 任务源
[task-source]
# 构建类型
# 可选值:"build-from-source", "install-from-prebuilt"
type = "build-from-source"
# 构建来源
# "build_from_source" 可选值:"git", "local", "archive"
# "install_from_prebuilt" 可选值:"local", "archive"
source = "archive"
# 路径或URL
source-path = "https://mirrors.dragonos.org.cn/pub/third_party/gnu/coreutils/coreutils-9.4.tar.xz"
# 构建相关信息
[build]
# (可选)构建命令
build-command = "./configure CC=x86_64-linux-musl-gcc CFLAGS=-static && make -j $(nproc) && DESTDIR=$DADK_CURRENT_BUILD_DIR make install"
# 安装相关信息
[install]
# 可选安装到DragonOS的路径
in-dragonos-path = "/"
# 清除相关信息
[clean]
# (可选)清除命令
clean-command = "make clean"
# (可选)依赖项
# 注意:如果没有依赖项,忽略此项,不允许只留一个[[depends]]
# 此处无依赖项,故忽略

View File

@ -1,24 +0,0 @@
{
"name": "dmesg",
"version": "0.1.0",
"description": "查看日志",
"task_type": {
"BuildFromSource": {
"Local": {
"path": "apps/dmesg"
}
}
},
"depends": [],
"build": {
"build_command": "make install -j $(nproc)"
},
"install": {
"in_dragonos_path": "/bin"
},
"clean": {
"clean_command": "make clean"
},
"envs": [],
"target_arch": ["x86_64"]
}

View File

@ -0,0 +1,47 @@
# 用户程序名称
name = "dmesg"
# 版本号
version = "0.1.0"
# 用户程序描述信息
description = "查看内核日志"
# 是否只构建一次
build-once = false
# 是否只安装一次
install-once = false
# 目标架构
target-arch = ["x86_64"]
# 任务源
[task-source]
# 构建类型
type = "build-from-source"
# 构建来源
source = "local"
# 路径或URL
source-path = "user/apps/dmesg"
# 构建相关信息
[build]
# 构建命令
build-command = "make install -j $(nproc)"
# 安装相关信息
[install]
# 安装到DragonOS的路径
in-dragonos-path = "/bin"
# 清除相关信息
[clean]
# 清除命令
clean-command = "make clean"
# 依赖项
# 注意:因为没有依赖项,所以这里不包含[[depends]]部分
# 环境变量
# 注意:因为没有环境变量,所以这里不包含[[envs]]部分

View File

@ -1,34 +0,0 @@
{
"name": "dog",
"version": "0.1.0",
"description": "dns client",
"rust_target": null,
"task_type": {
"BuildFromSource": {
"Git": {
"url": "https://git.mirrors.dragonos.org.cn/DragonOS-Community/dog.git",
"branch": null,
"revision": "6f2c0c8f12"
}
}
},
"depends": [],
"build": {
"build_command": "make install"
},
"install": {
"in_dragonos_path": "/"
},
"clean": {
"clean_command": "make clean"
},
"envs": [
{
"key": "CC",
"value": "x86_64-linux-musl-gcc"
}
],
"build_once": false,
"install_once": false,
"target_arch": ["x86_64"]
}

View File

@ -0,0 +1,51 @@
# 用户程序名称
name = "dog"
# 版本号
version = "0.1.0"
# 用户程序描述信息
description = "dns client"
# 目标架构
target-arch = ["x86_64"]
# 是否只构建一次
build-once = false
# 是否只安装一次
install-once = false
# 任务源
[task-source]
# 构建类型
type = "build-from-source"
# 构建来源
source = "git"
# 路径或URL
source-path = "https://git.mirrors.dragonos.org.cn/DragonOS-Community/dog.git"
# git标签或分支
revision = "6f2c0c8f12"
# 构建相关信息
[build]
# 构建命令
build-command = "make install"
# 安装相关信息
[install]
# 安装到DragonOS的路径
in-dragonos-path = "/"
# 清除相关信息
[clean]
# 清除命令
clean-command = "make clean"
# 依赖项
# 注意:因为没有依赖项,所以这里不包含[[depends]]部分
# 环境变量
[[envs]]
key = "CC"
value = "x86_64-linux-musl-gcc"

View File

@ -1,24 +0,0 @@
{
"name": "DragonReach",
"version": "0.1.0",
"description": "init程序",
"task_type": {
"BuildFromSource": {
"Git": {
"url" : "https://git.mirrors.dragonos.org.cn/DragonOS-Community/DragonReach.git",
"revision": "e945c217b3"
}
}
},
"depends": [],
"build": {
"build_command": "make install"
},
"clean": {
"clean_command": "make clean"
},
"install": {
"in_dragonos_path": "/"
},
"target_arch": ["x86_64"]
}

View File

@ -0,0 +1,49 @@
# 用户程序名称
name = "DragonReach"
# 版本号
version = "0.1.0"
# 用户程序描述信息
description = "init程序"
# 目标架构
target-arch = ["x86_64"]
# 是否只构建一次
build-once = false
# 是否只安装一次
install-once = false
# 任务源
[task-source]
# 构建类型
type = "build-from-source"
# 构建来源
source = "git"
# 路径或URL
source-path = "https://git.mirrors.dragonos.org.cn/DragonOS-Community/DragonReach.git"
# git标签或分支
revision = "e945c217b3"
# 构建相关信息
[build]
# 构建命令
build-command = "make install"
# 安装相关信息
[install]
# 安装到DragonOS的路径
in-dragonos-path = "/"
# 清除相关信息
[clean]
# 清除命令
clean-command = "make clean"
# 依赖项
# 注意:因为没有依赖项,所以这里不包含[[depends]]部分
# 环境变量
# 注意:因为没有环境变量,所以这里不包含[[envs]]部分

View File

@ -1,24 +0,0 @@
{
"name": "Held",
"version": "0.1.0",
"description": "中断文本编辑器",
"task_type": {
"BuildFromSource": {
"Git": {
"url" : "https://git.mirrors.dragonos.org.cn/DragonOS-Community/Held.git",
"revision": "f192df4"
}
}
},
"depends": [],
"build": {
"build_command": "make install-dragonos"
},
"clean": {
"clean_command": "make clean"
},
"install": {
"in_dragonos_path": "/"
},
"target_arch": ["x86_64"]
}

View File

@ -0,0 +1,49 @@
# 用户程序名称
name = "Held"
# 版本号
version = "0.1.0"
# 用户程序描述信息
description = "终端文本编辑器"
# (可选)默认: false 是否只构建一次如果为trueDADK会在构建成功后将构建结果缓存起来下次构建时直接使用缓存的构建结果
build-once = false
# (可选) 默认: false 是否只安装一次如果为trueDADK会在安装成功后不再重复安装
install-once = false
# 目标架构
# 可选值:"x86_64", "aarch64", "riscv64"
target-arch = ["x86_64"]
# 任务源
[task-source]
# 构建类型
# 可选值:"build-from-source", "install-from-prebuilt"
type = "build-from-source"
# 构建来源
# "build_from_source" 可选值:"git", "local", "archive"
# "install_from_prebuilt" 可选值:"local", "archive"
source = "git"
# 路径或URL
source-path = "https://git.mirrors.dragonos.org.cn/DragonOS-Community/Held.git"
# git标签或分支
# 注意: branch和revision只能二选一且source要设置为"git"
revision = "f192df4"
# 构建相关信息
[build]
# (可选)构建命令
build-command = "make install-dragonos"
# 安装相关信息
[install]
# 可选安装到DragonOS的路径
in-dragonos-path = "/"
# 清除相关信息
[clean]
# (可选)清除命令
clean-command = "make clean"
# (可选)依赖项
# 注意:如果没有依赖项,忽略此项,不允许只留一个[[depends]]
# 此处没有依赖项,因此省略[[depends]]部分
# (可选)环境变量
# 此处没有环境变量,因此省略[[envs]]部分

View File

@ -1,24 +0,0 @@
{
"name": "Http_Server",
"version": "0.1.0",
"description": "一个简单的http server",
"task_type": {
"BuildFromSource": {
"Local": {
"path": "apps/http_server"
}
}
},
"depends": [],
"build": {
"build_command": "make install"
},
"install": {
"in_dragonos_path": "/bin"
},
"clean": {
"clean_command": "make clean"
},
"envs": [],
"target_arch": ["x86_64"]
}

View File

@ -0,0 +1,40 @@
# 用户程序名称
name = "Http_Server"
# 版本号
version = "0.1.0"
# 用户程序描述信息
description = "一个简单的http server"
# (可选)默认: false 是否只构建一次如果为trueDADK会在构建成功后将构建结果缓存起来下次构建时直接使用缓存的构建结果
build-once = false
# (可选) 默认: false 是否只安装一次如果为trueDADK会在安装成功后不再重复安装
install-once = false
# 目标架构
# 可选值:"x86_64", "aarch64", "riscv64"
target-arch = ["x86_64"]
# 任务源
[task-source]
# 构建类型
# 可选值:"build-from-source", "install-from-prebuilt"
type = "build-from-source"
# 构建来源
# "build_from_source" 可选值:"git", "local", "archive"
# "install_from_prebuilt" 可选值:"local", "archive"
source = "local"
# 路径或URL
source-path = "user/apps/http_server"
# 构建相关信息
[build]
# (可选)构建命令
build-command = "make install"
# 安装相关信息
[install]
# 可选安装到DragonOS的路径
in-dragonos-path = "/bin"
# 清除相关信息
[clean]
# (可选)清除命令
clean-command = "make clean"
# (可选)依赖项
# 注意:如果没有依赖项,忽略此项,不允许只留一个[[depends]]
# 环境变量
# 注意:如果没有环境变量,忽略此项,不允许只留一个[[envs]]

View File

@ -1,28 +0,0 @@
{
"name": "musl",
"version": "1.2.4",
"description": "musl libc",
"rust_target": null,
"task_type": {
"BuildFromSource": {
"Archive": {
"url": "https://mirrors.dragonos.org.cn/pub/third_party/musl/musl-1.2.4.tar.gz"
}
}
},
"depends": [],
"build": {
"build_command": "touch config.mak && DESTDIR=$DADK_CURRENT_BUILD_DIR make install -j $(nproc)"
},
"install": {
"in_dragonos_path": "/"
},
"clean": {
"clean_command": "make clean"
},
"envs": [],
"build_once": true,
"install_once": true,
"target_arch": ["x86_64"]
}

View File

@ -0,0 +1,40 @@
# 用户程序名称
name = "musl"
# 版本号
version = "1.2.4"
# 用户程序描述信息
description = "musl libc"
# (可选)默认: false 是否只构建一次如果为trueDADK会在构建成功后将构建结果缓存起来下次构建时直接使用缓存的构建结果
build-once = true
# (可选) 默认: false 是否只安装一次如果为trueDADK会在安装成功后不再重复安装
install-once = true
# 目标架构
# 可选值:"x86_64", "aarch64", "riscv64"
target-arch = ["x86_64"]
# 任务源
[task-source]
# 构建类型
# 可选值:"build-from-source", "install-from-prebuilt"
type = "build-from-source"
# 构建来源
# "build_from_source" 可选值:"git", "local", "archive"
# "install_from_prebuilt" 可选值:"local", "archive"
source = "archive"
# 路径或URL
source-path = "https://mirrors.dragonos.org.cn/pub/third_party/musl/musl-1.2.4.tar.gz"
# 构建相关信息
[build]
# (可选)构建命令
build-command = "touch config.mak && DESTDIR=$DADK_CURRENT_BUILD_DIR make install -j $(nproc)"
# 安装相关信息
[install]
# 可选安装到DragonOS的路径
in-dragonos-path = "/"
# 清除相关信息
[clean]
# (可选)清除命令
clean-command = "make clean"
# (可选)依赖项
# 注意:如果没有依赖项,忽略此项,不允许只留一个[[depends]]
# (可选)环境变量
# 注意:如果没有环境变量,忽略此项,不允许只留一个[[envs]]

View File

@ -1,24 +0,0 @@
{
"name": "NovaShell",
"version": "0.1.0",
"description": "NovaShell程序",
"task_type": {
"BuildFromSource": {
"Git": {
"url": "https://git.mirrors.dragonos.org.cn/DragonOS-Community/NovaShell.git",
"revision": "cb835e03e4"
}
}
},
"depends": [],
"build": {
"build_command": "make install"
},
"clean": {
"clean_command": "make clean"
},
"install": {
"in_dragonos_path": "/"
},
"target_arch": ["x86_64"]
}

View File

@ -0,0 +1,44 @@
# 用户程序名称
name = "NovaShell"
# 版本号
version = "0.1.0"
# 用户程序描述信息
description = "NovaShell程序"
# (可选)默认: false 是否只构建一次如果为trueDADK会在构建成功后将构建结果缓存起来下次构建时直接使用缓存的构建结果
build-once = false
# (可选) 默认: false 是否只安装一次如果为trueDADK会在安装成功后不再重复安装
install-once = false
# 目标架构
# 可选值:"x86_64", "aarch64", "riscv64"
target-arch = ["x86_64"]
# 任务源
[task-source]
# 构建类型
# 可选值:"build-from-source", "install-from-prebuilt"
type = "build-from-source"
# 构建来源
# "build_from_source" 可选值:"git", "local", "archive"
# "install_from_prebuilt" 可选值:"local", "archive"
source = "git"
# 路径或URL
source-path = "https://git.mirrors.dragonos.org.cn/DragonOS-Community/NovaShell.git"
# git标签或分支
# 注意: branch和revision只能二选一且source要设置为"git"
revision = "cb835e03e4"
# 构建相关信息
[build]
# (可选)构建命令
build-command = "make install"
# 安装相关信息
[install]
# 可选安装到DragonOS的路径
in-dragonos-path = "/"
# 清除相关信息
[clean]
# (可选)清除命令
clean-command = "make clean"
# (可选)依赖项
# 注意:如果没有依赖项,忽略此项,不允许只留一个[[depends]]
# 由于原配置中没有依赖项,此处省略[[depends]]部分
# (可选)环境变量
# 由于原配置中没有环境变量,此处省略[[envs]]部分

View File

@ -1,24 +0,0 @@
{
"name": "ping",
"version": "0.1.0",
"description": "ping用户程序",
"task_type": {
"BuildFromSource": {
"Local": {
"path": "apps/ping"
}
}
},
"depends": [],
"build": {
"build_command": "make install"
},
"install": {
"in_dragonos_path": "/usr"
},
"clean": {
"clean_command": "make clean"
},
"envs": [],
"target_arch": ["x86_64"]
}

View File

@ -0,0 +1,41 @@
# 用户程序名称
name = "ping"
# 版本号
version = "0.1.0"
# 用户程序描述信息
description = "ping用户程序"
# (可选)默认: false 是否只构建一次如果为trueDADK会在构建成功后将构建结果缓存起来下次构建时直接使用缓存的构建结果
build-once = false
# (可选) 默认: false 是否只安装一次如果为trueDADK会在安装成功后不再重复安装
install-once = false
# 目标架构
# 可选值:"x86_64", "aarch64", "riscv64"
target-arch = ["x86_64"]
# 任务源
[task-source]
# 构建类型
# 可选值:"build-from-source", "install-from-prebuilt"
type = "build-from-source"
# 构建来源
# "build_from_source" 可选值:"git", "local", "archive"
# "install_from_prebuilt" 可选值:"local", "archive"
source = "local"
# 路径或URL
source-path = "user/apps/ping"
# 构建相关信息
[build]
# (可选)构建命令
build-command = "make install"
# 安装相关信息
[install]
# 可选安装到DragonOS的路径
in-dragonos-path = "/usr"
# 清除相关信息
[clean]
# (可选)清除命令
clean-command = "make clean"
# (可选)依赖项
# 注意:如果没有依赖项,忽略此项,不允许只留一个[[depends]]
# 由于原配置中没有依赖项,此处省略[[depends]]部分
# (可选)环境变量
# 由于原配置中没有环境变量,此处省略[[envs]]部分

View File

@ -1,27 +0,0 @@
{
"name": "riscv_init",
"version": "0.1.0",
"description": "临时的riscv下的初始化程序",
"rust_target": null,
"task_type": {
"BuildFromSource": {
"Local": {
"path": "apps/riscv_init"
}
}
},
"depends": [],
"build": {
"build_command": "make install"
},
"install": {
"in_dragonos_path": "/bin"
},
"clean": {
"clean_command": "make clean"
},
"envs": [],
"build_once": false,
"install_once": false,
"target_arch": ["riscv64"]
}

View File

@ -0,0 +1,40 @@
# 用户程序名称
name = "riscv_init"
# 版本号
version = "0.1.0"
# 用户程序描述信息
description = "临时的riscv下的初始化程序"
# (可选)默认: false 是否只构建一次如果为trueDADK会在构建成功后将构建结果缓存起来下次构建时直接使用缓存的构建结果
build-once = false
# (可选) 默认: false 是否只安装一次如果为trueDADK会在安装成功后不再重复安装
install-once = false
# 目标架构
# 可选值:"x86_64", "aarch64", "riscv64"
target-arch = ["riscv64"]
# 任务源
[task-source]
# 构建类型
# 可选值:"build-from-source", "install-from-prebuilt"
type = "build-from-source"
# 构建来源
# "build_from_source" 可选值:"git", "local", "archive"
# "install_from_prebuilt" 可选值:"local", "archive"
source = "local"
# 路径或URL
source-path = "user/apps/riscv_init"
# 构建相关信息
[build]
# (可选)构建命令
build-command = "make install"
# 安装相关信息
[install]
# 可选安装到DragonOS的路径
in-dragonos-path = "/bin"
# 清除相关信息
[clean]
# (可选)清除命令
clean-command = "make clean"
# (可选)依赖项
# 注意:如果没有依赖项,忽略此项,不允许只留一个[[depends]]
# (可选)环境变量
# 注意:如果没有环境变量,忽略此项,不允许只留一个[[envs]]

View File

@ -1,25 +0,0 @@
{
"name": "tar",
"version": "1.35",
"description": "gnu tar",
"rust_target": null,
"task_type": {
"InstallFromPrebuilt": {
"Archive": {
"url": "https://mirrors.dragonos.org.cn/pub/third_party/gnu/tar/tar-1.35-x86_64-linux-gnu.tar.xz"
}
}
},
"depends": [],
"build": {
},
"install": {
"in_dragonos_path": "/usr"
},
"clean": {
"clean_command": null
},
"envs": [],
"target_arch": ["x86_64"]
}

View File

@ -0,0 +1,39 @@
# 用户程序名称
name = "tar"
# 版本号
version = "1.35"
# 用户程序描述信息
description = "gnu tar"
# (可选)默认: false 是否只构建一次如果为trueDADK会在构建成功后将构建结果缓存起来下次构建时直接使用缓存的构建结果
build-once = false
# (可选) 默认: false 是否只安装一次如果为trueDADK会在安装成功后不再重复安装
install-once = false
# 目标架构
# 可选值:"x86_64", "aarch64", "riscv64"
target-arch = ["x86_64"]
# 任务源
[task-source]
# 构建类型
# 可选值:"build-from-source", "install-from-prebuilt"
type = "install-from-prebuilt"
# 构建来源
# "build_from_source" 可选值:"git", "local", "archive"
# "install_from_prebuilt" 可选值:"local", "archive"
source = "archive"
# 路径或URL
source-path = "https://mirrors.dragonos.org.cn/pub/third_party/gnu/tar/tar-1.35-x86_64-linux-gnu.tar.xz"
[build]
# 安装相关信息
[install]
# 可选安装到DragonOS的路径
in-dragonos-path = "/usr"
# 清除相关信息
[clean]
# (可选)清除命令
clean-command = ""
# (可选)依赖项
# 注意:如果没有依赖项,忽略此项,不允许只留一个[[depends]]
# (可选)环境变量
# 注意:如果没有环境变量,忽略此项,不允许只留一个[[envs]]

View File

@ -1,27 +0,0 @@
{
"name": "test_alarm",
"version": "0.1.0",
"description": "test for alarm",
"rust_target": null,
"task_type": {
"BuildFromSource": {
"Local": {
"path": "apps/test_alarm"
}
}
},
"depends": [],
"build": {
"build_command": "make install"
},
"install": {
"in_dragonos_path": "/"
},
"clean": {
"clean_command": "make clean"
},
"envs": [],
"build_once": false,
"install_once": false,
"target_arch": ["x86_64"]
}

View File

@ -0,0 +1,41 @@
# 用户程序名称
name = "test_alarm"
# 版本号
version = "0.1.0"
# 用户程序描述信息
description = "test for alarm"
# (可选)默认: false 是否只构建一次如果为trueDADK会在构建成功后将构建结果缓存起来下次构建时直接使用缓存的构建结果
build-once = false
# (可选) 默认: false 是否只安装一次如果为trueDADK会在安装成功后不再重复安装
install-once = false
# 目标架构
# 可选值:"x86_64", "aarch64", "riscv64"
target-arch = ["x86_64"]
# 任务源
[task-source]
# 构建类型
# 可选值:"build-from-source", "install-from-prebuilt"
type = "build-from-source"
# 构建来源
# "build_from_source" 可选值:"git", "local", "archive"
# "install_from_prebuilt" 可选值:"local", "archive"
source = "local"
# 路径或URL
source-path = "user/apps/test_alarm"
# 构建相关信息
[build]
# (可选)构建命令
build-command = "make install"
# 安装相关信息
[install]
# 可选安装到DragonOS的路径
in-dragonos-path = "/"
# 清除相关信息
[clean]
# (可选)清除命令
clean-command = "make clean"
# (可选)依赖项
# 注意:如果没有依赖项,忽略此项,不允许只留一个[[depends]]
# 由于原配置中没有依赖项,这里忽略[[depends]]
# (可选)环境变量
# 由于原配置中没有环境变量,这里忽略[[envs]]

View File

@ -1,27 +0,0 @@
{
"name": "test-backlog",
"version": "0.1.0",
"description": "test the tcp backlog",
"rust_target": null,
"task_type": {
"BuildFromSource": {
"Local": {
"path": "apps/test-backlog"
}
}
},
"depends": [],
"build": {
"build_command": "make install"
},
"install": {
"in_dragonos_path": "/"
},
"clean": {
"clean_command": "make clean"
},
"envs": [],
"build_once": false,
"install_once": false,
"target_arch": ["x86_64"]
}

View File

@ -0,0 +1,40 @@
# 用户程序名称
name = "test-backlog"
# 版本号
version = "0.1.0"
# 用户程序描述信息
description = "test the tcp backlog"
# (可选)默认: false 是否只构建一次如果为trueDADK会在构建成功后将构建结果缓存起来下次构建时直接使用缓存的构建结果
build-once = false
# (可选) 默认: false 是否只安装一次如果为trueDADK会在安装成功后不再重复安装
install-once = false
# 目标架构
# 可选值:"x86_64", "aarch64", "riscv64"
target-arch = ["x86_64"]
# 任务源
[task-source]
# 构建类型
# 可选值:"build-from-source", "install-from-prebuilt"
type = "build-from-source"
# 构建来源
# "build_from_source" 可选值:"git", "local", "archive"
# "install_from_prebuilt" 可选值:"local", "archive"
source = "local"
# 路径或URL
source-path = "user/apps/test-backlog"
# 构建相关信息
[build]
# (可选)构建命令
build-command = "make install"
# 安装相关信息
[install]
# 可选安装到DragonOS的路径
in-dragonos-path = "/"
# 清除相关信息
[clean]
# (可选)清除命令
clean-command = "make clean"
# (可选)依赖项
# 注意:如果没有依赖项,忽略此项,不允许只留一个[[depends]]
# (可选)环境变量
# 注意:如果没有环境变量,忽略此项,不允许只留一个[[envs]]

View File

@ -1,24 +0,0 @@
{
"name": "test_bind",
"version": "0.1.0",
"description": "一个简单的test bind",
"task_type": {
"BuildFromSource": {
"Local": {
"path": "apps/test_bind"
}
}
},
"depends": [],
"build": {
"build_command": "make install"
},
"install": {
"in_dragonos_path": "/bin"
},
"clean": {
"clean_command": "make clean"
},
"envs": [],
"target_arch": ["x86_64"]
}

View File

@ -0,0 +1,40 @@
# 用户程序名称
name = "test_bind"
# 版本号
version = "0.1.0"
# 用户程序描述信息
description = "一个简单的test bind"
# (可选)默认: false 是否只构建一次如果为trueDADK会在构建成功后将构建结果缓存起来下次构建时直接使用缓存的构建结果
build-once = false
# (可选) 默认: false 是否只安装一次如果为trueDADK会在安装成功后不再重复安装
install-once = false
# 目标架构
# 可选值:"x86_64", "aarch64", "riscv64"
target-arch = ["x86_64"]
# 任务源
[task-source]
# 构建类型
# 可选值:"build-from-source", "install-from-prebuilt"
type = "build-from-source"
# 构建来源
# "build_from_source" 可选值:"git", "local", "archive"
# "install_from_prebuilt" 可选值:"local", "archive"
source = "local"
# 路径或URL
source-path = "user/apps/test_bind"
# 构建相关信息
[build]
# (可选)构建命令
build-command = "make install"
# 安装相关信息
[install]
# 可选安装到DragonOS的路径
in-dragonos-path = "/bin"
# 清除相关信息
[clean]
# (可选)清除命令
clean-command = "make clean"
# (可选)依赖项
# 注意:如果没有依赖项,忽略此项,不允许只留一个[[depends]]
# (可选)环境变量
# 注意:如果没有环境变量,忽略此项,不允许只留一个[[envs]]

View File

@ -1,25 +0,0 @@
{
"name": "test-blockcache",
"version": "0.1.0",
"description": "用于测试blockcach小程序",
"rust_target": "x86_64-unknown-dragonos",
"task_type": {
"BuildFromSource": {
"Local": {
"path": "apps/test-blockcache"
}
}
},
"depends": [],
"build": {
"build_command": "make install"
},
"install": {
"in_dragonos_path": "/"
},
"clean": {
"clean_command": "make clean"
},
"envs": [],
"target_arch": ["x86_64"]
}

View File

@ -0,0 +1,42 @@
# 用户程序名称
name = "test-blockcache"
# 版本号
version = "0.1.0"
# 用户程序描述信息
description = "用于测试blockcach小程序"
# 目标架构
# 可选值:"x86_64", "aarch64", "riscv64"
target-arch = ["x86_64"]
# 任务源
[task-source]
# 构建类型
# 可选值:"build-from_source", "install-from-prebuilt"
type = "build-from-source"
# 构建来源
# "build_from_source" 可选值:"git", "local", "archive"
# "install_from_prebuilt" 可选值:"local", "archive"
source = "local"
# 路径或URL
source-path = "user/apps/test-blockcache"
# 构建相关信息
[build]
# (可选)构建命令
build-command = "make install"
# 安装相关信息
[install]
# 可选安装到DragonOS的路径
in-dragonos-path = "/"
# 清除相关信息
[clean]
# (可选)清除命令
clean-command = "make clean"
# (可选)依赖项
# 注意:如果没有依赖项,忽略此项,不允许只留一个[[depends]]
# [[depends]]
# name = "depend1"
# version = "0.1.1"
# (可选)环境变量
# 注意:如果没有环境变量,忽略此项,不允许只留一个[[envs]]
# [[envs]]
# key = "PATH"
# value = "/usr/bin"

View File

@ -1,29 +0,0 @@
{
"name": "test-chown",
"version": "0.1.0",
"description": "chown系列系统调用",
"rust_target": "x86_64-unknown-dragonos",
"task_type": {
"BuildFromSource": {
"Local": {
"path": "apps/test-chown"
}
}
},
"depends": [],
"build": {
"build_command": "make install"
},
"install": {
"in_dragonos_path": "/"
},
"clean": {
"clean_command": "make clean"
},
"envs": [],
"build_once": false,
"install_once": false,
"target_arch": [
"x86_64"
]
}

View File

@ -0,0 +1,46 @@
# 用户程序名称
name = "test-chown"
# 版本号
version = "0.1.0"
# 用户程序描述信息
description = "chown系列系统调用"
# (可选)默认: false 是否只构建一次如果为trueDADK会在构建成功后将构建结果缓存起来下次构建时直接使用缓存的构建结果
build-once = false
# (可选) 默认: false 是否只安装一次如果为trueDADK会在安装成功后不再重复安装
install-once = false
# 目标架构
# 可选值:"x86_64", "aarch64", "riscv64"
target-arch = ["x86_64"]
# 任务源
[task-source]
# 构建类型
# 可选值:"build-from-source", "install-from-prebuilt"
type = "build-from-source"
# 构建来源
# "build_from_source" 可选值:"git", "local", "archive"
# "install_from_prebuilt" 可选值:"local", "archive"
source = "local"
# 路径或URL
source-path = "user/apps/test-chown"
# 构建相关信息
[build]
# (可选)构建命令
build-command = "make install"
# 安装相关信息
[install]
# 可选安装到DragonOS的路径
in-dragonos-path = "/"
# 清除相关信息
[clean]
# (可选)清除命令
clean-command = "make clean"
# (可选)依赖项
# 注意:如果没有依赖项,忽略此项,不允许只留一个[[depends]]
# [[depends]]
# name = "depend1"
# version = "0.1.1"
# (可选)环境变量
# 注意:如果没有环境变量,忽略此项,不允许只留一个[[envs]]
# [[envs]]
# key = "PATH"
# value = "/usr/bin"

View File

@ -1,23 +0,0 @@
{
"name": "test_cred",
"version": "0.1.0",
"description": "测试cred",
"task_type": {
"BuildFromSource": {
"Local": {
"path": "apps/test_cred"
}
}
},
"depends": [],
"build": {
"build_command": "make install"
},
"clean": {
"clean_command": "make clean"
},
"install": {
"in_dragonos_path": "/bin"
},
"target_arch": ["x86_64"]
}

View File

@ -0,0 +1,51 @@
# 用户程序名称
name = "test_cred"
# 版本号
version = "0.1.0"
# 用户程序描述信息
description = "测试cred"
# (可选)默认: false 是否只构建一次如果为trueDADK会在构建成功后将构建结果缓存起来下次构建时直接使用缓存的构建结果
build-once = false
# (可选) 默认: false 是否只安装一次如果为trueDADK会在安装成功后不再重复安装
install-once = false
# 目标架构
# 可选值:"x86_64", "aarch64", "riscv64"
target-arch = ["x86_64"]
# 任务源
[task-source]
# 构建类型
# 可选值:"build-from_source", "install-from-prebuilt"
type = "build-from-source"
# 构建来源
# "build_from_source" 可选值:"git", "local", "archive"
# "install_from_prebuilt" 可选值:"local", "archive"
source = "local"
# 路径或URL
source-path = "user/apps/test_cred"
# 构建相关信息
[build]
# (可选)构建命令
build-command = "make install"
# 安装相关信息
[install]
# 可选安装到DragonOS的路径
in-dragonos-path = "/bin"
# 清除相关信息
[clean]
# (可选)清除命令
clean-command = "make clean"
# (可选)依赖项
# 注意:如果没有依赖项,忽略此项,不允许只留一个[[depends]]
# [[depends]]
# name = "depend1"
# version = "0.1.1"
# [[depends]]
# name = "depend2"
# version = "0.1.2"
# (可选)环境变量
# [[envs]]
# key = "PATH"
# value = "/usr/bin"
# [[envs]]
# key = "LD_LIBRARY_PATH"
# value = "/usr/lib"

View File

@ -1,23 +0,0 @@
{
"name": "test_dup3",
"version": "0.1.0",
"description": "测试dup3",
"task_type": {
"BuildFromSource": {
"Local": {
"path": "apps/test_dup3"
}
}
},
"depends": [],
"build": {
"build_command": "make install"
},
"install": {
"in_dragonos_path": "/bin"
},
"clean": {
"clean_command": "make clean"
},
"target_arch": ["x86_64"]
}

View File

@ -0,0 +1,51 @@
# 用户程序名称
name = "test_dup3"
# 版本号
version = "0.1.0"
# 用户程序描述信息
description = "测试dup3"
# (可选)默认: false 是否只构建一次如果为trueDADK会在构建成功后将构建结果缓存起来下次构建时直接使用缓存的构建结果
build-once = false
# (可选) 默认: false 是否只安装一次如果为trueDADK会在安装成功后不再重复安装
install-once = false
# 目标架构
# 可选值:"x86_64", "aarch64", "riscv64"
target-arch = ["x86_64"]
# 任务源
[task-source]
# 构建类型
# 可选值:"build-from_source", "install-from-prebuilt"
type = "build-from-source"
# 构建来源
# "build_from_source" 可选值:"git", "local", "archive"
# "install_from_prebuilt" 可选值:"local", "archive"
source = "local"
# 路径或URL
source-path = "user/apps/test_dup3"
# 构建相关信息
[build]
# (可选)构建命令
build-command = "make install"
# 安装相关信息
[install]
# 可选安装到DragonOS的路径
in-dragonos-path = "/bin"
# 清除相关信息
[clean]
# (可选)清除命令
clean-command = "make clean"
# (可选)依赖项
# 注意:如果没有依赖项,忽略此项,不允许只留一个[[depends]]
# [[depends]]
# name = "depend1"
# version = "0.1.1"
# [[depends]]
# name = "depend2"
# version = "0.1.2"
# (可选)环境变量
# [[envs]]
# key = "PATH"
# value = "/usr/bin"
# [[envs]]
# key = "LD_LIBRARY_PATH"
# value = "/usr/lib"

View File

@ -1,23 +0,0 @@
{
"name": "test_ebpf",
"version": "0.1.0",
"description": "to test eBPF",
"task_type": {
"BuildFromSource": {
"Local": {
"path": "apps/test_ebpf"
}
}
},
"depends": [],
"build": {
"build_command": "make install"
},
"install": {
"in_dragonos_path": "/"
},
"clean": {
"clean_command": "make clean"
},
"target_arch": ["x86_64"]
}

View File

@ -0,0 +1,37 @@
# 用户程序名称
name = "test_ebpf"
# 版本号
version = "0.1.0"
# 用户程序描述信息
description = "to test eBPF"
# (可选)默认: false 是否只构建一次如果为trueDADK会在构建成功后将构建结果缓存起来下次构建时直接使用缓存的构建结果
build-once = false
# (可选) 默认: false 是否只安装一次如果为trueDADK会在安装成功后不再重复安装
install-once = false
# 目标架构
# 可选值:"x86_64", "aarch64", "riscv64"
target-arch = ["x86_64"]
# 任务源
[task-source]
# 构建类型
# 可选值:"build-from_source", "install-from-prebuilt"
type = "build-from-source"
# 构建来源
# "build_from_source" 可选值:"git", "local", "archive"
# "install_from_prebuilt" 可选值:"local", "archive"
source = "local"
# 路径或URL
source-path = "user/apps/test_ebpf"
# 构建相关信息
[build]
# (可选)构建命令
build-command = "make install"
# 安装相关信息
[install]
# 可选安装到DragonOS的路径
in-dragonos-path = "/"
# 清除相关信息
[clean]
# (可选)清除命令
clean-command = "make clean"

View File

@ -1,23 +0,0 @@
{
"name": "test_eventfd",
"version": "0.1.0",
"description": "test_eventfd",
"task_type": {
"BuildFromSource": {
"Local": {
"path": "apps/test_eventfd"
}
}
},
"depends": [],
"build": {
"build_command": "make install"
},
"install": {
"in_dragonos_path": "/bin"
},
"clean": {
"clean_command": "make clean"
},
"target_arch": ["x86_64"]
}

View File

@ -0,0 +1,32 @@
# 用户程序名称
name = "test_eventfd"
# 版本号
version = "0.1.0"
# 用户程序描述信息
description = "test_eventfd"
# 目标架构
target-arch = ["x86_64"]
# 任务源
[task-source]
# 构建类型
type = "build-from-source"
# 构建来源
source = "local"
# 路径或URL
source-path = "user/apps/test_eventfd"
# 构建相关信息
[build]
# (可选)构建命令
build-command = "make install"
# 安装相关信息
[install]
# 可选安装到DragonOS的路径
in-dragonos-path = "/bin"
# 清除相关信息
[clean]
# (可选)清除命令
clean-command = "make clean"

View File

@ -1,23 +0,0 @@
{
"name": "test_filemap",
"version": "0.1.0",
"description": "测试filemap",
"task_type": {
"BuildFromSource": {
"Local": {
"path": "apps/test_filemap"
}
}
},
"depends": [],
"build": {
"build_command": "make install"
},
"clean": {
"clean_command": "make clean"
},
"install": {
"in_dragonos_path": "/bin"
},
"target_arch": ["x86_64"]
}

View File

@ -0,0 +1,36 @@
# 用户程序名称
name = "test_filemap"
# 版本号
version = "0.1.0"
# 用户程序描述信息
description = "测试filemap"
# (可选)默认: false 是否只构建一次如果为trueDADK会在构建成功后将构建结果缓存起来下次构建时直接使用缓存的构建结果
build-once = false
# (可选) 默认: false 是否只安装一次如果为trueDADK会在安装成功后不再重复安装
install-once = false
# 目标架构
# 可选值:"x86_64", "aarch64", "riscv64"
target-arch = ["x86_64"]
# 任务源
[task-source]
# 构建类型
# 可选值:"build-from_source", "install-from-prebuilt"
type = "build-from-source"
# 构建来源
# "build_from_source" 可选值:"git", "local", "archive"
# "install_from_prebuilt" 可选值:"local", "archive"
source = "local"
# 路径或URL
source-path = "user/apps/test_filemap"
# 构建相关信息
[build]
# (可选)构建命令
build-command = "make install"
# 安装相关信息
[install]
# 可选安装到DragonOS的路径
in-dragonos-path = "/bin"
# 清除相关信息
[clean]
# (可选)清除命令
clean-command = "make clean"

View File

@ -1,25 +0,0 @@
{
"name": "test-for-robustfutex",
"version": "0.1.0",
"description": "some tests for robust futex",
"rust_target": null,
"task_type": {
"BuildFromSource": {
"Local": {
"path": "apps/test-for-robustfutex"
}
}
},
"depends": [],
"build": {
"build_command": "make install"
},
"install": {
"in_dragonos_path": "/"
},
"clean": {
"clean_command": "make clean"
},
"envs": [],
"target_arch": ["x86_64"]
}

View File

@ -0,0 +1,36 @@
# 用户程序名称
name = "test-for-robustfutex"
# 版本号
version = "0.1.0"
# 用户程序描述信息
description = "some tests for robust futex"
# (可选)默认: false 是否只构建一次如果为trueDADK会在构建成功后将构建结果缓存起来下次构建时直接使用缓存的构建结果
build-once = false
# (可选) 默认: false 是否只安装一次如果为trueDADK会在安装成功后不再重复安装
install-once = false
# 目标架构
# 可选值:"x86_64", "aarch64", "riscv64"
target-arch = ["x86_64"]
# 任务源
[task-source]
# 构建类型
# 可选值:"build-from_source", "install-from-prebuilt"
type = "build-from-source"
# 构建来源
# "build_from_source" 可选值:"git", "local", "archive"
# "install_from_prebuilt" 可选值:"local", "archive"
source = "local"
# 路径或URL
source-path = "user/apps/test-for-robustfutex"
# 构建相关信息
[build]
# (可选)构建命令
build-command = "make install"
# 安装相关信息
[install]
# 可选安装到DragonOS的路径
in-dragonos-path = "/"
# 清除相关信息
[clean]
# (可选)清除命令
clean-command = "make clean"

View File

@ -1,23 +0,0 @@
{
"name": "test_fstat",
"version": "0.1.0",
"description": "一个用来测试fstat能够正常运行的app",
"task_type": {
"BuildFromSource": {
"Local": {
"path": "apps/test_fstat"
}
}
},
"depends": [],
"build": {
"build_command": "make install"
},
"install": {
"in_dragonos_path": "/bin"
},
"clean": {
"clean_command": "make clean"
},
"target_arch": ["x86_64"]
}

View File

@ -0,0 +1,36 @@
# 用户程序名称
name = "test_fstat"
# 版本号
version = "0.1.0"
# 用户程序描述信息
description = "一个用来测试fstat能够正常运行的app"
# (可选)默认: false 是否只构建一次如果为trueDADK会在构建成功后将构建结果缓存起来下次构建时直接使用缓存的构建结果
build-once = false
# (可选) 默认: false 是否只安装一次如果为trueDADK会在安装成功后不再重复安装
install-once = false
# 目标架构
# 可选值:"x86_64", "aarch64", "riscv64"
target-arch = ["x86_64"]
# 任务源
[task-source]
# 构建类型
# 可选值:"build-from_source", "install-from-prebuilt"
type = "build-from-source"
# 构建来源
# "build_from_source" 可选值:"git", "local", "archive"
# "install_from_prebuilt" 可选值:"local", "archive"
source = "local"
# 路径或URL
source-path = "user/apps/test_fstat"
# 构建相关信息
[build]
# (可选)构建命令
build-command = "make install"
# 安装相关信息
[install]
# 可选安装到DragonOS的路径
in-dragonos-path = "/bin"
# 清除相关信息
[clean]
# (可选)清除命令
clean-command = "make clean"

View File

@ -1,27 +0,0 @@
{
"name": "test_fstatfs",
"version": "0.1.0",
"description": "测试fstatfs",
"rust_target": null,
"task_type": {
"BuildFromSource": {
"Local": {
"path": "apps/test_fstatfs"
}
}
},
"depends": [],
"build": {
"build_command": "make install"
},
"install": {
"in_dragonos_path": "/bin"
},
"clean": {
"clean_command": "make clean"
},
"envs": [],
"build_once": false,
"install_once": false,
"target_arch": ["x86_64"]
}

View File

@ -0,0 +1,41 @@
# 用户程序名称
name = "test_fstatfs"
# 版本号
version = "0.1.0"
# 用户程序描述信息
description = "测试fstatfs"
# (可选)默认: false 是否只构建一次如果为trueDADK会在构建成功后将构建结果缓存起来下次构建时直接使用缓存的构建结果
build-once = false
# (可选) 默认: false 是否只安装一次如果为trueDADK会在安装成功后不再重复安装
install-once = false
# 目标架构
# 可选值:"x86_64", "aarch64", "riscv64"
target-arch = ["x86_64"]
# 任务源
[task-source]
# 构建类型
# 可选值:"build-from_source", "install-from-prebuilt"
type = "build-from-source"
# 构建来源
# "build_from_source" 可选值:"git", "local", "archive"
# "install_from_prebuilt" 可选值:"local", "archive"
source = "local"
# 路径或URL
source-path = "user/apps/test_fstatfs"
# 构建相关信息
[build]
# (可选)构建命令
build-command = "make install"
# 安装相关信息
[install]
# 可选安装到DragonOS的路径
in-dragonos-path = "/bin"
# 清除相关信息
[clean]
# (可选)清除命令
clean-command = "make clean"
# (可选)依赖项
# 注意:如果没有依赖项,忽略此项,不允许只留一个[[depends]]
# 由于原文件中依赖项为空,此处省略[[depends]]部分
# (可选)环境变量
# 由于原文件中环境变量为空,此处省略[[envs]]部分

View File

@ -1,24 +0,0 @@
{
"name": "test_gettimeofday",
"version": "0.1.0",
"description": "一个用来测试gettimeofday能够正常运行的app",
"task_type": {
"BuildFromSource": {
"Local": {
"path": "apps/test_gettimeofday"
}
}
},
"depends": [],
"build": {
"build_command": "make install"
},
"install": {
"in_dragonos_path": "/bin"
},
"clean": {
"clean_command": "make clean"
},
"envs": [],
"target_arch": ["x86_64"]
}

View File

@ -0,0 +1,37 @@
# 用户程序名称
name = "test_gettimeofday"
# 版本号
version = "0.1.0"
# 用户程序描述信息
description = "一个用来测试gettimeofday能够正常运行的app"
# (可选)默认: false 是否只构建一次如果为trueDADK会在构建成功后将构建结果缓存起来下次构建时直接使用缓存的构建结果
build-once = false
# (可选) 默认: false 是否只安装一次如果为trueDADK会在安装成功后不再重复安装
install-once = false
# 目标架构
# 可选值:"x86_64", "aarch64", "riscv64"
target-arch = ["x86_64"]
# 任务源
[task-source]
# 构建类型
# 可选值:"build-from_source", "install-from-prebuilt"
type = "build-from-source"
# 构建来源
# "build_from_source" 可选值:"git", "local", "archive"
# "install_from_prebuilt" 可选值:"local", "archive"
source = "local"
# 路径或URL
source-path = "user/apps/test_gettimeofday"
# 构建相关信息
[build]
# (可选)构建命令
build-command = "make install"
# 安装相关信息
[install]
# 可选安装到DragonOS的路径
in-dragonos-path = "/bin"
# 清除相关信息
[clean]
# (可选)清除命令
clean-command = "make clean"

View File

@ -1,25 +0,0 @@
{
"name": "test_kvm",
"version": "0.1.0",
"description": "测试kvm的程序",
"rust_target": null,
"task_type": {
"BuildFromSource": {
"Local": {
"path": "apps/test_kvm"
}
}
},
"depends": [],
"build": {
"build_command": "make install"
},
"install": {
"in_dragonos_path": "/bin"
},
"clean": {
"clean_command": "make clean"
},
"envs": [],
"target_arch": ["x86_64"]
}

View File

@ -0,0 +1,46 @@
# 用户程序名称
name = "test_kvm"
# 版本号
version = "0.1.0"
# 用户程序描述信息
description = "测试kvm的程序"
# (可选)默认: false 是否只构建一次如果为trueDADK会在构建成功后将构建结果缓存起来下次构建时直接使用缓存的构建结果
build-once = false
# (可选) 默认: false 是否只安装一次如果为trueDADK会在安装成功后不再重复安装
install-once = false
# 目标架构
# 可选值:"x86_64", "aarch64", "riscv64"
target-arch = ["x86_64"]
# 任务源
[task-source]
# 构建类型
# 可选值:"build-from_source", "install-from-prebuilt"
type = "build-from-source"
# 构建来源
# "build_from_source" 可选值:"git", "local", "archive"
# "install_from_prebuilt" 可选值:"local", "archive"
source = "local"
# 路径或URL
source-path = "user/apps/test_kvm"
# 构建相关信息
[build]
# (可选)构建命令
build-command = "make install"
# 安装相关信息
[install]
# 可选安装到DragonOS的路径
in-dragonos-path = "/bin"
# 清除相关信息
[clean]
# (可选)清除命令
clean-command = "make clean"
# (可选)依赖项
# 注意:如果没有依赖项,忽略此项,不允许只留一个[[depends]]
# [[depends]]
# name = "depend1"
# version = "0.1.1"
# (可选)环境变量
# 注意:如果没有环境变量,忽略此项,不允许只留一个[[envs]]
# [[envs]]
# key = "PATH"
# value = "/usr/bin"

View File

@ -1,27 +0,0 @@
{
"name": "test_lo",
"version": "0.1.0",
"description": "test for lo interface",
"rust_target": null,
"task_type": {
"BuildFromSource": {
"Local": {
"path": "apps/test_lo"
}
}
},
"depends": [],
"build": {
"build_command": "make install"
},
"install": {
"in_dragonos_path": "/"
},
"clean": {
"clean_command": "make clean"
},
"envs": [],
"build_once": false,
"install_once": false,
"target_arch": ["x86_64"]
}

View File

@ -0,0 +1,36 @@
# 用户程序名称
name = "test_lo"
# 版本号
version = "0.1.0"
# 用户程序描述信息
description = "test for lo interface"
# (可选)默认: false 是否只构建一次如果为trueDADK会在构建成功后将构建结果缓存起来下次构建时直接使用缓存的构建结果
build-once = false
# (可选) 默认: false 是否只安装一次如果为trueDADK会在安装成功后不再重复安装
install-once = false
# 目标架构
# 可选值:"x86_64", "aarch64", "riscv64"
target-arch = ["x86_64"]
# 任务源
[task-source]
# 构建类型
# 可选值:"build-from_source", "install-from-prebuilt"
type = "build-from-source"
# 构建来源
# "build_from_source" 可选值:"git", "local", "archive"
# "install_from_prebuilt" 可选值:"local", "archive"
source = "local"
# 路径或URL
source-path = "user/apps/test_lo"
# 构建相关信息
[build]
# (可选)构建命令
build-command = "make install"
# 安装相关信息
[install]
# 可选安装到DragonOS的路径
in-dragonos-path = "/"
# 清除相关信息
[clean]
# (可选)清除命令
clean-command = "make clean"

View File

@ -1,23 +0,0 @@
{
"name": "test_mkfifo",
"version": "0.1.0",
"description": "一个用来测试mkfifo能够正常运行的app",
"task_type": {
"BuildFromSource": {
"Local": {
"path": "apps/test_mkfifo"
}
}
},
"depends": [],
"build": {
"build_command": "make install"
},
"install": {
"in_dragonos_path": "/bin"
},
"clean": {
"clean_command": "make clean"
},
"target_arch": ["x86_64"]
}

View File

@ -0,0 +1,36 @@
# 用户程序名称
name = "test_mkfifo"
# 版本号
version = "0.1.0"
# 用户程序描述信息
description = "一个用来测试mkfifo能够正常运行的app"
# (可选)默认: false 是否只构建一次如果为trueDADK会在构建成功后将构建结果缓存起来下次构建时直接使用缓存的构建结果
build-once = false
# (可选) 默认: false 是否只安装一次如果为trueDADK会在安装成功后不再重复安装
install-once = false
# 目标架构
# 可选值:"x86_64", "aarch64", "riscv64"
target-arch = ["x86_64"]
# 任务源
[task-source]
# 构建类型
# 可选值:"build-from_source", "install-from-prebuilt"
type = "build-from-source"
# 构建来源
# "build_from_source" 可选值:"git", "local", "archive"
# "install_from_prebuilt" 可选值:"local", "archive"
source = "local"
# 路径或URL
source-path = "user/apps/test_mkfifo"
# 构建相关信息
[build]
# (可选)构建命令
build-command = "make install"
# 安装相关信息
[install]
# 可选安装到DragonOS的路径
in-dragonos-path = "/bin"
# 清除相关信息
[clean]
# (可选)清除命令
clean-command = "make clean"

View File

@ -1,23 +0,0 @@
{
"name": "test_mount",
"version": "1.0.0",
"description": "to test user mode mount",
"task_type": {
"BuildFromSource": {
"Local": {
"path": "apps/test-mount"
}
}
},
"depends": [],
"build": {
"build_command": "make install"
},
"install": {
"in_dragonos_path": "/"
},
"clean": {
"clean_command": "make clean"
},
"target_arch": ["x86_64"]
}

View File

@ -0,0 +1,51 @@
# 用户程序名称
name = "test_mount"
# 版本号
version = "1.0.0"
# 用户程序描述信息
description = "to test user mode mount"
# (可选)默认: false 是否只构建一次如果为trueDADK会在构建成功后将构建结果缓存起来下次构建时直接使用缓存的构建结果
build-once = false
# (可选) 默认: false 是否只安装一次如果为trueDADK会在安装成功后不再重复安装
install-once = false
# 目标架构
# 可选值:"x86_64", "aarch64", "riscv64"
target-arch = ["x86_64"]
# 任务源
[task-source]
# 构建类型
# 可选值:"build-from_source", "install-from-prebuilt"
type = "build-from-source"
# 构建来源
# "build_from_source" 可选值:"git", "local", "archive"
# "install_from_prebuilt" 可选值:"local", "archive"
source = "local"
# 路径或URL
source-path = "user/apps/test-mount"
# 构建相关信息
[build]
# (可选)构建命令
build-command = "make install"
# 安装相关信息
[install]
# 可选安装到DragonOS的路径
in-dragonos-path = "/"
# 清除相关信息
[clean]
# (可选)清除命令
clean-command = "make clean"
# (可选)依赖项
# 注意:如果没有依赖项,忽略此项,不允许只留一个[[depends]]
# [[depends]]
# name = "depend1"
# version = "0.1.1"
# [[depends]]
# name = "depend2"
# version = "0.1.2"
# (可选)环境变量
# [[envs]]
# key = "PATH"
# value = "/usr/bin"
# [[envs]]
# key = "LD_LIBRARY_PATH"
# value = "/usr/lib"

Some files were not shown because too many files have changed in this diff Show More