栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

[精简linux] 快速在window搭建linux验证平台,并移植freertos

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

[精简linux] 快速在window搭建linux验证平台,并移植freertos

基于windos应用商店的ubuntu系统,解压即用,方便快捷,

下载地址:https://download.csdn.net/download/qq_29246181/85211796

一、 任意目录解压后,如图

二、 双击运行“ubuntu.exe”
  1. 初次运行,会解压文件,稍等几分钟。
  2. 安装完毕后,会提示创建用户号和密码
  3. 创建完毕后,如图

三、 自动将windos硬盘映射。(演示位置)


映射位置如图,在mnt位置挂载了C盘和D盘

四、 修改镜像源,方便下载工具

  1. 替换以下内容
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
  1. 执行更新命令

sudo apt update
sudo apt ugrade

五、安装cmkae和g++

sudo apt install cmake
sudo apt install g++

六、如何在linux运行freertos

打包文件:https://download.csdn.net/download/qq_29246181/85212272
自行解压到非中文路径

  1. 通过ubuntu进入上述文件路径 cd freertos_linux/
  2. 进入bulid文件夹,cd build/

推荐建立build目录进行编译,所有的中间文件都会生成在build目录下,需要删除时直接清空该目录即可

  1. 执行 cmake 命令,该命令使cmake检测编译环境,并生成相应的makefile
cmake ..

  1. 在当前路径,执行make,并生成目标文件,main

  2. 运行目标文件 执行./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;
}
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/837745.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号