基于windos应用商店的ubuntu系统,解压即用,方便快捷,
下载地址:https://download.csdn.net/download/qq_29246181/85211796
一、 任意目录解压后,如图 二、 双击运行“ubuntu.exe”- 初次运行,会解压文件,稍等几分钟。
- 安装完毕后,会提示创建用户号和密码
- 创建完毕后,如图
三、 自动将windos硬盘映射。(演示位置)
映射位置如图,在mnt位置挂载了C盘和D盘
四、 修改镜像源,方便下载工具
- 替换以下内容
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
- 执行更新命令
五、安装cmkae和g++sudo apt update
sudo apt ugrade
六、如何在linux运行freertossudo apt install cmake
sudo apt install g++
打包文件:https://download.csdn.net/download/qq_29246181/85212272
自行解压到非中文路径
- 通过ubuntu进入上述文件路径 cd freertos_linux/
- 进入bulid文件夹,cd build/
推荐建立build目录进行编译,所有的中间文件都会生成在build目录下,需要删除时直接清空该目录即可
- 执行 cmake 命令,该命令使cmake检测编译环境,并生成相应的makefile
cmake ..
-
在当前路径,执行make,并生成目标文件,main
-
运行目标文件 执行./main
#include#include #include "os_api.h" void task1(void* arg) { while(1) { printf("123n"); os::delay(1000); } } void task2(void* arg) { while(1) { printf("456n"); os::delay(2000); } } int main() { os::task::create(task1, "task1", 1024, 1); os::task::create(task2, "task1", 1024, 2); os::start(); return 0; }


![[精简linux] 快速在window搭建linux验证平台,并移植freertos [精简linux] 快速在window搭建linux验证平台,并移植freertos](http://www.mshxw.com/aiimages/31/837745.png)
