技术文档和视频

This commit is contained in:
bj 2021-11-29 11:27:11 +08:00
parent 86b1d9c77d
commit d4f7820613
13 changed files with 1043 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

View File

@ -0,0 +1,234 @@
# 技术报告(作品类别:系统软件)
## 1.设计方案
Add QEMU support for XiUOS based on Cortex-M4
- 分析操作系统启动流程并且确定移植方案
<div align= "center">
<img src = img/road.png width =1000>
</div>
如图操作系统在启动时需进行一系列初始化操作包括设置内存起止地址和大小设置堆栈、指针等。这些操作随着主板的变化而变化。因此为了将XiUOS移植到cortex-m4-emulator平台需要针对该平台编写相应的初始化代码。增加 xiuos\Ubiquitous\XiUOS\board\cortex-m4-emulator 目录目录包括cortex-m4初始化代码。
- XiUOS 用cortex-m4-emulator编译
修改 xiuos\Ubiquitous\XiUOS 文件夹下的 path_kernel.mk 、 Makefile 、 kconfig 和 xconfig.h
修改 xiuos\Ubiquitous\XiUOS\arch\arm 文件下的 Makefile
- 编译后的XiUOS在QEMU运行
## 2.实现方案
### 2.1 编译环境搭建
#### 推荐使用:
**操作系统:** ubuntu18.04 [https://ubuntu.com/download/desktop](https://ubuntu.com/download/desktop)
更新`ubuntu 18.04`源的方法:(根据自身情况而定,可以不更改)
第一步:打开sources.list文件
```c
sudo vim /etc/apt/sources.list
```
第二步:将以下内容复制到sources.list文件
```c
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
```
第三步:更新源和系统软件
```c
sudo apt-get update
sudo apt-get upgrade
```
**开发工具推荐使用 VSCode VScode下载地址为** VSCode [https://code.visualstudio.com/](https://code.visualstudio.com/),推荐下载地址为 [http://vscode.cdn.azure.cn/stable/3c4e3df9e89829dce27b7b5c24508306b151f30d/code_1.55.2-1618307277_amd64.deb](http://vscode.cdn.azure.cn/stable/3c4e3df9e89829dce27b7b5c24508306b151f30d/code_1.55.2-1618307277_amd64.deb)
#### 依赖包安装:
```
$ sudo apt install build-essential pkg-config git
$ sudo apt install gcc make libncurses5-dev openssl libssl-dev bison flex libelf-dev autoconf libtool gperf libc6-dev
```
**XiUOS操作系统源码下载** XiUOS [https://forgeplus.trustie.net/projects/xuos/xiuos](https://forgeplus.trustie.net/projects/xuos/xiuos)
新建一个空文件夹并进入文件夹中,并下载源码,具体命令如下:
```c
mkdir test && cd test
git clone https://git.trustie.net/xuos/xiuos.git
```
打开源码文件包可以看到以下目录:
| 名称 | 说明 |
| ----------- | ---------- |
| application | 应用代码 |
| board | 板级支持包 |
| framework | 应用框架 |
| fs | 文件系统 |
| kernel | 内核源码 |
| resources | 驱动文件 |
| tool | 系统工具 |
使用VScode打开代码具体操作步骤为在源码文件夹下打开系统终端输入`code .`即可打开VScode开发环境如下图所示
<div align= "center">
<img src = img/vscode.jpg width =1000>
</div>
#### 裁减配置工具的下载
裁减配置工具:
**工具地址:** kconfig-frontends [https://forgeplus.trustie.net/projects/xuos/kconfig-frontends](https://forgeplus.trustie.net/projects/xuos/kconfig-frontends),下载与安装的具体命令如下:
```c
mkdir kfrontends && cd kfrontends
git clone https://git.trustie.net/xuos/kconfig-frontends.git
```
下载源码后按以下步骤执行软件安装:
```c
cd kconfig-frontends
./xs_build.sh
```
#### 编译工具链:
ARM arm-none-eabi(`gcc version 6.3.1`)默认安装到Ubuntu的/usr/bin/arm-none-eabi-,使用如下命令行下载和安装。
```shell
$ sudo apt install gcc-arm-none-eabi
```
### 2.2 XiUOS 用cortex-m4编译
#### 编辑环境:`Ubuntu18.04`
#### 编译工具链:`arm-none-eabi-gcc`
使用`VScode`打开工程的方法有多种,本文介绍一种快捷键,在项目目录下将`code .`输入linux系统命令终端即可打开目标项目
编译步骤:
1.在VScode命令终端中执行以下命令生成配置文件
```c
make BOARD=cortex-m4-emulator menuconfig
```
2.在menuconfig界面配置需要关闭和开启的功能按回车键进入下级菜单按Y键选中需要开启的功能按N键选中需要关闭的功能配置结束后保存并退出本例旨在演示简单的输出例程所以没有需要配置的选项双击快捷键ESC退出配置
<div align= "center">
<img src = img/menuconfig.png width =1000>
</div>
退出时选择`yes`保存上面所配置的内容,如下图所示:
<div align= "center">
<img src = img/menuconfig1.png width =1000>
</div>
3.继续执行以下命令,进行编译
```
make BOARD=cortex-m4-emulator
```
4.如果编译正确无误会产生XiUOS_cortex-m4-emulator.elf、XiUOS_cortex-m4-emulator.bin文件。
### 2.3 QEMU环境
QEMU 是一个通用的开源模拟器和虚拟化工具。目前QEMU已经可以较完整的支持ARM cortex-m4架构。XiUOS同样支持运行在QEMU上
| 硬件 | 描述 |
| -------- | ------------- |
| 芯片型号 | netduinoplus2 |
| 架构 | cortex-m4 |
| 主频 | 168MHz |
| 片内SRAM | 100+KB |
| 外设支持 | UART、GPIO |
## 3.运行效果
### 3.1 安装QEMU
```
sudo apt install qemu-system-arm
```
### 3.2 运行结果
通过以下命令启动QEMU并加载XiUOS ELF文件
```
qemu-system-arm -machine netduinoplus2 -nographic -kernel build/XiUOS_cortex-m4-emulator.elf
```
QEMU运行起来后将会在终端上看到信息打印输出
<div align= "center">
<img src = img/terminal.png width =1000>
</div>
### 3.3 调试
通过QEMU可以方便的对XiUOS进行调试首先安装gdb调试工具
```
sudo apt install gdb-multiarch
```
并通过以下命令启动QEMU
```
qemu-system-arm -machine netduinoplus2 -nographic -kernel build/XiUOS_cortex-m4-emulator.elf -s -S
```
然后要重新开启另一个linux系统终端一个终端执行`riscv-none-embed-gdb`命令
```
gdb-multiarch build/XiUOS_cortex-m4-emulator.elf -ex "target remote localhost:1234"
```

View File

@ -0,0 +1,171 @@
#ifndef XS_CONFIG_H__
#define XS_CONFIG_H__
/* Automatically generated file; DO NOT EDIT. */
/* XiUOS Project Configuration */
#define BOARD_CORTEX_M3_EVB
#define KERNEL_CONSOLE_DEVICE_NAME "uart0"
#define ARCH_ARM
/* cortex-m3 emulator feature */
/* config default board resources */
/* config board app name */
#define BOARD_APP_NAME "/XiUOS_cortex-m3-emulator_app.bin"
/* config board service table */
#define SERVICE_TABLE_ADDRESS 0x2007F0000
#define __STACKSIZE__ 4096
/* Hardware feature */
#define RESOURCES_SERIAL
#define SERIAL_USING_DMA
#define SERIAL_RB_BUFSZ 64
/* Kernel feature */
/* separate compile(choose none for compile once) */
#define APP_STARTUP_FROM_FLASH
/* Memory Management */
#define MEM_ALIGN_SIZE 4
#define MM_PAGE_SIZE 1024
/* Using small memory allocator */
#define KERNEL_SMALL_MEM_ALLOC
#define SMALL_NUMBER_32B 32
#define SMALL_NUMBER_64B 16
/* Task feature */
#define USER_APPLICATION
/* Inter-Task communication */
#define KERNEL_SEMAPHORE
#define KERNEL_MUTEX
#define KERNEL_EVENT
#define KERNEL_MESSAGEQUEUE
#define KERNEL_SOFTTIMER
#define SCHED_POLICY_RR_REMAINSLICE
#define KTASK_PRIORITY_8
#define KTASK_PRIORITY_MAX 8
#define TICK_PER_SECOND 100
#define KERNEL_STACK_OVERFLOW_CHECK
#define IDLE_KTASK_STACKSIZE 512
#define ZOMBIE_KTASK_STACKSIZE 512
/* Kernel Console */
#define KERNEL_CONSOLE
#define KERNEL_BANNER
#define KERNEL_CONSOLEBUF_SIZE 128
/* Kernel Hook */
/* Command shell */
#define TOOL_SHELL
#define SHELL_ENTER_CR
#define SHELL_ENTER_LF
#define SHELL_ENTER_CR_AND_LF
/* Set shell user control */
#define SHELL_DEFAULT_USER "letter"
#define SHELL_DEFAULT_USER_PASSWORD ""
#define SHELL_LOCK_TIMEOUT 10000
/* Set shell config param */
#define SHELL_TASK_STACK_SIZE 2048
#define SHELL_TASK_PRIORITY 5
#define SHELL_MAX_NUMBER 5
#define SHELL_PARAMETER_MAX_NUMBER 8
#define SHELL_HISTORY_MAX_NUMBER 5
#define SHELL_PRINT_BUFFER 128
#define SHELL_HELP_SHOW_PERMISSION
/* Kernel data structure Manage */
#define KERNEL_QUEUEMANAGE
#define KERNEL_WORKQUEUE
#define WORKQUEUE_KTASK_STACKSIZE 256
#define WORKQUEUE_KTASK_PRIORITY 6
#define QUEUE_MAX 2
#define KERNEL_WAITQUEUE
#define KERNEL_DATAQUEUE
/* Kernel components init */
#define NAME_NUM_MAX 32
/* hash table config */
#define ID_HTABLE_SIZE 4
#define ID_NUM_MAX 16
/* Lib */
#define LIB
#define LIB_POSIX
/* C++ features */
#define LIB_NEWLIB
/* File system */
#define FS_VFS
#define VFS_USING_WORKDIR
#define FS_VFS_DEVFS
#define FS_VFS_FATFS
/* APP_Framework */
/* Applications */
/* config stack size and priority of main task */
#define MAIN_KTASK_STACK_SIZE 2048
#define MAIN_KTASK_PRIORITY 4
/* test app */
/* connection app */
/* control app */
/* knowing app */
/* sensor app */
/* Framework */
#define TRANSFORM_LAYER_ATTRIUBUTE
#define ADD_XIUOS_FETURES
#define SUPPORT_SENSOR_FRAMEWORK
#define SUPPORT_KNOWING_FRAMEWORK
#define USING_KPU_POSTPROCESSING
/* Security */
/* lib */
#define APP_SELECT_NEWLIB
#endif

View File

@ -0,0 +1,195 @@
#ifndef XS_CONFIG_H__
#define XS_CONFIG_H__
/* Automatically generated file; DO NOT EDIT. */
/* XiUOS Project Configuration */
#define BOARD_CORTEX_M4_EVB
#define ARCH_ARM
/* cortex-m4-emulator feature */
#define BSP_USING_DMA
#define BSP_USING_GPIO
#define PIN_BUS_NAME "pin"
#define PIN_DRIVER_NAME "pin_drv"
#define PIN_DEVICE_NAME "pin_dev"
#define BSP_USING_UART
#define BSP_USING_USART1
#define SERIAL_BUS_NAME_1 "usart1"
#define SERIAL_DRV_NAME_1 "usart1_drv"
#define SERIAL_1_DEVICE_NAME_0 "usart1_dev1"
#define BSP_USING_USART2
#define SERIAL_BUS_NAME_2 "usart2"
#define SERIAL_DRV_NAME_2 "usart2_drv"
#define SERIAL_2_DEVICE_NAME_0 "usart2_dev2"
#define BSP_USING_USART3
#define SERIAL_BUS_NAME_3 "usart3"
#define SERIAL_DRV_NAME_3 "usart3_drv"
#define SERIAL_3_DEVICE_NAME_0 "usart3_dev3"
/* config default board resources */
/* config board app name */
#define BOARD_APP_NAME "/XiUOS_cortex-m4-emulator_app.bin"
/* config board service table */
#define SERVICE_TABLE_ADDRESS 0x20000000
/* config hardware resources for connection */
/* Hardware feature */
#define RESOURCES_SERIAL
#define SERIAL_USING_DMA
#define SERIAL_RB_BUFSZ 128
#define RESOURCES_PIN
/* Kernel feature */
/* separate compile(choose none for compile once) */
#define APP_STARTUP_FROM_FLASH
/* Memory Management */
#define MEM_ALIGN_SIZE 8
#define MM_PAGE_SIZE 4096
/* Using small memory allocator */
#define KERNEL_SMALL_MEM_ALLOC
#define SMALL_NUMBER_32B 64
#define SMALL_NUMBER_64B 32
/* Task feature */
#define USER_APPLICATION
/* Inter-Task communication */
#define KERNEL_SEMAPHORE
#define KERNEL_MUTEX
#define KERNEL_EVENT
#define KERNEL_MESSAGEQUEUE
#define KERNEL_SOFTTIMER
#define SCHED_POLICY_RR_REMAINSLICE
#define KTASK_PRIORITY_32
#define KTASK_PRIORITY_MAX 32
#define TICK_PER_SECOND 100
#define KERNEL_STACK_OVERFLOW_CHECK
#define IDLE_KTASK_STACKSIZE 1024
#define ZOMBIE_KTASK_STACKSIZE 2048
/* Kernel Console */
#define KERNEL_CONSOLE
#define KERNEL_BANNER
#define KERNEL_CONSOLEBUF_SIZE 128
/* Kernel Hook */
/* Command shell */
#define TOOL_SHELL
#define SHELL_ENTER_CR
#define SHELL_ENTER_LF
#define SHELL_ENTER_CR_AND_LF
/* Set shell user control */
#define SHELL_DEFAULT_USER "letter"
#define SHELL_DEFAULT_USER_PASSWORD ""
#define SHELL_LOCK_TIMEOUT 10000
/* Set shell config param */
#define SHELL_TASK_STACK_SIZE 4096
#define SHELL_TASK_PRIORITY 20
#define SHELL_MAX_NUMBER 5
#define SHELL_PARAMETER_MAX_NUMBER 8
#define SHELL_HISTORY_MAX_NUMBER 5
#define SHELL_PRINT_BUFFER 128
#define SHELL_HELP_SHOW_PERMISSION
#define SHELL_HELP_LIST_VAR
/* Kernel data structure Manage */
#define KERNEL_QUEUEMANAGE
#define KERNEL_WORKQUEUE
#define WORKQUEUE_KTASK_STACKSIZE 2048
#define WORKQUEUE_KTASK_PRIORITY 23
#define QUEUE_MAX 16
#define KERNEL_WAITQUEUE
#define KERNEL_DATAQUEUE
/* Kernel components init */
#define KERNEL_COMPONENTS_INIT
#define ENV_INIT_KTASK_STACK_SIZE 8192
#define KERNEL_USER_MAIN
#define NAME_NUM_MAX 32
/* hash table config */
#define ID_HTABLE_SIZE 16
#define ID_NUM_MAX 128
/* Lib */
#define LIB
#define LIB_POSIX
/* C++ features */
#define LIB_NEWLIB
/* File system */
#define FS_VFS
#define VFS_USING_WORKDIR
#define FS_VFS_DEVFS
#define FS_VFS_FATFS
/* APP_Framework */
/* Applications */
/* config stack size and priority of main task */
#define MAIN_KTASK_STACK_SIZE 1024
#define MAIN_KTASK_PRIORITY 10
/* test app */
/* connection app */
/* control app */
/* knowing app */
/* sensor app */
/* Framework */
#define TRANSFORM_LAYER_ATTRIUBUTE
#define ADD_XIUOS_FETURES
#define SUPPORT_SENSOR_FRAMEWORK
#define SUPPORT_KNOWING_FRAMEWORK
#define USING_KPU_POSTPROCESSING
/* Security */
/* lib */
#define APP_SELECT_NEWLIB
#endif

View File

@ -0,0 +1,199 @@
#ifndef XS_CONFIG_H__
#define XS_CONFIG_H__
/* Automatically generated file; DO NOT EDIT. */
/* XiUOS Project Configuration */
#define BOARD_STM32F407_EVB
#define ARCH_ARM
/* stm32f407-st-discovery feature */
#define BSP_USING_DMA
#define BSP_USING_GPIO
#define PIN_BUS_NAME "pin"
#define PIN_DRIVER_NAME "pin_drv"
#define PIN_DEVICE_NAME "pin_dev"
#define BSP_USING_UART
#define BSP_USING_USART1
#define SERIAL_BUS_NAME_1 "usart1"
#define SERIAL_DRV_NAME_1 "usart1_drv"
#define SERIAL_1_DEVICE_NAME_0 "usart1_dev1"
#define BSP_USING_USART2
#define SERIAL_BUS_NAME_2 "usart2"
#define SERIAL_DRV_NAME_2 "usart2_drv"
#define SERIAL_2_DEVICE_NAME_0 "usart2_dev2"
#define BSP_USING_USART3
#define SERIAL_BUS_NAME_3 "usart3"
#define SERIAL_DRV_NAME_3 "usart3_drv"
#define SERIAL_3_DEVICE_NAME_0 "usart3_dev3"
#define BSP_USING_WDT
#define WDT_BUS_NAME "wdt"
#define WDT_DRIVER_NAME "wdt_drv"
#define WDT_DEVICE_NAME "wdt_dev"
/* config default board resources */
/* config board app name */
#define BOARD_APP_NAME "/XiUOS_stm32f407-st-discovery_app.bin"
/* config board service table */
#define SERVICE_TABLE_ADDRESS 0x20000000
/* config hardware resources for connection */
/* Hardware feature */
#define RESOURCES_SERIAL
#define SERIAL_USING_DMA
#define SERIAL_RB_BUFSZ 128
#define RESOURCES_PIN
#define RESOURCES_WDT
/* Kernel feature */
/* separate compile(choose none for compile once) */
#define APP_STARTUP_FROM_FLASH
/* Memory Management */
#define MEM_ALIGN_SIZE 8
#define MM_PAGE_SIZE 4096
/* Using small memory allocator */
#define KERNEL_SMALL_MEM_ALLOC
#define SMALL_NUMBER_32B 64
#define SMALL_NUMBER_64B 32
/* Task feature */
#define USER_APPLICATION
/* Inter-Task communication */
#define KERNEL_SEMAPHORE
#define KERNEL_MUTEX
#define KERNEL_EVENT
#define KERNEL_MESSAGEQUEUE
#define KERNEL_SOFTTIMER
#define SCHED_POLICY_RR_REMAINSLICE
#define KTASK_PRIORITY_32
#define KTASK_PRIORITY_MAX 32
#define TICK_PER_SECOND 1000
#define KERNEL_STACK_OVERFLOW_CHECK
#define IDLE_KTASK_STACKSIZE 256
#define ZOMBIE_KTASK_STACKSIZE 2048
/* Kernel Console */
#define KERNEL_CONSOLE
#define KERNEL_BANNER
#define KERNEL_CONSOLEBUF_SIZE 128
/* Kernel Hook */
/* Command shell */
#define TOOL_SHELL
#define SHELL_ENTER_CR
#define SHELL_ENTER_LF
#define SHELL_ENTER_CR_AND_LF
/* Set shell user control */
#define SHELL_DEFAULT_USER "letter"
#define SHELL_DEFAULT_USER_PASSWORD ""
#define SHELL_LOCK_TIMEOUT 10000
/* Set shell config param */
#define SHELL_TASK_STACK_SIZE 4096
#define SHELL_TASK_PRIORITY 20
#define SHELL_MAX_NUMBER 5
#define SHELL_PARAMETER_MAX_NUMBER 8
#define SHELL_HISTORY_MAX_NUMBER 5
#define SHELL_PRINT_BUFFER 128
#define SHELL_HELP_SHOW_PERMISSION
/* Kernel data structure Manage */
#define KERNEL_QUEUEMANAGE
#define KERNEL_WORKQUEUE
#define WORKQUEUE_KTASK_STACKSIZE 512
#define WORKQUEUE_KTASK_PRIORITY 23
#define QUEUE_MAX 16
#define KERNEL_WAITQUEUE
#define KERNEL_DATAQUEUE
/* Kernel components init */
#define KERNEL_COMPONENTS_INIT
#define ENV_INIT_KTASK_STACK_SIZE 8192
#define KERNEL_USER_MAIN
#define NAME_NUM_MAX 32
/* hash table config */
#define ID_HTABLE_SIZE 16
#define ID_NUM_MAX 128
/* Lib */
#define LIB
#define LIB_POSIX
/* C++ features */
#define LIB_NEWLIB
/* File system */
#define FS_VFS
#define VFS_USING_WORKDIR
#define FS_VFS_DEVFS
#define FS_VFS_FATFS
/* APP_Framework */
/* Applications */
/* config stack size and priority of main task */
#define MAIN_KTASK_STACK_SIZE 2048
#define MAIN_KTASK_PRIORITY 10
/* test app */
/* connection app */
/* control app */
/* knowing app */
/* sensor app */
/* Framework */
#define TRANSFORM_LAYER_ATTRIUBUTE
#define ADD_XIUOS_FETURES
#define SUPPORT_SENSOR_FRAMEWORK
#define SUPPORT_KNOWING_FRAMEWORK
#define USING_KPU_POSTPROCESSING
/* Security */
/* lib */
#define APP_SELECT_NEWLIB
#endif

View File

@ -0,0 +1,194 @@
#ifndef XS_CONFIG_H__
#define XS_CONFIG_H__
/* Automatically generated file; DO NOT EDIT. */
/* XiUOS Project Configuration */
#define BOARD_STM32F407_EVB
#define ARCH_ARM
/* stm32f407zgt6 feature */
#define BSP_USING_GPIO
#define PIN_BUS_NAME "pin"
#define PIN_DRIVER_NAME "pin_drv"
#define PIN_DEVICE_NAME "pin_dev"
#define BSP_USING_UART
#define BSP_USING_USART1
#define SERIAL_BUS_NAME_1 "usart1"
#define SERIAL_DRV_NAME_1 "usart1_drv"
#define SERIAL_1_DEVICE_NAME_0 "usart1_dev1"
#define BSP_USING_USART2
#define SERIAL_BUS_NAME_2 "usart2"
#define SERIAL_DRV_NAME_2 "usart2_drv"
#define SERIAL_2_DEVICE_NAME_0 "usart2_dev2"
#define BSP_USING_USART3
#define SERIAL_BUS_NAME_3 "usart3"
#define SERIAL_DRV_NAME_3 "usart3_drv"
#define SERIAL_3_DEVICE_NAME_0 "usart3_dev3"
/* config default board resources */
/* config board app name */
#define BOARD_APP_NAME "/XiUOS_stm32f407zgt6_app.bin"
/* config board service table */
#define SERVICE_TABLE_ADDRESS 0x20000000
/* config hardware resources for connection */
/* Hardware feature */
#define RESOURCES_SERIAL
#define SERIAL_USING_DMA
#define SERIAL_RB_BUFSZ 128
#define RESOURCES_PIN
/* Kernel feature */
/* separate compile(choose none for compile once) */
#define APP_STARTUP_FROM_FLASH
/* Memory Management */
#define MEM_ALIGN_SIZE 8
#define MM_PAGE_SIZE 4096
/* Using small memory allocator */
#define KERNEL_SMALL_MEM_ALLOC
#define SMALL_NUMBER_32B 64
#define SMALL_NUMBER_64B 32
/* Task feature */
#define USER_APPLICATION
/* Inter-Task communication */
#define KERNEL_SEMAPHORE
#define KERNEL_MUTEX
#define KERNEL_EVENT
#define KERNEL_MESSAGEQUEUE
#define KERNEL_SOFTTIMER
#define SCHED_POLICY_RR_REMAINSLICE
#define KTASK_PRIORITY_32
#define KTASK_PRIORITY_MAX 32
#define TICK_PER_SECOND 1000
#define KERNEL_STACK_OVERFLOW_CHECK
#define IDLE_KTASK_STACKSIZE 256
#define ZOMBIE_KTASK_STACKSIZE 2048
/* Kernel Console */
#define KERNEL_CONSOLE
#define KERNEL_BANNER
#define KERNEL_CONSOLEBUF_SIZE 128
/* Kernel Hook */
/* Command shell */
#define TOOL_SHELL
#define SHELL_ENTER_CR
#define SHELL_ENTER_LF
#define SHELL_ENTER_CR_AND_LF
/* Set shell user control */
#define SHELL_DEFAULT_USER "letter"
#define SHELL_DEFAULT_USER_PASSWORD ""
#define SHELL_LOCK_TIMEOUT 10000
/* Set shell config param */
#define SHELL_TASK_STACK_SIZE 4096
#define SHELL_TASK_PRIORITY 20
#define SHELL_MAX_NUMBER 5
#define SHELL_PARAMETER_MAX_NUMBER 8
#define SHELL_HISTORY_MAX_NUMBER 5
#define SHELL_PRINT_BUFFER 128
#define SHELL_HELP_SHOW_PERMISSION
#define SHELL_HELP_LIST_VAR
/* Kernel data structure Manage */
#define KERNEL_QUEUEMANAGE
#define KERNEL_WORKQUEUE
#define WORKQUEUE_KTASK_STACKSIZE 512
#define WORKQUEUE_KTASK_PRIORITY 23
#define QUEUE_MAX 16
#define KERNEL_WAITQUEUE
#define KERNEL_DATAQUEUE
/* Kernel components init */
#define KERNEL_COMPONENTS_INIT
#define ENV_INIT_KTASK_STACK_SIZE 8192
#define KERNEL_USER_MAIN
#define NAME_NUM_MAX 32
/* hash table config */
#define ID_HTABLE_SIZE 16
#define ID_NUM_MAX 128
/* Lib */
#define LIB
#define LIB_POSIX
/* C++ features */
#define LIB_NEWLIB
/* File system */
#define FS_VFS
#define VFS_USING_WORKDIR
#define FS_VFS_DEVFS
#define FS_VFS_FATFS
/* APP_Framework */
/* Applications */
/* config stack size and priority of main task */
#define MAIN_KTASK_STACK_SIZE 2048
#define MAIN_KTASK_PRIORITY 10
/* test app */
/* connection app */
/* control app */
/* knowing app */
/* sensor app */
/* Framework */
#define TRANSFORM_LAYER_ATTRIUBUTE
#define ADD_XIUOS_FETURES
#define SUPPORT_SENSOR_FRAMEWORK
#define SUPPORT_KNOWING_FRAMEWORK
#define USING_KPU_POSTPROCESSING
/* Security */
/* lib */
#define APP_SELECT_NEWLIB
#endif

View File

@ -0,0 +1,50 @@
/*
* Copyright (c) 2020 AIIT XUOS Lab
* XiUOS is licensed under Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
* http://license.coscl.org.cn/MulanPSL2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PSL v2 for more details.
*/
/**
* @file: xiuos.h
* @brief: all header files of kernel
* @version: 1.0
* @author: AIIT XUOS Lab
* @date: 2020/3/10
*
*/
#ifndef XIUOS_H
#define XIUOS_H
#include <xsconfig.h>
#include <xs_kdbg.h>
#include <xs_base.h>
#include <xs_mutex.h>
#include <xs_sem.h>
#include <xs_event.h>
#include <xs_msg.h>
#include <xs_ktask.h>
#include <xs_timer.h>
#include <xs_klist.h>
#include <xs_isr.h>
#include <string.h>
#include <stdio.h>
#include <xs_memory.h>
#include <xs_id.h>
#include <xs_ktick.h>
#include <xs_kdevice.h>
#include <xs_init.h>
#include <xs_assign.h>
#include <xs_banner.h>
#include <xs_poll.h>
#include <xs_workqueue.h>
#include <xs_circular_area.h>
#include <xs_dataqueue.h>
#endif