外包公司做网站有哪些内容,google play 安卓下载,建设教育工程网站,郑州网络公司排名前言 最近打算移植搭建 一些常见的 RTOS 的 qemu 开发学习环境#xff0c;当前 RT-Thread、FreeRTOS 已经成功运行 qemu#xff0c;LiteOS 初步验证可以正常 运行 qemu realview-pbx-a9#xff0c;这里做个记录 首先学习或者研究 RTOS#xff0c;只是看内核源码#xff0…前言 最近打算移植搭建 一些常见的 RTOS 的 qemu 开发学习环境当前 RT-Thread、FreeRTOS 已经成功运行 qemuLiteOS 初步验证可以正常 运行 qemu realview-pbx-a9这里做个记录 首先学习或者研究 RTOS只是看内核源码会比较的枯燥而是要开发板可能一上来牵涉过多的硬件驱动造成学习研究 RTOS 内核的兴趣降低了一些前期需要对 RTOS 内核的运行有个全局的掌握此时是要 qemu 来学习与验证相对于实际的开发板会便捷与高效
LiteOS 当前 验证的 LiteOS 内核是 https://gitee.com/LiteOS/LiteOS 这里与 https://gitee.com/openharmony/kernel_liteos_a 相比可能有一点区别不过前期建议使用 LiteOS 验证kernel_liteos_a 缺少一些板级的配置文件 可以通过 Git 克隆 LiteOS 内核当前 qemu 验证发现不再需要其他的软件包就可以运行起来 git clone https://gitee.com/LiteOS/LiteOS.git
qemu realview-pbx-a9 git 克隆 LiteOS 的内核仓库后可以进入内核通过查看内核目录 tools/build/config/ 发现有一些支持的板子的配置文件其中 qemu 当前支持 qemu-virt-a53.config realview-pbx-a9.config当前建议使用 realview-pbx-a9.config因为是 ARM 平台相关的资料与编译工具链比较的方便获取 配置文件 复制 tools/build/config/realview-pbx-a9.config 到内核根目录下改为 .config 文件 内核目录下执行 make menuconfig 可以进入图形界面配置 【备注】如果 make menuconfig 失败一般需要配置 交叉编译环境
配置 arm gcc 交叉编译环境 下载 arm gcc 交叉编译工具链 在 ARM 官方下载 https://developer.arm.com/downloads/-/gnu-rm当前验证的版本 gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2我当前使用 gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 可以正常编译 下载 arm gcc 工具链后解压到 Linux 环境ubuntu 20.04然后设置环境变量如修改 /etc/profile 文件 sudo vim /etc/profile 最后添加 : export PATH$PATH:/home/zhangsz/tools/gcc-arm-none-eabi-10-2020-q4-major/bin 然后保存 source /etc/profile 使环境变量生效 可以在 shell 运行 arm-none-eabi-gcc -v 确认 arm gcc 工具链环境变量生效 安装 kconfiglib LiteOS 需要安装 python2 版本的 kconfiglib 如果当前 Linux 如 ubuntu 20.04 无法安装 python2 版本的 kconfiglib需要手动获取 python2 版本的 pip然后再 使用 python2 版本的 pip 安装 kconfiglib 我当前的系统 ubuntu 20.04python 版本是 Python 2.7.18但是没有 python 2 版本的 pip默认 pip 的版本是 python3的所以需要手动安装 python2 版本的 pip 获取 get-pip.py获取的地址https://bootstrap.pypa.io/pip/2.7/get-pip.pyubuntu 可以使用 wget https://bootstrap.pypa.io/pip/2.7/get-pip.py 获取 然后确保当前的 python 版本是 2 版本 使用 python get-pip.py 即可安装 python2 版本的 pip 安装 完 python2 版本的 pip再安装 kconfiglib命令
$ pip --version
pip 20.3.4 from /home/zhangsz/.local/lib/python2.7/site-packages/pip (python 2.7)$ pip install Kconfiglibmenuconfig 配置 LiteOS
当前可以直接保存不需要配置后面熟悉了 LiteOS 的内核与功能模块可以尝试添加与修改内核的配置
编译 LiteOS make 即可编译如果提示 arm-none-eabi-gcc 工具链没有找到请按上面的操作先把 arm gcc 工具链配置好 编译完成后就可以运行 qemu realview-pbx-a9 了
运行 qemu realview-pbx-a9 编写一个 qemu.sh 的 shell 脚本内容如下并 chmod x qemu.sh 设置可执行权限 其中 out/realview-pbx-a9/Huawei_LiteOS.bin 是 qemu realview-pbx-a9 的编译后的产物
#!/bin/bashqemu-system-arm -machine realview-pbx-a9 \-smp 4 -m 512M \-kernel out/realview-pbx-a9/Huawei_LiteOS.bin \-nographic运行 ./qemu.sh 进入了 LiteOS 的 shellLiteOS 运行起来了
小结 本篇记录 了 LiteOS 在 qemu realview-pbx-a9 上的环境搭建、系统运行 后续继续熟悉 LiteOS尝试使用 GDB 调试基于 qemu 的 LiteOS 内核了解内核的启动流程、内核模块等