mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-18 16:26:31 +00:00
@ -7,7 +7,7 @@ GARBAGE := $(foreach DIR,$(DIRS),$(addprefix $(DIR)/,$(GARBAGE_PATTERNS)))
|
||||
|
||||
DADK_VERSION=$(shell dadk -V | awk 'END {print $$2}')
|
||||
# 最小的DADK版本
|
||||
MIN_DADK_VERSION = 0.1.10
|
||||
MIN_DADK_VERSION = 0.1.11
|
||||
DADK_CACHE_DIR = $(ROOT_PATH)/bin/dadk_cache
|
||||
|
||||
ECHO:
|
||||
|
20
user/apps/riscv_init/Makefile
Normal file
20
user/apps/riscv_init/Makefile
Normal file
@ -0,0 +1,20 @@
|
||||
ifeq ($(ARCH), x86_64)
|
||||
CROSS_COMPILE=x86_64-linux-musl-
|
||||
else ifeq ($(ARCH), riscv64)
|
||||
CROSS_COMPILE=riscv64-linux-musl-
|
||||
endif
|
||||
|
||||
CC=$(CROSS_COMPILE)gcc
|
||||
|
||||
.PHONY: all
|
||||
all: main.c
|
||||
$(CC) -static -o init main.c
|
||||
|
||||
.PHONY: install clean
|
||||
install: all
|
||||
mv init $(DADK_CURRENT_BUILD_DIR)/init
|
||||
|
||||
clean:
|
||||
rm init *.o
|
||||
|
||||
fmt:
|
9
user/apps/riscv_init/main.c
Normal file
9
user/apps/riscv_init/main.c
Normal file
@ -0,0 +1,9 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
while(1){
|
||||
printf("\033[43;37mHello, World!\033[0m\n");
|
||||
sleep(1);
|
||||
}
|
||||
return 0;
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
# The toolchain we use.
|
||||
# You can get it by running DragonOS' `tools/bootstrap.sh`
|
||||
TOOLCHAIN="+nightly-2023-08-15-x86_64-unknown-linux_dragonos-gnu"
|
||||
TOOLCHAIN="+nightly-2023-08-15-x86_64-unknown-linux-gnu"
|
||||
RUSTFLAGS+="-C target-feature=+crt-static -C link-arg=-no-pie"
|
||||
|
||||
# 如果是在dadk中编译,那么安装到dadk的安装目录中
|
||||
|
@ -20,5 +20,6 @@
|
||||
"clean": {
|
||||
"clean_command": "make clean"
|
||||
},
|
||||
"envs": []
|
||||
"envs": [],
|
||||
"target_arch": ["x86_64"]
|
||||
}
|
@ -18,5 +18,6 @@
|
||||
},
|
||||
"install": {
|
||||
"in_dragonos_path": "/"
|
||||
}
|
||||
},
|
||||
"target_arch": ["x86_64"]
|
||||
}
|
||||
|
@ -22,5 +22,6 @@
|
||||
|
||||
"build_once": true,
|
||||
|
||||
"install_once": true
|
||||
"install_once": true,
|
||||
"target_arch": ["x86_64"]
|
||||
}
|
||||
|
@ -19,5 +19,6 @@
|
||||
"clean": {
|
||||
"clean_command": "make clean"
|
||||
},
|
||||
"envs": []
|
||||
"envs": [],
|
||||
"target_arch": ["x86_64"]
|
||||
}
|
@ -22,7 +22,13 @@
|
||||
"clean": {
|
||||
"clean_command": "make clean"
|
||||
},
|
||||
"envs": [],
|
||||
"envs": [
|
||||
{
|
||||
"key": "CC",
|
||||
"value": "x86_64-linux-musl-gcc"
|
||||
}
|
||||
],
|
||||
"build_once": false,
|
||||
"install_once": false
|
||||
"install_once": false,
|
||||
"target_arch": ["x86_64"]
|
||||
}
|
@ -19,5 +19,6 @@
|
||||
},
|
||||
"install": {
|
||||
"in_dragonos_path": "/"
|
||||
}
|
||||
},
|
||||
"target_arch": ["x86_64"]
|
||||
}
|
||||
|
@ -19,5 +19,6 @@
|
||||
},
|
||||
"install": {
|
||||
"in_dragonos_path": "/"
|
||||
}
|
||||
},
|
||||
"target_arch": ["x86_64"]
|
||||
}
|
||||
|
@ -19,5 +19,6 @@
|
||||
"clean": {
|
||||
"clean_command": "make clean"
|
||||
},
|
||||
"envs": []
|
||||
"envs": [],
|
||||
"target_arch": ["x86_64"]
|
||||
}
|
@ -23,5 +23,6 @@
|
||||
"envs": [],
|
||||
"build_once": true,
|
||||
|
||||
"install_once": true
|
||||
"install_once": true,
|
||||
"target_arch": ["x86_64"]
|
||||
}
|
@ -19,5 +19,6 @@
|
||||
},
|
||||
"install": {
|
||||
"in_dragonos_path": "/"
|
||||
}
|
||||
},
|
||||
"target_arch": ["x86_64"]
|
||||
}
|
||||
|
27
user/dadk/config/riscv_init-0.1.0.dadk
Normal file
27
user/dadk/config/riscv_init-0.1.0.dadk
Normal file
@ -0,0 +1,27 @@
|
||||
{
|
||||
"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"]
|
||||
}
|
@ -20,5 +20,6 @@
|
||||
"clean": {
|
||||
"clean_command": null
|
||||
},
|
||||
"envs": []
|
||||
"envs": [],
|
||||
"target_arch": ["x86_64"]
|
||||
}
|
||||
|
@ -22,5 +22,6 @@
|
||||
},
|
||||
"envs": [],
|
||||
"build_once": false,
|
||||
"install_once": false
|
||||
"install_once": false,
|
||||
"target_arch": ["x86_64"]
|
||||
}
|
@ -22,5 +22,6 @@
|
||||
},
|
||||
"envs": [],
|
||||
"build_once": false,
|
||||
"install_once": false
|
||||
"install_once": false,
|
||||
"target_arch": ["x86_64"]
|
||||
}
|
@ -19,5 +19,6 @@
|
||||
"clean": {
|
||||
"clean_command": "make clean"
|
||||
},
|
||||
"envs": []
|
||||
"envs": [],
|
||||
"target_arch": ["x86_64"]
|
||||
}
|
@ -20,5 +20,6 @@
|
||||
"clean": {
|
||||
"clean_command": "make clean"
|
||||
},
|
||||
"envs": []
|
||||
"envs": [],
|
||||
"target_arch": ["x86_64"]
|
||||
}
|
@ -18,5 +18,6 @@
|
||||
},
|
||||
"clean": {
|
||||
"clean_command": "make clean"
|
||||
}
|
||||
},
|
||||
"target_arch": ["x86_64"]
|
||||
}
|
||||
|
@ -20,5 +20,6 @@
|
||||
"clean": {
|
||||
"clean_command": "make clean"
|
||||
},
|
||||
"envs": []
|
||||
"envs": [],
|
||||
"target_arch": ["x86_64"]
|
||||
}
|
@ -18,5 +18,6 @@
|
||||
},
|
||||
"clean": {
|
||||
"clean_command": "make clean"
|
||||
}
|
||||
},
|
||||
"target_arch": ["x86_64"]
|
||||
}
|
||||
|
@ -22,5 +22,6 @@
|
||||
},
|
||||
"envs": [],
|
||||
"build_once": false,
|
||||
"install_once": false
|
||||
"install_once": false,
|
||||
"target_arch": ["x86_64"]
|
||||
}
|
@ -19,5 +19,6 @@
|
||||
"clean": {
|
||||
"clean_command": "make clean"
|
||||
},
|
||||
"envs": []
|
||||
"envs": [],
|
||||
"target_arch": ["x86_64"]
|
||||
}
|
||||
|
@ -20,5 +20,6 @@
|
||||
"clean": {
|
||||
"clean_command": "make clean"
|
||||
},
|
||||
"envs": []
|
||||
"envs": [],
|
||||
"target_arch": ["x86_64"]
|
||||
}
|
@ -18,5 +18,6 @@
|
||||
},
|
||||
"clean": {
|
||||
"clean_command": "make clean"
|
||||
}
|
||||
},
|
||||
"target_arch": ["x86_64"]
|
||||
}
|
||||
|
@ -18,5 +18,6 @@
|
||||
},
|
||||
"clean": {
|
||||
"clean_command": "make clean"
|
||||
}
|
||||
},
|
||||
"target_arch": ["x86_64"]
|
||||
}
|
||||
|
@ -19,5 +19,6 @@
|
||||
"clean": {
|
||||
"clean_command": "make clean"
|
||||
},
|
||||
"envs": []
|
||||
"envs": [],
|
||||
"target_arch": ["x86_64"]
|
||||
}
|
@ -19,5 +19,6 @@
|
||||
"clean": {
|
||||
"clean_command": "make clean"
|
||||
},
|
||||
"envs": []
|
||||
"envs": [],
|
||||
"target_arch": ["x86_64"]
|
||||
}
|
||||
|
@ -19,5 +19,6 @@
|
||||
"clean": {
|
||||
"clean_command": "make clean"
|
||||
},
|
||||
"envs": []
|
||||
"envs": [],
|
||||
"target_arch": ["x86_64"]
|
||||
}
|
@ -19,5 +19,6 @@
|
||||
"clean": {
|
||||
"clean_command": "make clean"
|
||||
},
|
||||
"envs": []
|
||||
"envs": [],
|
||||
"target_arch": ["x86_64"]
|
||||
}
|
||||
|
@ -18,5 +18,6 @@
|
||||
},
|
||||
"install": {
|
||||
"in_dragonos_path": "/"
|
||||
}
|
||||
},
|
||||
"target_arch": ["x86_64"]
|
||||
}
|
||||
|
@ -19,5 +19,6 @@
|
||||
"clean": {
|
||||
"clean_command": "make clean"
|
||||
},
|
||||
"envs": []
|
||||
"envs": [],
|
||||
"target_arch": ["x86_64"]
|
||||
}
|
||||
|
@ -22,5 +22,6 @@
|
||||
},
|
||||
"envs": [],
|
||||
"build_once": false,
|
||||
"install_once": false
|
||||
"install_once": false,
|
||||
"target_arch": ["x86_64"]
|
||||
}
|
@ -21,5 +21,6 @@
|
||||
},
|
||||
"envs": [],
|
||||
"build_once": false,
|
||||
"install_once": false
|
||||
"install_once": false,
|
||||
"target_arch": ["x86_64"]
|
||||
}
|
@ -19,5 +19,6 @@
|
||||
"clean": {
|
||||
"clean_command": "make clean"
|
||||
},
|
||||
"envs": []
|
||||
"envs": [],
|
||||
"target_arch": ["x86_64"]
|
||||
}
|
||||
|
Reference in New Issue
Block a user